diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/call-keyboxd.c | 4 | ||||
-rw-r--r-- | g10/keydb-private.h | 2 | ||||
-rw-r--r-- | g10/keydb.c | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/g10/call-keyboxd.c b/g10/call-keyboxd.c index 9625587ac..99dfac58f 100644 --- a/g10/call-keyboxd.c +++ b/g10/call-keyboxd.c @@ -1049,8 +1049,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, case KEYDB_SEARCH_MODE_UBID: { - unsigned char hexubid[20 * 2 + 1]; - bin2hex (desc[0].u.grip, 20, hexubid); + unsigned char hexubid[UBID_LEN * 2 + 1]; + bin2hex (desc[0].u.grip, UBID_LEN, hexubid); snprintf (line, sizeof line, "SEARCH ^%s", hexubid); } break; diff --git a/g10/keydb-private.h b/g10/keydb-private.h index 47a09ca93..fdc905edf 100644 --- a/g10/keydb-private.h +++ b/g10/keydb-private.h @@ -100,7 +100,7 @@ struct keydb_handle_s unsigned int last_ubid_valid:1; /* The UBID of the last returned keyblock. */ - unsigned char last_ubid[20]; + unsigned char last_ubid[UBID_LEN]; /* END USE_KEYBOXD */ diff --git a/g10/keydb.c b/g10/keydb.c index 57d51e7b7..bf411371e 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -456,8 +456,8 @@ keydb_search_desc_dump (struct keydb_search_desc *desc) char b[MAX_FORMATTED_FINGERPRINT_LEN + 1]; char fpr[2 * MAX_FINGERPRINT_LEN + 1]; -#if MAX_FINGERPRINT_LEN < 20 -#error MAX_FINGERPRINT_LEN shorter than GRIP and UBID length/ +#if MAX_FINGERPRINT_LEN < UBID_LEN || MAX_FINGERPRINT_LEN < KEYGRIP_LEN +#error MAX_FINGERPRINT_LEN is shorter than KEYGRIP or UBID length. #endif switch (desc->mode) @@ -499,10 +499,10 @@ keydb_search_desc_dump (struct keydb_search_desc *desc) case KEYDB_SEARCH_MODE_SUBJECT: return xasprintf ("SUBJECT: '%s'", desc->u.name); case KEYDB_SEARCH_MODE_KEYGRIP: - bin2hex (desc[0].u.grip, 20, fpr); + bin2hex (desc[0].u.grip, KEYGRIP_LEN, fpr); return xasprintf ("KEYGRIP: %s", fpr); case KEYDB_SEARCH_MODE_UBID: - bin2hex (desc[0].u.ubid, 20, fpr); + bin2hex (desc[0].u.ubid, UBID_LEN, fpr); return xasprintf ("UBID: %s", fpr); case KEYDB_SEARCH_MODE_FIRST: return xasprintf ("FIRST"); |