Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,9 +885,19 @@ int Tls13_Exporter(WOLFSSL* ssl, unsigned char *out, size_t outLen,
const byte* protocol = tls13ProtocolLabel;
word32 protocolLen = TLS13_PROTOCOL_LABEL_SZ;

if (ssl->version.minor != TLSv1_3_MINOR)
if (ssl->options.dtls && ssl->version.minor != DTLSv1_3_MINOR)
return VERSION_ERROR;

if (!ssl->options.dtls && ssl->version.minor != TLSv1_3_MINOR)
return VERSION_ERROR;

#ifdef WOLFSSL_DTLS13
if (ssl->options.dtls) {
protocol = dtls13ProtocolLabel;
protocolLen = DTLS13_PROTOCOL_LABEL_SZ;
}
#endif /* WOLFSSL_DTLS13 */

switch (ssl->specs.mac_algorithm) {
#ifndef NO_SHA256
case sha256_mac:
Expand Down Expand Up @@ -1166,6 +1176,13 @@ int DeriveResumptionPSK(WOLFSSL* ssl, byte* nonce, byte nonceLen, byte* secret)

WOLFSSL_MSG("Derive Resumption PSK");

#ifdef WOLFSSL_DTLS13
if (ssl->options.dtls) {
protocol = dtls13ProtocolLabel;
protocolLen = DTLS13_PROTOCOL_LABEL_SZ;
}
#endif /* WOLFSSL_DTLS13 */

switch (ssl->specs.mac_algorithm) {
#ifndef NO_SHA256
case sha256_mac:
Expand Down