summaryrefslogtreecommitdiff
path: root/client/bankid.c
diff options
context:
space:
mode:
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;
}