summaryrefslogtreecommitdiff
path: root/client/bankid.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2014-08-19 23:38:15 +0200
committerSamuel Lidén Borell <samuel@kodafritt.se>2014-08-19 23:38:15 +0200
commitd6ec1e4d28c794a1d3fa92956a313d6dca46fead (patch)
treeaba12c68c9bb4931e714f24939c1d125c3dfc660 /client/bankid.c
parent657bd7b4058125dcc02375cd92b14b73d2d63fa3 (diff)
downloadfribid-d6ec1e4d28c794a1d3fa92956a313d6dca46fead.tar.gz
fribid-d6ec1e4d28c794a1d3fa92956a313d6dca46fead.tar.bz2
fribid-d6ec1e4d28c794a1d3fa92956a313d6dca46fead.zip
Show an error message when certificate retreival fails
Diffstat (limited to 'client/bankid.c')
-rw-r--r--client/bankid.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/client/bankid.c b/client/bankid.c
index 9ea36ca..713c7e4 100644
--- a/client/bankid.c
+++ b/client/bankid.c
@@ -235,23 +235,24 @@ char *bankid_getRequestDisplayName(const RegutilInfo *params) {
/**
* Stores a certificate chain for a newly created key.
*/
-BankIDError bankid_storeCertificates(const char *certs, const char *hostname) {
+BankIDError bankid_storeCertificates(const char *certs, const char *hostname,
+ TokenError *error) {
size_t length;
char *p7data = base64_decode_binary(certs, &length);
if (!p7data) return BIDERR_InternalError;
- TokenError storeerror = backend_storeCertificates(p7data, length, hostname);
- BankIDError error;
- if (storeerror) {
- error = BIDERR_InternalError;
+ *error = backend_storeCertificates(p7data, length, hostname);
+ BankIDError biderr;
+ if (*error) {
+ biderr = BIDERR_InternalError;
} else {
- error = BIDERR_OK;
+ biderr = BIDERR_OK;
}
free(p7data);
- return error;
+ return biderr;
}