summaryrefslogtreecommitdiff
path: root/client/bankid.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-03-23 23:57:03 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-03-23 23:57:03 +0100
commit1eadbd183a474fe072d7099e1a81f73c5de96774 (patch)
tree65e59b589d824e02cf4355e359993367ac0c0a4f /client/bankid.c
parenta46d06fe90c5963e9c769e5bbfa6349721e95cc7 (diff)
downloadfribid-1eadbd183a474fe072d7099e1a81f73c5de96774.tar.gz
fribid-1eadbd183a474fe072d7099e1a81f73c5de96774.tar.bz2
fribid-1eadbd183a474fe072d7099e1a81f73c5de96774.zip
Implement the "NonVisibleData" parameter
This parameter works like TextToBeSigned, except that the text is not shown to the user. It's used by Skatteverket (the Swedish Tax Office) to sign XML documents, for instance.
Diffstat (limited to 'client/bankid.c')
-rw-r--r--client/bankid.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/bankid.c b/client/bankid.c
index 8cb60b4..0d8d5dd 100644
--- a/client/bankid.c
+++ b/client/bankid.c
@@ -228,6 +228,11 @@ static const char signedText_template[] =
"%s"
"</usrVisibleData>";
+static const char signedInvisibleText_template[] =
+ "<usrNonVisibleData>"
+ "%s"
+ "</usrNonVisibleData>";
+
static const char signobj_id[] = "bidSignedData";
/**
@@ -300,12 +305,16 @@ BankIDError bankid_sign(const char *p12Data, const int p12Length,
const char *password,
const char *challenge,
const char *hostname, const char *ip,
- const char *message,
+ const char *message, const char *invisibleMessage,
char **signature) {
BankIDError error;
char *extra = rasprintf(signedText_template, message);
+ if (invisibleMessage) {
+ extra = rasprintf_append(extra, signedInvisibleText_template, invisibleMessage);
+ }
+
error = sign(p12Data, p12Length, person, password, challenge,
hostname, ip, CERTUSE_SIGNING, "Signing", extra, signature);