[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-16-g30ec869

by Werner Koch cvs at cvs.gnupg.org
Wed Jan 11 21:11:20 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, master has been updated
       via  30ec869b8c63f1edcc58110ed20b83b0e77248f8 (commit)
      from  b42bc48dfb4b6d4f745eb02d8de4f4dcffdacf48 (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 30ec869b8c63f1edcc58110ed20b83b0e77248f8
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 11 20:15:47 2012 +0100

    gpg: Fix segv with RSA_S keys.
    
    * g10/misc.c (pubkey_get_npkey, pubkey_get_nskey)
    (pubkey_get_nsig, pubkey_get_nenc): Map all RSA algo ids to
    GCRY_PK_RSA.
    --
    
    The problem is that Libgcrypt has no more support for the alternate
    RSA ids and thus if asking for the number of parameters, they will
    return zero.  Now, this leads to packing the key parameters into an
    opaque MPI but because the algorithm id is actually known to GPG, it
    assumes valid RSA parameters.
    
    An example key with RSA_S is 0x5434509D.

diff --git a/g10/misc.c b/g10/misc.c
index e0c57a1..c49945a 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -1377,6 +1377,8 @@ pubkey_get_npkey (int algo)
   /* All other algorithms match those of Libgcrypt.  */
   if (algo == GCRY_PK_ELG_E)
     algo = GCRY_PK_ELG;
+  else if (is_RSA (algo))
+    algo = GCRY_PK_RSA;
 
   if (gcry_pk_algo_info (algo, GCRYCTL_GET_ALGO_NPKEY, NULL, &n))
     n = 0;
@@ -1399,6 +1401,8 @@ pubkey_get_nskey (int algo)
   /* All other algorithms match those of Libgcrypt.  */
   if (algo == GCRY_PK_ELG_E)
     algo = GCRY_PK_ELG;
+  else if (is_RSA (algo))
+    algo = GCRY_PK_RSA;
 
   if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NSKEY, NULL, &n ))
     n = 0;
@@ -1419,6 +1423,8 @@ pubkey_get_nsig (int algo)
 
   if (algo == GCRY_PK_ELG_E)
     algo = GCRY_PK_ELG;
+  else if (is_RSA (algo))
+    algo = GCRY_PK_RSA;
 
   if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NSIGN, NULL, &n))
     n = 0;
@@ -1440,6 +1446,8 @@ pubkey_get_nenc (int algo)
 
   if (algo == GCRY_PK_ELG_E)
     algo = GCRY_PK_ELG;
+  else if (is_RSA (algo))
+    algo = GCRY_PK_RSA;
 
   if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NENCR, NULL, &n ))
     n = 0;

-----------------------------------------------------------------------

Summary of changes:
 g10/misc.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list