Added boost define and openssl bug fix with WOLFSSL_KEY_GEN

This commit is contained in:
MJSPollard
2018-07-27 12:42:09 -06:00
parent 90367df13c
commit 543cac65d8
3 changed files with 13 additions and 5 deletions

View File

@@ -3055,6 +3055,7 @@ then
AM_CFLAGS="-DOPENSSL_ALL $AM_CFLAGS"
fi
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASIO -DASIO_USE_WOLFSSL -DWOLFSSL_KEY_GEN"
AM_CFLAGS="$AM_CFLAGS -DBOOST_ASIO_USE_WOLFSSL"
AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1_2 -DSSL_TXT_TLSV1_1"
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3"
if test "$ENABLED_TLSV10" = "yes"

View File

@@ -27958,12 +27958,11 @@ WOLFSSL_RSA *wolfSSL_d2i_RSAPrivateKey(WOLFSSL_RSA **r,
}
#if !defined(HAVE_FAST_RSA)
#if defined(WOLFSSL_KEY_GEN)
/* Converts an internal rsa structure to der format.
Returns size of der on success and WOLFSSL_FAILURE if error */
int wolfSSL_i2d_RSAPrivateKey(WOLFSSL_RSA *rsa, unsigned char **pp)
{
#if defined(WOLFSSL_KEY_GEN)
byte* der = NULL;
int derMax;
int ret;
@@ -28011,8 +28010,13 @@ int wolfSSL_i2d_RSAPrivateKey(WOLFSSL_RSA *rsa, unsigned char **pp)
XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER);
return ret; /* returns size of der if successful */
}
#else
(void)rsa;
(void)pp;
WOLFSSL_MSG("Error, WOLFSSL_KEY_GEN not defined");
return WOLFSSL_FAILURE;
#endif /* WOLFSSL_KEY_GEN */
}
int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *rsa, const unsigned char **pp)

View File

@@ -18123,8 +18123,12 @@ static void test_wolfSSL_d2i_PrivateKeys_bio(void)
EVP_PKEY* pkey = NULL;
RSA* rsa = NULL;
WOLFSSL_CTX* ctx;
#if defined(WOLFSSL_KEY_GEN)
unsigned char buffer[4096];
unsigned char* bufPtr;
bufPtr = buffer;
#endif
printf(testingFmt, "wolfSSL_d2i_PrivateKeys_bio()");
@@ -18196,7 +18200,7 @@ static void test_wolfSSL_d2i_PrivateKeys_bio(void)
/* RSA not set yet, expecting to fail*/
AssertIntEQ(SSL_CTX_use_RSAPrivateKey(ctx, rsa), BAD_FUNC_ARG);
#if defined(USE_CERT_BUFFERS_2048) && !defined(NO_RSA)
#if defined(USE_CERT_BUFFERS_2048) && !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN)
/* set RSA using bio*/
AssertIntGT(BIO_write(bio, client_key_der_2048,
sizeof_client_key_der_2048), 0);
@@ -18205,7 +18209,6 @@ static void test_wolfSSL_d2i_PrivateKeys_bio(void)
AssertIntEQ(SSL_CTX_use_RSAPrivateKey(ctx, rsa), WOLFSSL_SUCCESS);
/*i2d RSAprivate key tests */
bufPtr = buffer;
AssertIntEQ(wolfSSL_i2d_RSAPrivateKey(NULL, NULL), BAD_FUNC_ARG);
AssertIntEQ(wolfSSL_i2d_RSAPrivateKey(rsa, &bufPtr),
sizeof_client_key_der_2048);