Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: fix label cast in EVP_PKEY_CTX_set0_rsa_oaep_label #38926

Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/crypto/crypto_cipher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ bool PublicKeyCipher::Cipher(
void* label = OPENSSL_memdup(oaep_label.data(), oaep_label.size());
CHECK_NOT_NULL(label);
if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(),
reinterpret_cast<unsigned char*>(label),
static_cast<unsigned char*>(label),
oaep_label.size())) {
OPENSSL_free(label);
return false;
Expand Down
5 changes: 4 additions & 1 deletion src/crypto/crypto_rsa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ WebCryptoCipherStatus RSA_Cipher(
if (label_len > 0) {
void* label = OPENSSL_memdup(params.label.get(), label_len);
CHECK_NOT_NULL(label);
if (EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), label, label_len) <= 0) {
if (EVP_PKEY_CTX_set0_rsa_oaep_label(
ctx.get(),
static_cast<unsigned char*>(label),
label_len) <= 0) {
OPENSSL_free(label);
return WebCryptoCipherStatus::FAILED;
}
Expand Down