[svn] GnuPG - r5163 - branches/STABLE-BRANCH-2-0/g10
svn author wk
cvs at cvs.gnupg.org
Fri Sep 25 19:09:31 CEST 2009
Author: wk
Date: 2009-09-25 19:09:31 +0200 (Fri, 25 Sep 2009)
New Revision: 5163
Modified:
branches/STABLE-BRANCH-2-0/g10/ChangeLog
branches/STABLE-BRANCH-2-0/g10/pkglue.c
Log:
Fix bug#1139.
Modified: branches/STABLE-BRANCH-2-0/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/ChangeLog 2009-09-23 10:28:41 UTC (rev 5162)
+++ branches/STABLE-BRANCH-2-0/g10/ChangeLog 2009-09-25 17:09:31 UTC (rev 5163)
@@ -1,3 +1,9 @@
+2009-09-25 Werner Koch <wk at g10code.com>
+
+ * pkglue.c (pk_sign, pk_verify, pk_encrypt, pk_decrypt)
+ (pk_check_secret_key): Allow deprecated RSA identifiers 2 and 3.
+ Fixes bug#1139.
+
2009-09-04 Werner Koch <wk at g10code.com>
* keyedit.c (menu_select_uid): Use IDX ==-1 t select all.
Modified: branches/STABLE-BRANCH-2-0/g10/pkglue.c
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/pkglue.c 2009-09-23 10:28:41 UTC (rev 5162)
+++ branches/STABLE-BRANCH-2-0/g10/pkglue.c 2009-09-25 17:09:31 UTC (rev 5163)
@@ -61,7 +61,7 @@
"(private-key(dsa(p%m)(q%m)(g%m)(y%m)(x%m)))",
skey[0], skey[1], skey[2], skey[3], skey[4]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_S)
{
rc = gcry_sexp_build (&s_skey, NULL,
"(private-key(rsa(n%m)(e%m)(d%m)(p%m)(q%m)(u%m)))",
@@ -90,7 +90,7 @@
if (rc)
;
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_S)
data[0] = mpi_from_sexp (s_sig, "s");
else
{
@@ -125,7 +125,7 @@
"(public-key(elg(p%m)(g%m)(y%m)))",
pkey[0], pkey[1], pkey[2]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_S)
{
rc = gcry_sexp_build (&s_pkey, NULL,
"(public-key(rsa(n%m)(e%m)))", pkey[0], pkey[1]);
@@ -158,7 +158,7 @@
rc = gcry_sexp_build (&s_sig, NULL,
"(sig-val(elg(r%m)(s%m)))", data[0], data[1]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_S)
{
if (!data[0])
rc = gpg_error (GPG_ERR_BAD_MPI);
@@ -197,7 +197,7 @@
"(public-key(elg(p%m)(g%m)(y%m)))",
pkey[0], pkey[1], pkey[2]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_E)
{
rc = gcry_sexp_build (&s_pkey, NULL,
"(public-key(rsa(n%m)(e%m)))",
@@ -223,7 +223,7 @@
else
{ /* add better error handling or make gnupg use S-Exp directly */
resarr[0] = mpi_from_sexp (s_ciph, "a");
- if (algo != GCRY_PK_RSA)
+ if (algo != GCRY_PK_RSA && algo != GCRY_PK_RSA_E)
resarr[1] = mpi_from_sexp (s_ciph, "b");
}
@@ -252,7 +252,7 @@
"(private-key(elg(p%m)(g%m)(y%m)(x%m)))",
skey[0], skey[1], skey[2], skey[3]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_E)
{
rc = gcry_sexp_build (&s_skey, NULL,
"(private-key(rsa(n%m)(e%m)(d%m)(p%m)(q%m)(u%m)))",
@@ -274,7 +274,7 @@
rc = gcry_sexp_build (&s_data, NULL,
"(enc-val(elg(a%m)(b%m)))", data[0], data[1]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA || algo == GCRY_PK_RSA_E)
{
if (!data[0])
rc = gpg_error (GPG_ERR_BAD_MPI);
@@ -321,7 +321,8 @@
"(private-key(elg(p%m)(g%m)(y%m)(x%m)))",
skey[0], skey[1], skey[2], skey[3]);
}
- else if (algo == GCRY_PK_RSA)
+ else if (algo == GCRY_PK_RSA
+ || algo == GCRY_PK_RSA_S || algo == GCRY_PK_RSA_E)
{
rc = gcry_sexp_build (&s_skey, NULL,
"(private-key(rsa(n%m)(e%m)(d%m)(p%m)(q%m)(u%m)))",
More information about the Gnupg-commits
mailing list