mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
g10: fix cmp_public_key.
* g10/free-packet.c (cmp_public_keys): Compare opaque data at the first entry of the array when it's unknown algo. -- (forwardported from 2.0 commit 43429c7869152f301157e4b24790b3801dce0f0a) GnuPG-bug-id: 1962
This commit is contained in:
parent
01a2a61bc4
commit
f77fd572db
@ -434,12 +434,15 @@ cmp_public_keys( PKT_public_key *a, PKT_public_key *b )
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
n = pubkey_get_npkey( b->pubkey_algo );
|
n = pubkey_get_npkey( b->pubkey_algo );
|
||||||
if( !n )
|
if( !n ) { /* unknown algorithm, rest is in opaque MPI */
|
||||||
|
if( mpi_cmp( a->pkey[0], b->pkey[0] ) )
|
||||||
return -1; /* can't compare due to unknown algorithm */
|
return -1; /* can't compare due to unknown algorithm */
|
||||||
|
} else {
|
||||||
for(i=0; i < n; i++ ) {
|
for(i=0; i < n; i++ ) {
|
||||||
if( mpi_cmp( a->pkey[i], b->pkey[i] ) )
|
if( mpi_cmp( a->pkey[i], b->pkey[i] ) )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user