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

(do_generate_keypair): Don't continue after an error;

fixed at two places. Why at all didn't I used a goto to cleanup,
tsss?
This commit is contained in:
Werner Koch 2005-01-25 14:34:51 +00:00
parent aa87314e6f
commit aa62bf505d
2 changed files with 7 additions and 3 deletions

View file

@ -1,9 +1,13 @@
2005-01-25 Werner Koch <wk@g10code.com> 2005-01-25 Werner Koch <wk@g10code.com>
* keygen.c (do_generate_keypair): Don't continue after an error;
fixed at two places. Why at all didn't I used a goto to cleanup,
tsss?
* app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
the cache. Changed all callers. the cache. Changed all callers.
(get_one_do): Bypass the cache if the value would have been read (get_one_do): Bypass the cache if the value would have been read
directly for v1.1 cards.It makes things a bit slower but obnly for directly for v1.1 cards. It makes things a bit slower but only for
1.0 cards and there are not that many cards out in the wild. This 1.0 cards and there are not that many cards out in the wild. This
is required to fix a caching bug when generating new keys; as a is required to fix a caching bug when generating new keys; as a
side effect of the retrieval of the the C4 DO from the 6E DO the side effect of the retrieval of the the C4 DO from the 6E DO the

View file

@ -2820,7 +2820,7 @@ do_generate_keypair( struct para_data_s *para,
get_parameter_uint (para, pKEYUSAGE)); get_parameter_uint (para, pKEYUSAGE));
} }
if( get_parameter( para, pSUBKEYTYPE ) ) if( !rc && get_parameter( para, pSUBKEYTYPE ) )
{ {
if (!card) if (!card)
{ {
@ -2859,7 +2859,7 @@ do_generate_keypair( struct para_data_s *para,
did_sub = 1; did_sub = 1;
} }
if (card && get_parameter (para, pAUTHKEYTYPE)) if (!rc && card && get_parameter (para, pAUTHKEYTYPE))
{ {
rc = gen_card_key (PUBKEY_ALGO_RSA, 3, 0, pub_root, sec_root, rc = gen_card_key (PUBKEY_ALGO_RSA, 3, 0, pub_root, sec_root,
get_parameter_u32 (para, pKEYEXPIRE), para); get_parameter_u32 (para, pKEYEXPIRE), para);