summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-06-08 12:18:05 +0300
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-06-08 12:18:05 +0300
commitec93110f061a3c8cc8e6c40a111924b4d334a469 (patch)
tree0b97ccbacb63d74d14c1c126a98903e07f73758c
parent7129b29196e657f1cf5c4020b3fdbecfb6dad572 (diff)
downloadgnutls-ec93110f061a3c8cc8e6c40a111924b4d334a469.tar.gz
added check for empty UID list.
-rw-r--r--lib/opencdk/sig-check.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/opencdk/sig-check.c b/lib/opencdk/sig-check.c
index ada8d5aa72..24c9165f97 100644
--- a/lib/opencdk/sig-check.c
+++ b/lib/opencdk/sig-check.c
@@ -417,12 +417,16 @@ struct verify_uid* p, *p1;
}
/* returns non zero if all UIDs in the list have at least one
- * signature.
+ * signature. If the list is empty or no signatures are present
+ * a zero value is returned.
*/
static int uid_list_all_signed( struct verify_uid * list)
{
struct verify_uid* p, *p1;
+ if (list == NULL)
+ return 0;
+
p = list;
while(p != NULL) {
if (p->nsigs == 0) {
@@ -496,7 +500,7 @@ cdk_pk_check_sigs (cdk_kbnode_t key, cdk_keydb_hd_t keydb, int *r_status)
rc == CDK_Bad_Sig? "BAD" : "good", sig->keyid[1],
keyid);
- if (IS_UID_SIG (sig))
+ if (IS_UID_SIG (sig) && uid_name != NULL)
{
/* add every uid in the uid list. Only consider valid:
* - verification was ok