forked from wolfSSL/wolfssl
#ifdef HAVE_ECC to OBJ_nid2obj, and its test in api.c
This commit is contained in:
committed by
Go Hosohara
parent
4d03b55fef
commit
c673884cbb
@ -18514,8 +18514,10 @@ static void test_wolfSSL_OBJ(void)
|
||||
int i, j;
|
||||
const char *f[] = {
|
||||
"./certs/ca-cert.der",
|
||||
#ifdef HAVE_ECC
|
||||
"./certs/ca-ecc-cert.der",
|
||||
"./certs/ca-ecc384-cert.der",
|
||||
#endif
|
||||
NULL};
|
||||
#ifndef NO_DES3
|
||||
PKCS12 *p12;
|
||||
@ -18543,6 +18545,7 @@ static void test_wolfSSL_OBJ(void)
|
||||
|
||||
for (i = 0; f[i] != NULL; i++)
|
||||
{
|
||||
printf("file=%s\n", f[i]);
|
||||
AssertTrue((fp = XFOPEN(f[i], "r")) != XBADFILE);
|
||||
AssertNotNull(x509 = d2i_X509_fp(fp, NULL));
|
||||
AssertNotNull(x509Name = X509_get_issuer_name(x509));
|
||||
|
@ -4098,7 +4098,7 @@ WOLFSSL_LOCAL int OBJ_sn2nid(const char *sn)
|
||||
|
||||
int i;
|
||||
WOLFSSL_ENTER("OBJ_osn2nid");
|
||||
|
||||
#ifdef HAVE_ECC
|
||||
/* Nginx uses this OpenSSL string. */
|
||||
if (XSTRNCMP(sn, "prime256v1", 10) == 0)
|
||||
sn = "SECP256R1";
|
||||
@ -4110,7 +4110,8 @@ WOLFSSL_LOCAL int OBJ_sn2nid(const char *sn)
|
||||
return ecc_sets[i].id;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
for(i=0; sn2nid[i].sn != NULL; i++) {
|
||||
if(XSTRNCMP(sn, sn2nid[i].sn, XSTRLEN(sn2nid[i].sn)) == 0) {
|
||||
return sn2nid[i].nid;
|
||||
|
Reference in New Issue
Block a user