From a608b083b466bc9e9c53f8edbca501b7621171d1 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 10 May 2021 09:33:38 -0700 Subject: [PATCH] Take into account a new flag in the DTLS state export and import. --- src/internal.c | 2 ++ wolfssl/internal.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index d5d56c36a..3fb3c5c98 100644 --- a/src/internal.c +++ b/src/internal.c @@ -957,6 +957,7 @@ static int dtls_export_new(WOLFSSL* ssl, byte* exp, word32 len, byte ver) } #endif #else + exp[idx++] = 0; exp[idx++] = 0; exp[idx++] = 0; if (ver > DTLS_EXPORT_VERSION_3) { @@ -1123,6 +1124,7 @@ static int dtls_export_load(WOLFSSL* ssl, const byte* exp, word32 len, byte ver) } #endif #else + idx++; idx++; idx++; if (ver > DTLS_EXPORT_VERSION_3) { diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 7a8a87765..bb8402bd5 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1343,7 +1343,7 @@ enum Misc { DTLS_EXPORT_PRO = 165,/* wolfSSL protocol for serialized session */ DTLS_EXPORT_STATE_PRO = 166,/* wolfSSL protocol for serialized state */ DTLS_EXPORT_VERSION = 4, /* wolfSSL version for serialized session */ - DTLS_EXPORT_OPT_SZ = 60, /* amount of bytes used from Options */ + DTLS_EXPORT_OPT_SZ = 61, /* amount of bytes used from Options */ DTLS_EXPORT_VERSION_3 = 3, /* wolfSSL version before TLS 1.3 addition */ DTLS_EXPORT_OPT_SZ_3 = 59, /* amount of bytes used from Options */ DTLS_EXPORT_KEY_SZ = 325 + (DTLS_SEQ_SZ * 2),