diff options
| author | Werner Koch <[email protected]> | 2009-03-25 16:05:16 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2009-03-25 16:05:16 +0000 |
| commit | ceb42db4dd6b98d6b31429bed2ca40505731b9e8 (patch) | |
| tree | e471d7b311d3c73dc55a3a1f420233dd847b16a2 /sm/fingerprint.c | |
| parent | log file fixes. (diff) | |
| download | gnupg-ceb42db4dd6b98d6b31429bed2ca40505731b9e8.tar.gz gnupg-ceb42db4dd6b98d6b31429bed2ca40505731b9e8.zip | |
Print NO_SECKEY status line in gpgsm.
This fixes bug#1020.
Diffstat (limited to 'sm/fingerprint.c')
| -rw-r--r-- | sm/fingerprint.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sm/fingerprint.c b/sm/fingerprint.c index addf56296..4704f5972 100644 --- a/sm/fingerprint.c +++ b/sm/fingerprint.c @@ -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]); } |
