summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuki Yamaguchi <[email protected]>2025-01-19 23:08:12 +0900
committergit <[email protected]>2025-01-20 17:12:55 +0000
commit010e8bff88b50a1c43515e3aa16030ec7a2b90c3 (patch)
treef0bce154300739aa537d43dc74c9933db2620bca
parent04cc762941cb4b6dfcc5f1904b03cde683eafc7f (diff)
[ruby/openssl] pkcs7: remove unnecessary const cast
PKCS7_encrypt() and PKCS7_SIGNER_INFO_set() take const EVP_CIPHER and EVP_MD at least since OpenSSL 0.9.7. https://github.com/ruby/openssl/commit/9db621a5c0
-rw-r--r--ext/openssl/ossl_pkcs7.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index 2032e32597..e502c9542f 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -325,7 +325,7 @@ ossl_pkcs7_s_encrypt(int argc, VALUE *argv, VALUE klass)
BIO_free(in);
rb_jump_tag(status);
}
- if(!(p7 = PKCS7_encrypt(x509s, in, (EVP_CIPHER*)ciph, flg))){
+ if (!(p7 = PKCS7_encrypt(x509s, in, ciph, flg))) {
BIO_free(in);
sk_X509_pop_free(x509s, X509_free);
ossl_raise(ePKCS7Error, NULL);
@@ -947,7 +947,7 @@ ossl_pkcs7si_initialize(VALUE self, VALUE cert, VALUE key, VALUE digest)
x509 = GetX509CertPtr(cert); /* NO NEED TO DUP */
md = ossl_evp_get_digestbyname(digest);
GetPKCS7si(self, p7si);
- if (!(PKCS7_SIGNER_INFO_set(p7si, x509, pkey, (EVP_MD*)md))) {
+ if (!(PKCS7_SIGNER_INFO_set(p7si, x509, pkey, md))) {
ossl_raise(ePKCS7Error, NULL);
}