From 69c35c113c15a76becd819e671b24bb1222de710 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 2 Nov 2012 17:53:44 +0100 Subject: Added error checking before calling eDBget_uid() This is to prepare for eDBget_uid() to also do lookups when certid is not set. Signed-off-by: David Sommerseth --- plugin/eurephia.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugin') diff --git a/plugin/eurephia.c b/plugin/eurephia.c index 880ad71..e41a0dc 100644 --- a/plugin/eurephia.c +++ b/plugin/eurephia.c @@ -543,6 +543,12 @@ int eurephia_connect(eurephiaCTX *ctx, const char **env) { return 0; } certid = eDBauth_TLS(ctx, ci->org, ci->common_name, ci->email, digest, 0); + if( certid < 1 ) { + eurephia_log(ctx, LOG_WARNING, 0, "Failed to lookup certificate: %s/%s/%s [%s]", + ci->org, ci->common_name, ci->email, digest); + free_certinfo(ci); + return 0; + } uid = eDBget_uid(ctx, certid, uname); free_certinfo(ci); -- cgit