[git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.12-16-g64e7c23
by Werner Koch
cvs at cvs.gnupg.org
Thu Nov 8 17:40:04 CET 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, STABLE-BRANCH-1-4 has been updated
via 64e7c237db1eb5f463f4b810b09eda232da83676 (commit)
from b1eac93431c377805984210a8ef76f5c314c8a5f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 64e7c237db1eb5f463f4b810b09eda232da83676
Author: Werner Koch <wk at gnupg.org>
Date: Thu Nov 8 15:59:47 2012 +0100
Create off-line card encryption key with the right size.
* g10/keygen.c (gen_card_key_with_backup): Get the size of the key
from the card.
--
Formerly the off-line encryption key was created with a fixed length
of 1024 bit. With this change the key is created as expected.
GnuPG-bug-id: 1230
diff --git a/g10/keygen.c b/g10/keygen.c
index 7c473cb..30ec370 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -3711,10 +3711,25 @@ gen_card_key_with_backup (int algo, int keyno, int is_primary,
PKT_public_key *pk;
size_t n;
int i;
+ unsigned int nbits;
sk_unprotected = NULL;
sk_protected = NULL;
- rc = generate_raw_key (algo, 1024, timestamp,
+
+ /* Get the size of the key directly from the card. */
+ {
+ struct agent_card_info_s info;
+
+ memset (&info, 0, sizeof info);
+ if (!agent_scd_getattr ("KEY-ATTR", &info)
+ && info.key_attr[1].algo)
+ nbits = info.key_attr[1].nbits;
+ else
+ nbits = 1024; /* All pre-v2.0 cards. */
+ agent_release_card_info (&info);
+ }
+
+ rc = generate_raw_key (algo, nbits, timestamp,
&sk_unprotected, &sk_protected);
if (rc)
return rc;
-----------------------------------------------------------------------
Summary of changes:
g10/keygen.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list