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}
};
}
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;
}
_gnutls_mpi_release (¶ms[3]);
}
break;
- default:
- _gnutls_x509_log
- ("_gnutls_x509_get_pk_algorithm: unhandled algorithm %d\n", algo);
}
gnutls_free (str);
/* 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"