summaryrefslogtreecommitdiff
path: root/plugin/plugin.c
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/plugin.c
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/plugin.c')
-rw-r--r--plugin/plugin.c7
1 files changed, 4 insertions, 3 deletions
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;
}
}