summaryrefslogtreecommitdiff
path: root/client/bankid.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2011-04-23 16:49:44 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2011-04-23 16:49:44 +0200
commit1eb94a5a2a554f4b6ce3411f9fac56e431ca683d (patch)
tree94aade5da32f5930316b10dc595b6d633a6e5d0b /client/bankid.c
parentecafa1a79ab29766b6858529c4e3f0342d7a8644 (diff)
downloadfribid-1eb94a5a2a554f4b6ce3411f9fac56e431ca683d.tar.gz
fribid-1eb94a5a2a554f4b6ce3411f9fac56e431ca683d.tar.bz2
fribid-1eb94a5a2a554f4b6ce3411f9fac56e431ca683d.zip
Implement same-origin check for CreateRequest/StoreCertificates
Diffstat (limited to 'client/bankid.c')
-rw-r--r--client/bankid.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/bankid.c b/client/bankid.c
index b525abd..dce3ebd 100644
--- a/client/bankid.c
+++ b/client/bankid.c
@@ -348,6 +348,7 @@ BankIDError bankid_sign(Token *token,
* @param error A more detailed error code is stored here
*/
BankIDError bankid_createRequest(const RegutilInfo *params,
+ const char *hostname,
const char *password,
char **request,
TokenError *error) {
@@ -355,7 +356,7 @@ BankIDError bankid_createRequest(const RegutilInfo *params,
char *binaryRequest;
size_t brlen;
- *error = backend_createRequest(params, password,
+ *error = backend_createRequest(params, hostname, password,
&binaryRequest, &brlen);
if (*error) return BIDERR_InternalError;
@@ -383,14 +384,14 @@ char *bankid_getRequestDisplayName(const RegutilInfo *params) {
/**
* Stores a certificate chain for a newly created key.
*/
-BankIDError bankid_storeCertificates(const char *certs) {
+BankIDError bankid_storeCertificates(const char *certs, const char *hostname) {
size_t length;
char *p7data = base64_decode_binary(certs, &length);
if (!p7data) return BIDERR_InternalError;
- BankIDError error = backend_storeCertificates(p7data, length);
+ BankIDError error = backend_storeCertificates(p7data, length, hostname);
free(p7data);
return error;