Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20241031-fixes #8139

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ AC_PREREQ([2.69])
AC_INIT([wolfssl],[5.7.4],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[https://www.wolfssl.com])
AC_CONFIG_AUX_DIR([build-aux])

# Inhibit unwanted regeneration of autotools artifacts by Makefile.
AM_MAINTAINER_MODE([disable])

# The following sets CFLAGS to empty if unset on command line. We do not
# want the default "-g -O2" that AC_PROG_CC sets automatically.
: ${CFLAGS=""}
Expand Down Expand Up @@ -8902,6 +8905,8 @@ AC_ARG_ENABLE([dual-alg-certs],

AS_IF([ test "$ENABLED_DUAL_ALG_CERTS" != "no" && test "$ENABLED_EXPERIMENTAL" != "yes" ],[ AC_MSG_ERROR([dual-alg-certs requires --enable-experimental.]) ])

AS_IF([ test "$ENABLED_DUAL_ALG_CERTS" != "no" && test "$ENABLED_CRYPTONLY" = "yes" ],[ AC_MSG_ERROR([dual-alg-certs is incompatible with --enable-cryptonly.]) ])

# Adds functionality to support Raw Public Key (RPK) RFC7250
AC_ARG_ENABLE([rpk],
[AS_HELP_STRING([--enable-rpk],[Enable support for Raw Public Key (RPK) RFC7250 (default: disabled)])],
Expand Down Expand Up @@ -9725,9 +9730,6 @@ if test "x$ENABLED_LINUXKM" = "xyes"; then
AC_SUBST([ASFLAGS_FPUSIMD_DISABLE])
AC_SUBST([ASFLAGS_FPUSIMD_ENABLE])

if test "$ENABLED_OPENSSLEXTRA" != "no" && test "$ENABLED_CRYPTONLY" = "no"; then
AC_MSG_ERROR([--enable-opensslextra without --enable-cryptonly is incompatible with --enable-linuxkm.])
fi
if test "$ENABLED_FILESYSTEM" = "yes"; then
AC_MSG_ERROR([--enable-filesystem is incompatible with --enable-linuxkm.])
fi
Expand Down
7 changes: 7 additions & 0 deletions linuxkm/linuxkm_wc_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,13 @@

#include <linux/limits.h>

#ifndef INT32_MAX
#define INT32_MAX INT_MAX
#endif
#ifndef UINT32_MAX
#define UINT32_MAX UINT_MAX
#endif

/* Linux headers define these using C expressions, but we need
* them to be evaluable by the preprocessor, for use in sp_int.h.
*/
Expand Down
3 changes: 3 additions & 0 deletions linuxkm/module_exports.c.template
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,6 @@
#include <wolfssl/openssl/pem.h>
#endif

#if defined(OPENSSL_EXTRA) && !defined(WC_NO_RNG) && defined(HAVE_HASHDRBG)
#include <wolfssl/openssl/fips_rand.h>
#endif
21 changes: 20 additions & 1 deletion src/pk.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,26 @@ static int pem_read_bio_key(WOLFSSL_BIO* bio, wc_pem_password_cb* cb,
/* Write left over data back to BIO if not a file BIO */
if ((ret > 0) && ((memSz - ret) > 0) &&
(bio->type != WOLFSSL_BIO_FILE)) {
int res = wolfSSL_BIO_write(bio, mem + ret, memSz - ret);
int res;
if (!alloced) {
/* If wolfssl_read_bio() points mem at the buffer internal to
* bio, we need to dup it before calling wolfSSL_BIO_write(),
* because the latter may reallocate the bio, invalidating the
* mem pointer before reading from it.
*/
char *mem_dup = (char *)XMALLOC((size_t)(memSz - ret),
NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (mem_dup != NULL) {
XMEMCPY(mem_dup, mem + ret, (size_t)(memSz - ret));
res = wolfSSL_BIO_write(bio, mem_dup, memSz - ret);
mem = mem_dup;
alloced = 1;
}
else
res = MEMORY_E;
}
else
res = wolfSSL_BIO_write(bio, mem + ret, memSz - ret);
if (res != memSz - ret) {
WOLFSSL_ERROR_MSG("Unable to write back excess data");
if (res < 0) {
Expand Down
1 change: 1 addition & 0 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3491,6 +3491,7 @@ extern void uITRON4_free(void *p) ;
#undef HAVE_STRINGS_H
#undef HAVE_ERRNO_H
#undef HAVE_THREAD_LS
#undef HAVE_ATEXIT
#undef WOLFSSL_HAVE_MIN
#undef WOLFSSL_HAVE_MAX
#define SIZEOF_LONG 8
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ typedef struct w64wrapper {
DYNAMIC_TYPE_SNIFFER_KEY = 1006,
DYNAMIC_TYPE_SNIFFER_KEYLOG_NODE = 1007,
DYNAMIC_TYPE_SNIFFER_CHAIN_BUFFER = 1008,
DYNAMIC_TYPE_AES_EAX = 1009,
DYNAMIC_TYPE_AES_EAX = 1009
};

/* max error buffer string size */
Expand Down
Loading