summaryrefslogtreecommitdiffstats
path: root/g10/keyid.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2000-09-18 16:35:34 +0200
committerWerner Koch <wk@gnupg.org>2000-09-18 16:35:34 +0200
commit986d928ce2a561b04fda7730de6a94f9b1e703d6 (patch)
tree9d815bcf427ee76f678153f4b000d8843816a2bd /g10/keyid.c
parentSee ChangeLog: Tue Aug 22 14:31:15 CEST 2000 Werner Koch (diff)
downloadgnupg2-986d928ce2a561b04fda7730de6a94f9b1e703d6.tar.xz
gnupg2-986d928ce2a561b04fda7730de6a94f9b1e703d6.zip
See ChangeLog: Mon Sep 18 16:35:45 CEST 2000 Werner Koch
Diffstat (limited to 'g10/keyid.c')
-rw-r--r--g10/keyid.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/g10/keyid.c b/g10/keyid.c
index 14406b60b..fb652e7b2 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -166,11 +166,17 @@ keyid_from_sk( PKT_secret_key *sk, u32 *keyid )
if( !keyid )
keyid = dummy_keyid;
- if( sk->version < 4 && is_RSA(sk->pubkey_algo) ) {
+ if( sk->keyid[0] || sk->keyid[1] ) {
+ keyid[0] = sk->keyid[0];
+ keyid[1] = sk->keyid[1];
+ }
+ else if( sk->version < 4 && is_RSA(sk->pubkey_algo) ) {
if( pubkey_get_npkey(sk->pubkey_algo) )
v3_keyid( sk->skey[0], keyid ); /* take n */
else
keyid[0] = keyid[1] = 0;
+ sk->keyid[0] = keyid[0];
+ sk->keyid[1] = keyid[1];
}
else {
const byte *dp;
@@ -180,6 +186,8 @@ keyid_from_sk( PKT_secret_key *sk, u32 *keyid )
keyid[0] = dp[12] << 24 | dp[13] << 16 | dp[14] << 8 | dp[15] ;
keyid[1] = dp[16] << 24 | dp[17] << 16 | dp[18] << 8 | dp[19] ;
gcry_md_close(md);
+ sk->keyid[0] = keyid[0];
+ sk->keyid[1] = keyid[1];
}
return keyid[1];