mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Base code for gpgsm --verify does work
This commit is contained in:
parent
90d060c199
commit
0f26760d9f
13 changed files with 562 additions and 88 deletions
|
@ -205,6 +205,20 @@ has_issuer_sn (KEYBOXBLOB blob, const char *name, const unsigned char *sn)
|
|||
&& blob_cmp_name (blob, 0 /* issuer */, name, namelen));
|
||||
}
|
||||
|
||||
static int
|
||||
has_subject (KEYBOXBLOB blob, const char *name)
|
||||
{
|
||||
size_t namelen;
|
||||
|
||||
return_val_if_fail (name, 0);
|
||||
|
||||
if (blob_get_type (blob) != BLOBTYPE_X509)
|
||||
return 0;
|
||||
|
||||
namelen = strlen (name);
|
||||
return blob_cmp_name (blob, 1 /* subject */, name, namelen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -316,6 +330,10 @@ keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc)
|
|||
if (has_issuer_sn (blob, desc[n].u.name, desc[n].sn))
|
||||
goto found;
|
||||
break;
|
||||
case KEYDB_SEARCH_MODE_SUBJECT:
|
||||
if (has_subject (blob, desc[n].u.name))
|
||||
goto found;
|
||||
break;
|
||||
case KEYDB_SEARCH_MODE_SHORT_KID:
|
||||
/* if (has_short_kid (blob, desc[n].u.kid[1])) */
|
||||
/* goto found; */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue