Skip to content

Commit

Permalink
crypto: fix label cast in EVP_PKEY_CTX_set0_rsa_oaep_label
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 5, 2021
1 parent e7f941c commit 474fa4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 474fa4f

Please sign in to comment.