[Pkg-gnupg-commit] [gnupg2] 78/159: gpg: Align notes about minimal keysize with actual checks.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jan 27 13:23:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit e70f7a54f29d727def2cfe9ea5ab9d461b4ce842
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jan 5 13:49:06 2016 +0100

    gpg: Align notes about minimal keysize with actual checks.
    
    * g10/keygen.c (ask_keysize): Use 768 for the minimal value for DSA in
    export mode.  Improve readability.
    --
    
    GnuPG-bug-id: 2209
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 g10/keygen.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/g10/keygen.c b/g10/keygen.c
index 992e572..921e938 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -2006,15 +2006,13 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage,
 static unsigned
 ask_keysize (int algo, unsigned int primary_keysize)
 {
-  unsigned int nbits, min, def = DEFAULT_STD_KEYSIZE, max=4096;
+  unsigned int nbits;
+  unsigned int min = 1024;
+  unsigned int def = DEFAULT_STD_KEYSIZE;
+  unsigned int max = 4096;
   int for_subkey = !!primary_keysize;
   int autocomp = 0;
 
-  if(opt.expert)
-    min=512;
-  else
-    min=1024;
-
   if (primary_keysize && !opt.expert)
     {
       /* Deduce the subkey size from the primary key size.  */
@@ -2029,9 +2027,11 @@ ask_keysize (int algo, unsigned int primary_keysize)
       goto leave;
     }
 
+  /* Deviations from the standard values.  */
   switch(algo)
     {
     case PUBKEY_ALGO_DSA:
+      min = opt.expert? 768 : 1024;
       def=2048;
       max=3072;
       break;
@@ -2048,10 +2048,6 @@ ask_keysize (int algo, unsigned int primary_keysize)
       def=255;
       max=441;
       break;
-
-    case PUBKEY_ALGO_RSA:
-      min=1024;
-      break;
     }
 
   tty_printf(_("%s keys may be between %u and %u bits long.\n"),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list