Skip to content

Commit 0900e00

Browse files
authored
Merge pull request #7650 from kaleb-himes/SRTP-KDF-CODEREVIEWr2
Add sanity for case id'd in optesting review
2 parents 75475ae + 23f796c commit 0900e00

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

configure.ac

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4103,18 +4103,6 @@ AC_ARG_ENABLE([ed448-stream],
41034103
[ ENABLED_ED448_STREAM=no ]
41044104
)
41054105

4106-
if test "$ENABLED_ED448_STREAM" != "no"
4107-
then
4108-
if test "$ENABLED_ED448" = "no"
4109-
then
4110-
AC_MSG_ERROR([ED448 verify streaming enabled but ED448 is disabled])
4111-
else
4112-
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
4113-
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
4114-
fi
4115-
fi
4116-
4117-
41184106
# FP ECC, Fixed Point cache ECC
41194107
AC_ARG_ENABLE([fpecc],
41204108
[AS_HELP_STRING([--enable-fpecc],[Enable Fixed Point cache ECC (default: disabled)])],
@@ -5614,6 +5602,18 @@ then
56145602
ENABLED_CERTS=yes
56155603
fi
56165604
5605+
if test "$ENABLED_ED448_STREAM" != "no"
5606+
then
5607+
if test "$ENABLED_ED448" = "no"
5608+
then
5609+
AC_MSG_ERROR([ED448 verify streaming enabled but ED448 is disabled])
5610+
else
5611+
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
5612+
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
5613+
fi
5614+
fi
5615+
5616+
56175617
# SRTP-KDF
56185618
if test "$ENABLED_SRTP" = "yes"
56195619
then

wolfcrypt/src/aes.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10761,6 +10761,11 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
1076110761
authTagSz > AES_BLOCK_SIZE)
1076210762
return BAD_FUNC_ARG;
1076310763

10764+
/* Sanity check on authIn to prevent segfault in xorbuf() where
10765+
* variable 'in' is dereferenced as the mask 'm' in misc.c */
10766+
if (authIn == NULL && authInSz > 0)
10767+
return BAD_FUNC_ARG;
10768+
1076410769
/* sanity check on tag size */
1076510770
if (wc_AesCcmCheckTagSize((int)authTagSz) != 0) {
1076610771
return BAD_FUNC_ARG;
@@ -10903,6 +10908,11 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
1090310908
authTagSz > AES_BLOCK_SIZE)
1090410909
return BAD_FUNC_ARG;
1090510910

10911+
/* Sanity check on authIn to prevent segfault in xorbuf() where
10912+
* variable 'in' is dereferenced as the mask 'm' in misc.c */
10913+
if (authIn == NULL && authInSz > 0)
10914+
return BAD_FUNC_ARG;
10915+
1090610916
/* sanity check on tag size */
1090710917
if (wc_AesCcmCheckTagSize((int)authTagSz) != 0) {
1090810918
return BAD_FUNC_ARG;

0 commit comments

Comments
 (0)