From dfec7f226324fbe060b885674da6ef70bf390e50 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 21 Sep 2018 16:14:51 -0700 Subject: [PATCH] Fix for TLS v1.3 async case with cipher suite `TLS_AES_128_GCM_SHA256` and RSA key type. Fix for issue with long cipher suite name test for TLS 1.3. --- src/tls13.c | 12 +++++++----- tests/suites.c | 6 +++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tls13.c b/src/tls13.c index a83fbe2d0..d905dab35 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -5362,7 +5362,13 @@ static int SendTls13CertificateVerify(WOLFSSL* ssl) (RsaKey*)ssl->hsKey, ssl->buffers.key ); - args->length = (word16)args->sigLen; + if (ret == 0) { + args->length = (word16)args->sigLen; + + XMEMCPY(args->sigData, + args->verify + HASH_SIG_SIZE + VERIFY_HEADER, + args->sigLen); + } } #endif /* !NO_RSA */ @@ -5383,10 +5389,6 @@ static int SendTls13CertificateVerify(WOLFSSL* ssl) { #ifndef NO_RSA if (ssl->hsType == DYNAMIC_TYPE_RSA) { - XMEMCPY(args->sigData, - args->verify + HASH_SIG_SIZE + VERIFY_HEADER, - args->sigLen); - /* check for signature faults */ ret = VerifyRsaSign(ssl, args->sigData, args->sigLen, sig->buffer, sig->length, args->sigAlgo, diff --git a/tests/suites.c b/tests/suites.c index 8996adbaa..15b092a42 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -35,7 +35,11 @@ #define MAX_ARGS 40 #define MAX_COMMAND_SZ 240 -#define MAX_SUITE_SZ 80 +#ifdef WOLFSSL_TLS13 + #define MAX_SUITE_SZ 200 +#else + #define MAX_SUITE_SZ 80 +#endif #define NOT_BUILT_IN -123 #if defined(NO_OLD_TLS) || !defined(WOLFSSL_ALLOW_SSLV3) || \ !defined(WOLFSSL_ALLOW_TLSV10)