From ae25027135d32e8db0e3e9b4e6fd20357ef33a65 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 19 Sep 2019 12:07:14 -0700 Subject: [PATCH] Fix for TLS v1.3 and PK callbacks. --- src/tls13.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tls13.c b/src/tls13.c index aa8a969b8..bca23415d 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -3401,7 +3401,11 @@ static int DoTls13CertificateRequest(WOLFSSL* ssl, const byte* input, #endif if (ssl->buffers.certificate && ssl->buffers.certificate->buffer && - ssl->buffers.key && ssl->buffers.key->buffer) { + ((ssl->buffers.key && ssl->buffers.key->buffer) + #ifdef HAVE_PK_CALLBACKS + || wolfSSL_CTX_IsPrivatePkSet(ssl->ctx) + #endif + )) { #ifndef WOLFSSL_TLS13_DRAFT_18 if (PickHashSigAlgo(ssl, peerSuites.hashSigAlgo, peerSuites.hashSigAlgoSz) != 0) { @@ -3410,8 +3414,9 @@ static int DoTls13CertificateRequest(WOLFSSL* ssl, const byte* input, #endif ssl->options.sendVerify = SEND_CERT; } - else + else { ssl->options.sendVerify = SEND_BLANK_CERT; + } /* This message is always encrypted so add encryption padding. */ *inOutIdx += ssl->keys.padSz;