summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2009-12-30 16:24:06 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:15 +0100
commita20f3786882ad94d9913d4d951bc441908f91e8c (patch)
tree9e24f509906b72f5f0562ec3691cabef6712ec33 /plugin
parentf7f4e12e35289247f8d6ffb688f7099b84632774 (diff)
downloadfribid-a20f3786882ad94d9913d4d951bc441908f91e8c.tar.gz
fribid-a20f3786882ad94d9913d4d951bc441908f91e8c.tar.bz2
fribid-a20f3786882ad94d9913d4d951bc441908f91e8c.zip
Error codes for invalid actions and missing parameters
Diffstat (limited to 'plugin')
-rw-r--r--plugin/Makefile2
-rw-r--r--plugin/plugin.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/plugin/Makefile b/plugin/Makefile
index 1543ea5..4b06736 100644
--- a/plugin/Makefile
+++ b/plugin/Makefile
@@ -39,7 +39,7 @@ ipc.o: ../common/pipe.h plugin.h
npmain.o: npobject.h plugin.h
npobject.o: npobject.h plugin.h
pipe.o: ../common/pipe.h ../common/pipe.c
-plugin.o: plugin.h
+plugin.o: ../common/biderror.h plugin.h
np_entry.o: ../npapi/np_entry.c
npn_gate.o: ../npapi/npn_gate.c
diff --git a/plugin/plugin.c b/plugin/plugin.c
index 3b69d9f..00a69c8 100644
--- a/plugin/plugin.c
+++ b/plugin/plugin.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
+#include "../common/biderror.h"
#include "plugin.h"
@@ -111,19 +112,19 @@ int sign_performAction(Plugin *plugin, const char *action) {
plugin->lastError = PE_UnknownError;
if ((plugin->type == PT_Authentication) && !strcmp(action, "Authenticate")) {
if (!hasSignParams(plugin)) {
- return 1;
+ return BIDERR_MissingParameter;
} else {
return sign_performAction_Authenticate(plugin);
}
} else if ((plugin->type == PT_Signer) && !strcmp(action, "Sign")) {
if (!hasSignParams(plugin) || !plugin->info.sign.subjectFilter ||
!plugin->info.sign.message) {
- return 1;
+ return BIDERR_MissingParameter;
} else {
return sign_performAction_Sign(plugin);
}
} else {
- return 1;
+ return BIDERR_InvalidAction;
}
}