path include adjustment, rename internal OBJ function, and client print outs added

This commit is contained in:
Jacob Barthelmeh
2019-03-11 09:57:04 -06:00
parent 1dcd6b92a0
commit 9c9279817b
7 changed files with 25 additions and 17 deletions

View File

@@ -1615,15 +1615,19 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
myVerifyFail = 1;
}
else if (XSTRNCMP(myoptarg, "useSupCurve", 11) == 0) {
printf("Test use supported curve\n");
printf("Attempting to test use supported curve\n");
#if defined(HAVE_ECC) && defined(HAVE_SUPPORTED_CURVES)
useSupCurve = 1;
#else
printf("Supported curves not compiled in!\n");
#endif
}
else if (XSTRNCMP(myoptarg, "loadSSL", 7) == 0) {
printf("Load cert/key into wolfSSL object\n");
#ifndef NO_CERTS
loadCertKeyIntoSSLObj = 1;
#else
printf("Certs turned off with NO_CERTS!\n");
#endif
}
else {

View File

@@ -31721,7 +31721,7 @@ void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl)
int wolfSSL_OBJ_sn2nid(const char *sn) {
WOLFSSL_ENTER("wolfSSL_OBJ_sn2nid");
return OBJ_sn2nid(sn);
return wc_OBJ_sn2nid(sn);
}
#endif

View File

@@ -4508,7 +4508,7 @@ static int GetKey(DecodedCert* cert)
}
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
WOLFSSL_LOCAL int OBJ_sn2nid(const char *sn)
WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn)
{
static const struct {
const char *sn;
@@ -5051,7 +5051,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->cnLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_COMMON_NAME, 4);
dName->cnNid = OBJ_sn2nid((const char *)WOLFSSL_COMMON_NAME);
dName->cnNid = wc_OBJ_sn2nid((const char *)WOLFSSL_COMMON_NAME);
idx += 4;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->cnIdx], dName->cnLen);
@@ -5061,7 +5061,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->snLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_SUR_NAME, 4);
dName->snNid = OBJ_sn2nid((const char *)WOLFSSL_SUR_NAME);
dName->snNid = wc_OBJ_sn2nid((const char *)WOLFSSL_SUR_NAME);
idx += 4;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->snIdx], dName->snLen);
@@ -5071,7 +5071,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->cLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_COUNTRY_NAME, 3);
dName->cNid = OBJ_sn2nid((const char *)WOLFSSL_COUNTRY_NAME);
dName->cNid = wc_OBJ_sn2nid((const char *)WOLFSSL_COUNTRY_NAME);
idx += 3;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->cIdx], dName->cLen);
@@ -5081,7 +5081,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->lLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_LOCALITY_NAME, 3);
dName->lNid = OBJ_sn2nid((const char *)WOLFSSL_LOCALITY_NAME);
dName->lNid = wc_OBJ_sn2nid((const char *)WOLFSSL_LOCALITY_NAME);
idx += 3;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->lIdx], dName->lLen);
@@ -5091,7 +5091,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->stLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_STATE_NAME, 4);
dName->stNid = OBJ_sn2nid((const char *)WOLFSSL_STATE_NAME);
dName->stNid = wc_OBJ_sn2nid((const char *)WOLFSSL_STATE_NAME);
idx += 4;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->stIdx], dName->stLen);
@@ -5101,7 +5101,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->oLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_ORG_NAME, 3);
dName->oNid = OBJ_sn2nid((const char *)WOLFSSL_ORG_NAME);
dName->oNid = wc_OBJ_sn2nid((const char *)WOLFSSL_ORG_NAME);
idx += 3;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->oIdx], dName->oLen);
@@ -5111,7 +5111,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->ouLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_ORGUNIT_NAME, 4);
dName->ouNid = OBJ_sn2nid((const char *)WOLFSSL_ORGUNIT_NAME);
dName->ouNid = wc_OBJ_sn2nid((const char *)WOLFSSL_ORGUNIT_NAME);
idx += 4;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->ouIdx], dName->ouLen);
@@ -5121,7 +5121,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->emailLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], "/emailAddress=", 14);
dName->emailNid = OBJ_sn2nid((const char *)"/emailAddress=");
dName->emailNid = wc_OBJ_sn2nid((const char *)"/emailAddress=");
idx += 14;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->emailIdx], dName->emailLen);
@@ -5142,7 +5142,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->uidLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], "/UID=", 5);
dName->uidNid = OBJ_sn2nid((const char *)"/UID=");
dName->uidNid = wc_OBJ_sn2nid((const char *)"/UID=");
idx += 5;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->uidIdx], dName->uidLen);
@@ -5152,7 +5152,7 @@ static int GetName(DecodedCert* cert, int nameType)
if (dName->serialLen != 0) {
dName->entryCount++;
XMEMCPY(&dName->fullName[idx], WOLFSSL_SERIAL_NUMBER, 14);
dName->serialNid = OBJ_sn2nid((const char *)WOLFSSL_SERIAL_NUMBER);
dName->serialNid = wc_OBJ_sn2nid((const char *)WOLFSSL_SERIAL_NUMBER);
idx += 14;
XMEMCPY(&dName->fullName[idx],
&cert->source[dName->serialIdx], dName->serialLen);

View File

@@ -625,5 +625,6 @@ WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
} /* extern "C" */
#endif
#include <wolfssl/openssl/objects.h>
#endif /* WOLFSSL_EVP_H_ */

View File

@@ -24,7 +24,11 @@
#define WOLFSSL_OBJECTS_H_
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/openssl/ssl.h>
//#include <wolfssl/openssl/ssl.h>
#ifndef OPENSSL_EXTRA_SSL_GUARD
#define OPENSSL_EXTRA_SSL_GUARD
#include <wolfssl/ssl.h>
#endif /* OPENSSL_EXTRA_SSL_GUARD */
#ifdef __cplusplus
extern "C" {

View File

@@ -40,9 +40,8 @@
#include <wolfssl/openssl/crypto.h>
#endif
#if defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY)
/* all NID_* values are in asn.h */
#include <wolfssl/wolfcrypt/asn.h>
#endif
#ifdef __cplusplus
extern "C" {

View File

@@ -977,7 +977,7 @@ WOLFSSL_LOCAL int GetAsnTimeString(void* currTime, byte* buf, word32 len);
WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format,
wolfssl_tm* certTime, int* idx);
WOLFSSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType);
WOLFSSL_LOCAL int OBJ_sn2nid(const char *sn);
WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn);
/* ASN.1 helper functions */
#ifdef WOLFSSL_CERT_GEN