From bad6be5c768e89be781501a2c8f2e1cf29b1f268 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 15 Sep 2016 14:53:28 -0700 Subject: [PATCH] 1. Updated sniffer to allow DES3 to be disabled. 2. Fixed an unused variable in OpenSSL Extras when DES3 is disabled. 3. Force DES3 enabled when enabling MCAPI. --- configure.ac | 3 +++ src/sniffer.c | 14 ++++++++++++-- src/ssl.c | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7068b474c..9c53536c0 100644 --- a/configure.ac +++ b/configure.ac @@ -2873,6 +2873,9 @@ AS_IF([test "x$ENABLED_CMAC" = "xyes" && \ # Update CFLAGS based on options # ################################################################################ +AS_IF([test "x$ENABLED_MCAPI" = "xyes"], + [AS_IF([test "x$ENABLED_DES3" = "xno"],[ENABLED_DES3="yes"])]) + if test "$ENABLED_WOLFSCEP" = "yes" then # Enable prereqs if not already enabled diff --git a/src/sniffer.c b/src/sniffer.c index 577d59110..6c4e2cec0 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -1947,6 +1947,10 @@ static int Decrypt(SSL* ssl, byte* output, const byte* input, word32 sz) { int ret = 0; + (void)output; + (void)input; + (void)sz; + switch (ssl->specs.bulk_cipher_algorithm) { #ifdef BUILD_ARC4 case wolfssl_rc4: @@ -2687,14 +2691,20 @@ static int FindNextRecordInAssembly(SnifferSession* session, return 0; } else if (ssl->specs.cipher_type == block) { - if (ssl->specs.bulk_cipher_algorithm == wolfssl_aes) + if (ssl->specs.bulk_cipher_algorithm == wolfssl_aes) { +#ifdef BUILD_AES wc_AesSetIV(ssl->decrypt.aes, curr->data + curr->end - curr->begin - ssl->specs.block_size + 1); - else if (ssl->specs.bulk_cipher_algorithm == wolfssl_triple_des) +#endif + } + else if (ssl->specs.bulk_cipher_algorithm == wolfssl_triple_des) { +#ifdef BUILD_DES3 wc_Des3_SetIV(ssl->decrypt.des3, curr->data + curr->end - curr->begin - ssl->specs.block_size + 1); +#endif + } } Trace(DROPPING_LOST_FRAG_STR); diff --git a/src/ssl.c b/src/ssl.c index 391488162..e2879b44e 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -9814,6 +9814,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl) { int ret = -1; /* failure local, during function 0 means success because internal functions work that way */ + (void)key; (void)iv; (void)enc;