Skip to content
Open
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
12 changes: 12 additions & 0 deletions .github/workflows/os-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ jobs:
'--enable-lms=small,verify-only --enable-xmss=small,verify-only',
'--enable-curve25519=nonblock --enable-ecc=nonblock --enable-sp=yes,nonblock CPPFLAGS="-DWOLFSSL_PUBLIC_MP -DWOLFSSL_DEBUG_NONBLOCK"',
'--enable-certreq --enable-certext --enable-certgen --disable-secure-renegotiation-info CPPFLAGS="-DNO_TLS"',
# Minimal DTLS 1.3 client-only build. The SHA-224/384/512/3
# disables are deliberately omitted: --disable-sha384 alone
# trips a pre-existing wolfSSL bug in
# test_tls13_duplicate_extension (reproducible on clean master).
'--enable-dtls13 --disable-tlsv12 --disable-oldtls --disable-rsa --disable-dh
--disable-aescbc --disable-aesecb --disable-md5 --disable-chacha
--disable-poly1305 --disable-errorstrings --disable-asn-print
--disable-eccshamir --disable-base64encode --disable-coding --disable-sni
--enable-aesgcm=small --enable-sp-math --enable-sp=smallec256 --disable-sp-asm
CPPFLAGS=''-DNO_WOLFSSL_SERVER -DWOLFSSL_NO_TLS12 -DNO_SESSION_CACHE
-DWOLFSSL_AES_NO_UNROLL -DUSE_SLOW_SHA256 -DWOLFSSL_NO_ASYNC_IO
-DWOLFSSL_DTLS_ONLY'' ',
]
name: make check linux
if: github.repository_owner == 'wolfssl'
Expand Down
21 changes: 19 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5736,9 +5736,26 @@ AC_ARG_ENABLE([dtls13],
)
if test "x$ENABLED_DTLS13" = "xyes"
then
if test "x$ENABLED_DTLS" != "xyes" || test "x$ENABLED_TLS13" != "xyes"
# DTLSv1.3 implies TLS 1.3 and DTLS; auto-enable, but don't
# override explicit --disable.
if test "x$enable_tls13" = "xno" || test "x$ENABLED_TLS13" = "xno"
then
AC_MSG_ERROR([You need to enable both DTLS and TLSv1.3 to use DTLSv1.3])
AC_MSG_ERROR([--enable-dtls13 requires TLS 1.3, but TLS 1.3 is disabled])
fi
if test "x$ENABLED_TLS13" != "xyes"
then
AC_MSG_NOTICE([DTLSv1.3 is enabled, enabling TLS 1.3])
ENABLED_TLS13=yes
fi
Comment on lines +5745 to +5749
if test "x$enable_dtls" = "xno"
then
AC_MSG_ERROR([--enable-dtls13 requires DTLS, but --disable-dtls was given])
fi
if test "x$ENABLED_DTLS" != "xyes"
then
AC_MSG_NOTICE([DTLSv1.3 is enabled, enabling DTLS])
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
ENABLED_DTLS=yes
fi
if test "x$ENABLED_SEND_HRR_COOKIE" = "xundefined"
then
Expand Down
20 changes: 15 additions & 5 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2703,14 +2703,19 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap)
}
#endif
#else
ctx->CBIORecv = EmbedReceive;
ctx->CBIOSend = EmbedSend;
#ifndef WOLFSSL_DTLS_ONLY
ctx->CBIORecv = EmbedReceive;
ctx->CBIOSend = EmbedSend;
#endif
#ifdef WOLFSSL_SESSION_EXPORT
ctx->CBGetPeer = EmbedGetPeer;
ctx->CBSetPeer = EmbedSetPeer;
#endif
#ifdef WOLFSSL_DTLS
if (method->version.major == DTLS_MAJOR) {
#ifndef WOLFSSL_DTLS_ONLY
if (method->version.major == DTLS_MAJOR)
#endif
{
ctx->CBIORecv = EmbedReceiveFrom;
Comment on lines +2715 to 2719
ctx->CBIOSend = EmbedSendTo;
}
Expand Down Expand Up @@ -9424,7 +9429,8 @@ void FreeSSL(WOLFSSL* ssl, void* heap)
defined(WOLFSSL_SM4_GCM) || defined(WOLFSSL_SM4_CCM)) \
&& defined(HAVE_AEAD))

#if defined(WOLFSSL_DTLS) || !defined(WOLFSSL_NO_TLS12)
#if !defined(WOLFSSL_DTLS_ONLY) && \
(defined(WOLFSSL_DTLS) || !defined(WOLFSSL_NO_TLS12))
static WC_INLINE void GetSEQIncrement(WOLFSSL* ssl, int verify, word32 seq[2])
{
if (verify) {
Expand All @@ -9444,7 +9450,7 @@ static WC_INLINE void GetSEQIncrement(WOLFSSL* ssl, int verify, word32 seq[2])
}
}
}
#endif /* WOLFSSL_DTLS || !WOLFSSL_NO_TLS12 */
#endif /* !WOLFSSL_DTLS_ONLY && (WOLFSSL_DTLS || !WOLFSSL_NO_TLS12) */


#ifdef WOLFSSL_DTLS
Expand Down Expand Up @@ -9531,6 +9537,9 @@ void WriteSEQ(WOLFSSL* ssl, int verifyOrder, byte* out)
{
word32 seq[2] = {0, 0};

#ifdef WOLFSSL_DTLS_ONLY
DtlsGetSEQ(ssl, verifyOrder, seq);
#else
if (!ssl->options.dtls) {
GetSEQIncrement(ssl, verifyOrder, seq);
Comment on lines +9540 to 9544
}
Expand All @@ -9539,6 +9548,7 @@ void WriteSEQ(WOLFSSL* ssl, int verifyOrder, byte* out)
DtlsGetSEQ(ssl, verifyOrder, seq);
#endif
}
#endif

c32toa(seq[0], out);
c32toa(seq[1], out + OPAQUE32_LEN);
Expand Down
2 changes: 2 additions & 0 deletions src/wolfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ int SslBioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx)

#ifdef USE_WOLFSSL_IO

#ifndef WOLFSSL_DTLS_ONLY
/* The receive embedded callback
* return : nb bytes read, or error
*/
Expand Down Expand Up @@ -450,6 +451,7 @@ int EmbedSend(WOLFSSL* ssl, char *buf, int sz, void *ctx)

return sent;
}
#endif /* !WOLFSSL_DTLS_ONLY */


#ifdef WOLFSSL_DTLS
Expand Down
7 changes: 4 additions & 3 deletions wolfcrypt/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,8 +1920,9 @@ static WARN_UNUSED_RESULT word32 col_mul(
return GETBYTE(t, ia) ^ GETBYTE(t, ib) ^ t3 ^ tm;
}

#if defined(HAVE_AES_CBC) || defined(HAVE_AES_ECB) || \
defined(WOLFSSL_AES_DIRECT)
#if defined(HAVE_AES_DECRYPT) && \
(defined(HAVE_AES_CBC) || defined(HAVE_AES_ECB) || \
defined(WOLFSSL_AES_DIRECT))
static WARN_UNUSED_RESULT word32 inv_col_mul(
word32 t, int i9, int ib, int id, int ie)
{
Expand All @@ -1932,7 +1933,7 @@ static WARN_UNUSED_RESULT word32 inv_col_mul(
byte t0 = t9 ^ tb ^ td;
return t0 ^ AES_XTIME(AES_XTIME(AES_XTIME(t0 ^ te) ^ td ^ te) ^ tb ^ te);
}
#endif /* HAVE_AES_CBC || WOLFSSL_AES_DIRECT */
#endif /* HAVE_AES_DECRYPT && (HAVE_AES_CBC || HAVE_AES_ECB || WOLFSSL_AES_DIRECT) */
#endif /* WOLFSSL_AES_SMALL_TABLES */
#endif
#endif
Expand Down
8 changes: 6 additions & 2 deletions wolfssl/wolfio.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,10 @@ WOLFSSL_LOCAL int SslBioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
/* default IO callbacks */

#ifdef WOLFSSL_API_PREFIX_MAP
#define EmbedReceive wolfSSL_EmbedReceive
#define EmbedSend wolfSSL_EmbedSend
#ifndef WOLFSSL_DTLS_ONLY
#define EmbedReceive wolfSSL_EmbedReceive
#define EmbedSend wolfSSL_EmbedSend
#endif
#ifdef WOLFSSL_DTLS
#define EmbedReceiveFrom wolfSSL_EmbedReceiveFrom
#define EmbedSendTo wolfSSL_EmbedSendTo
Expand All @@ -686,8 +688,10 @@ WOLFSSL_LOCAL int SslBioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
#endif /* WOLFSSL_DTLS */
#endif /* WOLFSSL_API_PREFIX_MAP */

#ifndef WOLFSSL_DTLS_ONLY
WOLFSSL_API int EmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
WOLFSSL_API int EmbedSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
#endif

#ifdef WOLFSSL_DTLS
#ifdef NUCLEUS_PLUS_2_3
Expand Down
Loading