Browse Source

Fix for sniffer async issue with TLS v1.3.

David Garske 1 year ago
parent
commit
d76c46a96f
3 changed files with 7 additions and 3 deletions
  1. 5 1
      src/sniffer.c
  2. 1 1
      src/tls.c
  3. 1 1
      sslSniffer/sslSnifferTest/snifftest.c

+ 5 - 1
src/sniffer.c

@@ -4398,7 +4398,11 @@ static int DoHandShake(const byte* input, int* sslBytes,
 #endif
 
 #ifdef WOLFSSL_TLS13
-    if (type != client_hello && type != server_hello) {
+    if (type != client_hello && type != server_hello
+    #ifdef WOLFSSL_ASYNC_CRYPT
+        && session->sslServer->error != WC_PENDING_E
+    #endif
+    ) {
         /* For resumption the hash is before / after client_hello PSK binder */
         /* hash the packet including header */
         /* TLS v1.3 requires the hash for the handshake and transfer key derivation */

+ 1 - 1
src/tls.c

@@ -158,7 +158,7 @@ int BuildTlsHandshakeHash(WOLFSSL* ssl, byte* hash, word32* hashLen)
 
     *hashLen = hashSz;
 #ifdef WOLFSSL_CHECK_MEM_ZERO
-     wc_MemZero_Add("TLS hasndshake hash", hash, hashSz);
+     wc_MemZero_Add("TLS handshake hash", hash, hashSz);
 #endif
 
     if (ret != 0)

+ 1 - 1
sslSniffer/sslSnifferTest/snifftest.c

@@ -827,7 +827,7 @@ int main(int argc, char** argv)
             /* grab next pcap packet */
             packetNumber++;
             packet = pcap_next(pcap, &header);
-        #ifdef QAT_DEBUG
+        #if defined(WOLFSSL_ASYNC_CRYPT) && defined(DEBUG_SNIFFER)
             printf("Packet Number: %d\n", packetNumber);
         #endif
         }