From bc482052f84e8340e0eebb540c39d143fac120af Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 10 Dec 2007 15:19:34 +0000 Subject: Fix for bug 851. Fixed auto generation of the stub key for the card. Allow to encrypt toElgamal encryption keys of type 20. --- g10/ChangeLog | 12 ++++++++++++ g10/import.c | 4 ++-- g10/misc.c | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'g10') diff --git a/g10/ChangeLog b/g10/ChangeLog index 15840393e..a44f26d23 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,15 @@ +2007-12-10 Werner Koch + + * import.c (auto_create_card_key_stub): Do not clear the entire + fingerprint. This finally makes the stub creation work. My past + tests seemed to work because there was a key with a all zero + fingerprint available (Elgamal signing keys). + +2007-12-08 Werner Koch + + * misc.c (openpgp_pk_algo_usage): Allow Elgamal type 20 for + encryption. + 2007-12-04 Werner Koch * helptext.c (get_help_from_file): New. diff --git a/g10/import.c b/g10/import.c index a58637c9d..66aa875c4 100644 --- a/g10/import.c +++ b/g10/import.c @@ -2355,7 +2355,8 @@ auto_create_card_key_stub ( const char *serialnostr, size_t an; fingerprint_from_pk (pk, afp, &an); - memset (afp, 0, MAX_FINGERPRINT_LEN); + if (an < MAX_FINGERPRINT_LEN) + memset (afp+an, 0, MAX_FINGERPRINT_LEN-an); rc = keydb_search_fpr (hd, afp); } @@ -2410,4 +2411,3 @@ auto_create_card_key_stub ( const char *serialnostr, keydb_release (hd); return rc; } - diff --git a/g10/misc.c b/g10/misc.c index f02601fc4..5f9af54c3 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -379,6 +379,7 @@ openpgp_pk_algo_usage ( int algo ) case PUBKEY_ALGO_RSA_S: use = PUBKEY_USAGE_CERT | PUBKEY_USAGE_SIG; break; + case PUBKEY_ALGO_ELGAMAL: case PUBKEY_ALGO_ELGAMAL_E: use = PUBKEY_USAGE_ENC; break; -- cgit v1.2.3