Browse Source

dtls1.3: Fix issues when --enable-dtls13 enabled

Fixed issue reported by scan-build when DTLS13 is enabled.

Fix compile issue when WOLFSSL_DTLS_CH_FRAG is enabled.

Fix running of scripts/dtlscid.test by removing 'set -e' as bwrap
command may not be there.
Jon Shallow 2 weeks ago
parent
commit
e36df36f84
3 changed files with 7 additions and 2 deletions
  1. 2 1
      scripts/dtlscid.test
  2. 4 0
      src/tls.c
  3. 1 1
      src/tls13.c

+ 2 - 1
scripts/dtlscid.test

@@ -1,6 +1,7 @@
 #!/bin/bash
 
-set -e
+# dtlscid.test
+# Copyright wolfSSL 2022-2024
 
 # if we can, isolate the network namespace to eliminate port collisions.
 if [[ -n "$NETWORK_UNSHARE_HELPER" ]]; then

+ 4 - 0
src/tls.c

@@ -6120,8 +6120,12 @@ static int TLSX_SupportedVersions_Write(void* data, byte* output,
 #ifdef WOLFSSL_DTLS13
     if (ssl->options.dtls) {
         tls13minor = (byte)DTLSv1_3_MINOR;
+    #ifndef WOLFSSL_NO_TLS12
         tls12minor = (byte)DTLSv1_2_MINOR;
+    #endif
+    #ifndef NO_OLD_TLS
         tls11minor = (byte)DTLS_MINOR;
+    #endif
         isDtls = 1;
     }
 #endif /* WOLFSSL_DTLS13 */

+ 1 - 1
src/tls13.c

@@ -4443,7 +4443,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
 
     {
 #ifdef WOLFSSL_DTLS_CH_FRAG
-        int maxFrag = wolfSSL_GetMaxFragSize(ssl, MAX_RECORD_SIZE);
+        word16 maxFrag = wolfSSL_GetMaxFragSize(ssl, MAX_RECORD_SIZE);
         word16 lenWithoutExts = args->length;
 #endif