summaryrefslogtreecommitdiff
path: root/plugin
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 /plugin
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 'plugin')
-rw-r--r--plugin/ipc.c3
-rw-r--r--plugin/plugin.c2
-rw-r--r--plugin/plugin.h5
3 files changed, 7 insertions, 3 deletions
diff --git a/plugin/ipc.c b/plugin/ipc.c
index 3d618f2..36416e0 100644
--- a/plugin/ipc.c
+++ b/plugin/ipc.c
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2009 Samuel Lidén Borell <samuel@slbdata.se>
+ Copyright (c) 2009-2010 Samuel Lidén Borell <samuel@slbdata.se>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -157,6 +157,7 @@ int sign_performAction_Sign(Plugin *plugin) {
sendSignCommon(pipeinfo, plugin);
pipe_sendString(pipeinfo.out, plugin->info.sign.message);
+ pipe_sendOptionalString(pipeinfo.out, plugin->info.sign.invisibleMessage);
pipe_finishCommand(pipeinfo.out);
diff --git a/plugin/plugin.c b/plugin/plugin.c
index 322f6be..386d3db 100644
--- a/plugin/plugin.c
+++ b/plugin/plugin.c
@@ -69,6 +69,7 @@ void plugin_free(Plugin *plugin) {
free(plugin->info.sign.policys);
free(plugin->info.sign.subjectFilter);
free(plugin->info.sign.message);
+ free(plugin->info.sign.invisibleMessage);
free(plugin->info.sign.signature);
break;
}
@@ -124,6 +125,7 @@ static char **getParamPointer(Plugin *plugin, const char *name) {
case PT_Signer:
if (!strcmp(name, "Nonce")) return &plugin->info.sign.challenge;
if (!strcmp(name, "TextToBeSigned")) return &plugin->info.sign.message;
+ if (!strcmp(name, "NonVisibleData")) return &plugin->info.sign.invisibleMessage;
return getCommonParamPointer(plugin, name);
default:
return NULL;
diff --git a/plugin/plugin.h b/plugin/plugin.h
index 05ccd38..ac78e90 100644
--- a/plugin/plugin.h
+++ b/plugin/plugin.h
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2009 Samuel Lidén Borell <samuel@slbdata.se>
+ Copyright (c) 2009-2010 Samuel Lidén Borell <samuel@slbdata.se>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -53,7 +53,7 @@ typedef struct {
char *challenge;
char *policys;
char *subjectFilter;
- void *dummy0; // To be compatible with .sign below
+ void *dummy0, *dummy1; // To be compatible with .sign below
/* Output parameters */
char *signature;
} auth;
@@ -63,6 +63,7 @@ typedef struct {
char *policys;
char *subjectFilter;
char *message;
+ char *invisibleMessage;
/* Output parameters */
char *signature;
} sign;