1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Print NO_SECKEY status line in gpgsm.

This fixes bug#1020.
This commit is contained in:
Werner Koch 2009-03-25 16:05:16 +00:00
parent 6dc17a2b4d
commit ceb42db4dd
12 changed files with 62 additions and 17 deletions

View file

@ -140,13 +140,16 @@ gpgsm_get_fingerprint_hexstring (ksba_cert_t cert, int algo)
}
/* Return a certificate ID. These are the last 4 bytes of the SHA-1
fingerprint. */
fingerprint. If R_HIGH is not NULL the next 4 bytes are stored
there. */
unsigned long
gpgsm_get_short_fingerprint (ksba_cert_t cert)
gpgsm_get_short_fingerprint (ksba_cert_t cert, unsigned long *r_high)
{
unsigned char digest[20];
gpgsm_get_fingerprint (cert, GCRY_MD_SHA1, digest, NULL);
if (r_high)
*r_high = ((digest[12]<<24)|(digest[13]<<16)|(digest[14]<< 8)|digest[15]);
return ((digest[16]<<24)|(digest[17]<<16)|(digest[18]<< 8)|digest[19]);
}