summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-01-27 13:12:47 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-27 13:12:47 +0100
commit646ce3ff7b95622921243850cc414f7bc42113c9 (patch)
treebeaf9c0c74a93c194b7d5532cf10357e17ab9a78 /plugin
parentae856f8eb2971fca9a6cc3b3c039cb376ce8d27d (diff)
downloadfribid-646ce3ff7b95622921243850cc414f7bc42113c9.tar.gz
fribid-646ce3ff7b95622921243850cc414f7bc42113c9.tar.bz2
fribid-646ce3ff7b95622921243850cc414f7bc42113c9.zip
Made the subject filter optional and a common parameter
Now it can be used in authentication objects too.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ipc.c7
-rw-r--r--plugin/plugin.c3
-rw-r--r--plugin/plugin.h4
3 files changed, 7 insertions, 7 deletions
diff --git a/plugin/ipc.c b/plugin/ipc.c
index e2acdfe..f23e51a 100644
--- a/plugin/ipc.c
+++ b/plugin/ipc.c
@@ -38,7 +38,7 @@
static const char mainBinary[] = SIGNING_EXECUTABLE;
static const char versionOption[] = "--internal--bankid-version-string";
-static const char ipcOption[] = "--internal--ipc";
+static const char ipcOption[] = "--internal--ipc=" IPCVERSION;
static const char windowIdOption[] = "--internal--window-id";
#define PIPE_READ_END 0
@@ -125,8 +125,8 @@ char *version_getVersion(Plugin *plugin) {
static void sendSignCommon(PipeInfo pipeinfo, Plugin *plugin) {
pipe_sendString(pipeinfo.out, plugin->info.auth.challenge);
- pipe_sendString(pipeinfo.out, (plugin->info.auth.policys != NULL ?
- plugin->info.auth.policys : ""));
+ pipe_sendOptionalString(pipeinfo.out, plugin->info.auth.policys);
+ pipe_sendOptionalString(pipeinfo.out, plugin->info.auth.subjectFilter);
pipe_sendString(pipeinfo.out, plugin->url);
pipe_sendString(pipeinfo.out, plugin->hostname);
pipe_sendString(pipeinfo.out, plugin->ip);
@@ -157,7 +157,6 @@ int sign_performAction_Sign(Plugin *plugin) {
sendSignCommon(pipeinfo, plugin);
pipe_sendString(pipeinfo.out, plugin->info.sign.message);
- pipe_sendString(pipeinfo.out, plugin->info.sign.subjectFilter);
pipe_finishCommand(pipeinfo.out);
diff --git a/plugin/plugin.c b/plugin/plugin.c
index 52c85eb..4fd3d97 100644
--- a/plugin/plugin.c
+++ b/plugin/plugin.c
@@ -60,6 +60,7 @@ void plugin_free(Plugin *plugin) {
case PT_Authentication:
free(plugin->info.auth.challenge);
free(plugin->info.auth.policys);
+ free(plugin->info.sign.subjectFilter);
free(plugin->info.auth.signature);
break;
case PT_Signer:
@@ -110,6 +111,7 @@ static void unlockURL(const char *url) {
static char **getCommonParamPointer(Plugin *plugin, const char *name) {
if (!strcmp(name, "Policys")) return &plugin->info.auth.policys;
if (!strcmp(name, "Signature")) return &plugin->info.auth.signature;
+ if (!strcmp(name, "Subjects")) return &plugin->info.sign.subjectFilter;
return NULL;
}
@@ -120,7 +122,6 @@ static char **getParamPointer(Plugin *plugin, const char *name) {
return getCommonParamPointer(plugin, name);
case PT_Signer:
if (!strcmp(name, "Nonce")) return &plugin->info.sign.challenge;
- if (!strcmp(name, "Subjects")) return &plugin->info.sign.subjectFilter;
if (!strcmp(name, "TextToBeSigned")) return &plugin->info.sign.message;
return getCommonParamPointer(plugin, name);
default:
diff --git a/plugin/plugin.h b/plugin/plugin.h
index 3fbfe51..3fd1d9e 100644
--- a/plugin/plugin.h
+++ b/plugin/plugin.h
@@ -50,8 +50,8 @@ typedef struct {
/* Input parameters */
char *challenge;
char *policys;
- void *dummy1; // To be compatible with .sign below
- void *dummy0;
+ char *subjectFilter;
+ void *dummy0; // To be compatible with .sign below
/* Output parameters */
char *signature;
} auth;