summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-24 23:32:27 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-05-11 22:21:28 +0200
commit66a2d447c3e96e928cde36e1dfd13a4ec9846d90 (patch)
treefcb297be88f638686bc9f6cb8d63480e113a6825
parent77e4107df9dfdfd6d318db9627626e4ce530b9a6 (diff)
downloadgnutls-66a2d447c3e96e928cde36e1dfd13a4ec9846d90.tar.gz
Added a forgoten by god OID for RSA. Warn using the actual OID
on unknown public key algorithms.
-rw-r--r--lib/gnutls_algorithms.c7
-rw-r--r--lib/x509/common.c9
-rw-r--r--lib/x509/common.h1
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c
index 0ead705c72..2620e6b7a6 100644
--- a/lib/gnutls_algorithms.c
+++ b/lib/gnutls_algorithms.c
@@ -2121,10 +2121,13 @@ struct gnutls_pk_entry
typedef struct gnutls_pk_entry gnutls_pk_entry;
static const gnutls_pk_entry pk_algorithms[] = {
+ /* having duplicate entries is ok, as long as the one
+ * we want to return OID from is first */
{"RSA", PK_PKIX1_RSA_OID, GNUTLS_PK_RSA},
+ {"RSA (X.509)", PK_X509_RSA_OID, GNUTLS_PK_RSA},
{"DSA", PK_DSA_OID, GNUTLS_PK_DSA},
- {"GOST R 34.10-2001", PK_GOST_R3410_2001_OID, 0},
- {"GOST R 34.10-94", PK_GOST_R3410_94_OID, 0},
+ {"GOST R 34.10-2001", PK_GOST_R3410_2001_OID, GNUTLS_PK_UNKNOWN},
+ {"GOST R 34.10-94", PK_GOST_R3410_94_OID, GNUTLS_PK_UNKNOWN},
{0, 0, 0}
};
diff --git a/lib/x509/common.c b/lib/x509/common.c
index 962ededdaa..788d926232 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -1284,10 +1284,14 @@ _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, const char *src_name,
}
algo = _gnutls_x509_oid2pk_algorithm (oid);
+ if (algo == GNUTLS_PK_UNKNOWN)
+ {
+ _gnutls_x509_log
+ ("%s: unknown public key algorithm: %s\n", __func__, oid);
+ }
if (bits == NULL)
{
- gnutls_free (str);
return algo;
}
@@ -1363,9 +1367,6 @@ _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, const char *src_name,
_gnutls_mpi_release (&params[3]);
}
break;
- default:
- _gnutls_x509_log
- ("_gnutls_x509_get_pk_algorithm: unhandled algorithm %d\n", algo);
}
gnutls_free (str);
diff --git a/lib/x509/common.h b/lib/x509/common.h
index b70085befc..29bffd151d 100644
--- a/lib/x509/common.h
+++ b/lib/x509/common.h
@@ -41,6 +41,7 @@
/* public key algorithm's OIDs
*/
#define PK_PKIX1_RSA_OID "1.2.840.113549.1.1.1"
+#define PK_X509_RSA_OID "2.5.8.1.1"
#define PK_DSA_OID "1.2.840.10040.4.1"
#define PK_GOST_R3410_94_OID "1.2.643.2.2.20"
#define PK_GOST_R3410_2001_OID "1.2.643.2.2.19"