Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Browse files Browse the repository at this point in the history
… fixup! fixup! DTLS 1.3 record number encryption
  • Loading branch information
fwh-dc committed Aug 29, 2024
1 parent 00ef41c commit 18e7591
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions ssl/record/methods/dtls_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,25 +381,23 @@ int dtls_crypt_sequence_number(unsigned char *seq, size_t seq_len,
iv = NULL;
in = rec_data;
inlen = 16;
} else if (OPENSSL_strncasecmp(name, "cha", 3) == 0) {
} else if (OPENSSL_strncasecmp(name, "chacha", 6) == 0) {
iv = rec_data;
in = rec_data + 4;
inlen = 12;
} else {
if (ossl_assert(OPENSSL_strncasecmp(name, "null", 4) == 0)) {
if (ossl_assert(OPENSSL_strncasecmp(name, "null", 4) == 0))
return 1;
} else {
else
return 0;
}
}

if (!ossl_assert(inlen >= 0)
|| (size_t)inlen > sizeof(mask)
|| seq_len > sizeof(mask)
|| EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, 1) <= 0
|| EVP_CipherUpdate(ctx, mask, &outlen, in, inlen) <= 0) {
|| EVP_CipherUpdate(ctx, mask, &outlen, in, inlen) <= 0)
return 0;
}

for (i = 0; i < seq_len; i++)
seq[i] ^= mask[i];
Expand Down
2 changes: 1 addition & 1 deletion ssl/ssl_ciph.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ int ssl_cipher_get_evp_cipher_ecb(SSL_CTX *ctx, const SSL_CIPHER *sslc,
if (ecb_name != NULL)
*enc = EVP_CIPHER_fetch(ctx->libctx, ecb_name, ctx->propq);
else
return 0;
*enc = NULL;
}

if (*enc == NULL)
Expand Down

0 comments on commit 18e7591

Please sign in to comment.