mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* misc.c (pct_expando): Minor performance tweak. Don't bother to re-fetch
the primary key if the key making the signature is the primary key. * parse-packet.c (parse_signature): No need to reserve 8 bytes for the unhashed signature cache any longer.
This commit is contained in:
parent
c1142ffd27
commit
c7698f6cb3
3 changed files with 24 additions and 11 deletions
19
g10/misc.c
19
g10/misc.c
|
@ -391,16 +391,23 @@ pct_expando(const char *string,struct expando_args *args)
|
|||
size_t len;
|
||||
int i;
|
||||
|
||||
if((*(ch+1))=='p' && args->sk
|
||||
&& (args->sk->main_keyid[0] || args->sk->main_keyid[1]))
|
||||
if((*(ch+1))=='p' && args->sk)
|
||||
{
|
||||
PKT_public_key *pk=m_alloc_clear(sizeof(PKT_public_key));
|
||||
if(args->sk->is_primary)
|
||||
fingerprint_from_sk(args->sk,array,&len);
|
||||
else if(args->sk->main_keyid[0] || args->sk->main_keyid[1])
|
||||
{
|
||||
PKT_public_key *pk=
|
||||
m_alloc_clear(sizeof(PKT_public_key));
|
||||
|
||||
if(get_pubkey_fast(pk,args->sk->main_keyid)==0)
|
||||
fingerprint_from_pk(pk,array,&len);
|
||||
if(get_pubkey_fast(pk,args->sk->main_keyid)==0)
|
||||
fingerprint_from_pk(pk,array,&len);
|
||||
else
|
||||
memset(array,0,(len=MAX_FINGERPRINT_LEN));
|
||||
free_public_key(pk);
|
||||
}
|
||||
else
|
||||
memset(array,0,(len=MAX_FINGERPRINT_LEN));
|
||||
free_public_key(pk);
|
||||
}
|
||||
else if((*(ch+1))=='f' && args->pk)
|
||||
fingerprint_from_pk(args->pk,array,&len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue