forked from wolfSSL/wolfssl
Merge pull request #6391 from rizlik/dtls13-label-fix
dtls13: fix: use correct label to derive resumption key
This commit is contained in:
19
src/tls13.c
19
src/tls13.c
@ -885,9 +885,19 @@ int Tls13_Exporter(WOLFSSL* ssl, unsigned char *out, size_t outLen,
|
|||||||
const byte* protocol = tls13ProtocolLabel;
|
const byte* protocol = tls13ProtocolLabel;
|
||||||
word32 protocolLen = TLS13_PROTOCOL_LABEL_SZ;
|
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;
|
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) {
|
switch (ssl->specs.mac_algorithm) {
|
||||||
#ifndef NO_SHA256
|
#ifndef NO_SHA256
|
||||||
case sha256_mac:
|
case sha256_mac:
|
||||||
@ -1166,6 +1176,13 @@ int DeriveResumptionPSK(WOLFSSL* ssl, byte* nonce, byte nonceLen, byte* secret)
|
|||||||
|
|
||||||
WOLFSSL_MSG("Derive Resumption PSK");
|
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) {
|
switch (ssl->specs.mac_algorithm) {
|
||||||
#ifndef NO_SHA256
|
#ifndef NO_SHA256
|
||||||
case sha256_mac:
|
case sha256_mac:
|
||||||
|
Reference in New Issue
Block a user