summaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/keygen.c')
-rw-r--r--g10/keygen.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 47bc2b14f..b171b0676 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -174,17 +174,14 @@ gen_elg(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
skc->d.elg.g = sk.g;
skc->d.elg.y = sk.y;
skc->d.elg.x = sk.x;
+ skc->d.elg.is_protected = 0;
+ skc->d.elg.protect_algo = 0;
skc->d.elg.csum = checksum_mpi( skc->d.elg.x );
/* return an unprotected version of the skc */
*ret_skc = copy_secret_cert( NULL, skc );
- if( !dek ) {
- skc->d.elg.is_protected = 0;
- skc->d.elg.protect_algo = 0;
- }
- else {
- skc->d.elg.is_protected = 0;
+ if( dek ) {
skc->d.elg.protect_algo = CIPHER_ALGO_BLOWFISH;
randomize_buffer(skc->d.elg.protect.blowfish.iv, 8, 1);
rc = protect_secret_key( skc, dek );