Release Fixes

1. Rearrange the deprecation cryptodev option so it doesn't overwrite the cryptocb option, and so it doesn't break its case in the build-test.
2. Fix the content length in the sample HTTP used by the example server.
3. Disable OCSP stapling in the example server if RSA is disabled.
4. Fix a variable in asn.c that was declared in the middle of its scope.
5. Retag the xmalloc, xrealloc, xfree functions used in the memory test as WOLFSSL_API like all the other allocators, instead of extern.
This commit is contained in:
John Safranek
2019-03-20 11:01:24 -07:00
parent 22b2ae7358
commit fbfd7a4dea
4 changed files with 30 additions and 26 deletions

View File

@ -4357,14 +4357,17 @@ else
fi
# cryptodev is old name, replaced with cryptocb
AC_ARG_ENABLE([cryptodev],
[AS_HELP_STRING([--enable-cryptodev],[DEPRECATED, use cryptocb instead])],
[ ENABLED_CRYPTOCB=$enableval ],[ ENABLED_CRYPTOCB=no ])
# Support for crypto callbacks
AC_ARG_ENABLE([cryptocb],
[AS_HELP_STRING([--enable-cryptocb],[Enable crypto callbacks (default: disabled)])],
[ ENABLED_CRYPTOCB=$enableval ],
[ ENABLED_CRYPTOCB=no ]
)
# cryptodev is old name, replaced with cryptocb
AC_ARG_ENABLE([cryptodev],,[ ENABLED_CRYPTOCB=$enableval ],[ ENABLED_CRYPTOCB=no ])
if test "x$ENABLED_PKCS11" = "xyes"
then
@ -4996,7 +4999,8 @@ echo " * Intel Quick Assist: $ENABLED_INTEL_QA"
echo " * Xilinx Hardware Acc.: $ENABLED_XILINX"
echo " * Inline Code: $ENABLED_INLINE"
echo " * Linux AF_ALG: $ENABLED_AFALG"
echo " * Linux cryptodev: $ENABLED_DEVCRYPTO"
echo " * Linux devcrypto: $ENABLED_DEVCRYPTO"
echo " * Crypto callback: $ENABLED_CRYPTOCB"
echo ""
echo "---"

View File

@ -60,7 +60,7 @@ static const char webServerMsg[] =
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/html\r\n"
"Connection: close\r\n"
"Content-Length: 225\r\n"
"Content-Length: 141\r\n"
"\r\n"
"<html>\r\n"
"<head>\r\n"
@ -1888,21 +1888,21 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
else
wolfSSL_CTX_EnableOCSP(ctx, WOLFSSL_OCSP_NO_NONCE);
}
#endif
#ifndef NO_RSA
/* All the OSCP Stapling test certs are RSA. */
/* All the OSCP Stapling test certs are RSA. */
#if defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2)
if (wolfSSL_CTX_EnableOCSPStapling(ctx) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't enable OCSP Stapling Certificate Manager");
if (SSL_CTX_load_verify_locations(ctx, "certs/ocsp/intermediate1-ca-cert.pem", 0) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't load ca file, Please run from wolfSSL home dir");
if (SSL_CTX_load_verify_locations(ctx, "certs/ocsp/intermediate2-ca-cert.pem", 0) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't load ca file, Please run from wolfSSL home dir");
if (SSL_CTX_load_verify_locations(ctx, "certs/ocsp/intermediate3-ca-cert.pem", 0) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't load ca file, Please run from wolfSSL home dir");
#endif
#endif
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2)
if (wolfSSL_CTX_EnableOCSPStapling(ctx) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't enable OCSP Stapling Certificate Manager");
if (SSL_CTX_load_verify_locations(ctx, "certs/ocsp/intermediate1-ca-cert.pem", 0) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't load ca file, Please run from wolfSSL home dir");
if (SSL_CTX_load_verify_locations(ctx, "certs/ocsp/intermediate2-ca-cert.pem", 0) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't load ca file, Please run from wolfSSL home dir");
if (SSL_CTX_load_verify_locations(ctx, "certs/ocsp/intermediate3-ca-cert.pem", 0) != WOLFSSL_SUCCESS)
err_sys_ex(runWithErrors, "can't load ca file, Please run from wolfSSL home dir");
#endif /* HAVE_CERTIFICATE_STATUS_REQUEST HAVE_CERTIFICATE_STATUS_REQUEST_V2 */
#endif /* NO_RSA */
#endif /* HAVE_OCSP */
#ifdef HAVE_PK_CALLBACKS
if (pkCallbacks)

View File

@ -10168,12 +10168,12 @@ static int SetEd25519PublicKey(byte* output, ed25519_key* key, int with_header)
return MEMORY_E;
#endif
int ret = wc_ed25519_export_public(key, pub, &pubSz);
if (ret != 0) {
idx = wc_ed25519_export_public(key, pub, &pubSz);
if (idx != 0) {
#ifdef WOLFSSL_SMALL_STACK
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
#endif
return ret;
return idx;
}
/* headers */

View File

@ -249,12 +249,12 @@
/* prototypes for user heap override functions */
#include <stddef.h> /* for size_t */
#include <stdlib.h>
extern void *xmalloc(size_t n, void* heap, int type, const char* func,
const char* file, unsigned int line);
extern void *xrealloc(void *p, size_t n, void* heap, int type,
const char* func, const char* file, unsigned int line);
extern void xfree(void *p, void* heap, int type, const char* func,
const char* file, unsigned int line);
WOLFSSL_API void *xmalloc(size_t n, void* heap, int type,
const char* func, const char* file, unsigned int line);
WOLFSSL_API void *xrealloc(void *p, size_t n, void* heap, int type,
const char* func, const char* file, unsigned int line);
WOLFSSL_API void xfree(void *p, void* heap, int type, const char* func,
const char* file, unsigned int line);
#elif defined(XMALLOC_OVERRIDE)
/* override the XMALLOC, XFREE and XREALLOC macros */
#elif defined(NO_WOLFSSL_MEMORY)