Skip to content

Commit

Permalink
Fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh-dc committed Mar 21, 2024
1 parent 20dd8e1 commit ebc56f2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ssl/tls13_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ int tls13_hkdf_expand_ex(OSSL_LIB_CTX *libctx, const char *propq,
const unsigned char *data, size_t datalen,
unsigned char *out, size_t outlen, int raise_error)
{
// TODO: Should we support DTLS labels from here? This interface is only used by QUIC.
return hkdf_expand(libctx, propq, md, secret, label_prefix_tls13, sizeof(label_prefix_tls13) - 1,
/* This function only supports TLSv1.3 and not DTLSv1.3 */
return hkdf_expand(libctx, propq, md, secret, label_prefix_tls13,
sizeof(label_prefix_tls13) - 1,
label, labellen, data, datalen, out, outlen,
raise_error);
}
Expand All @@ -120,14 +121,14 @@ int tls13_hkdf_expand(SSL_CONNECTION *s, const EVP_MD *md,
unsigned char *out, size_t outlen, int fatal)
{
int ret;
unsigned char *label_prefix;
size_t label_prefix_len;
SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
int isdtls = SSL_CONNECTION_IS_DTLS(s);

const char *label_prefix = SSL_CONNECTION_IS_DTLS(s) ? label_prefix_dtls13
: label_prefix_tls13;

size_t label_prefix_len = SSL_CONNECTION_IS_DTLS(s)
? sizeof(label_prefix_dtls13) - 1
: sizeof(label_prefix_tls13) - 1;
label_prefix = isdtls ? label_prefix_dtls13 : label_prefix_tls13;
label_prefix_len = isdtls ? sizeof(label_prefix_dtls13) - 1
: sizeof(label_prefix_tls13) - 1;

ret = hkdf_expand(sctx->libctx, sctx->propq, md, secret, label_prefix,
label_prefix_len, label, labellen, data,
Expand Down

0 comments on commit ebc56f2

Please sign in to comment.