summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkcs12.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-12 16:27:01 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-12 22:49:05 +0900
commit6920f3dc964052112795dc9c5c4f9650807726c8 (patch)
tree4220f817a1d050f60af7e183a893a259dc79d69e /ext/openssl/ossl_pkcs12.c
parent598d66f6b2d1ab34dcd6db3bed70c59836a6206a (diff)
[ruby/openssl] Suppress cast-function-type warnings
https://github.com/ruby/openssl/commit/0f91e2a6ee
Diffstat (limited to 'ext/openssl/ossl_pkcs12.c')
-rw-r--r--ext/openssl/ossl_pkcs12.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/ext/openssl/ossl_pkcs12.c b/ext/openssl/ossl_pkcs12.c
index 4566334481..fb947df1d0 100644
--- a/ext/openssl/ossl_pkcs12.c
+++ b/ext/openssl/ossl_pkcs12.c
@@ -149,6 +149,24 @@ ossl_pkcs12_s_create(int argc, VALUE *argv, VALUE self)
return obj;
}
+static VALUE
+ossl_pkey_new_i(VALUE arg)
+{
+ return ossl_pkey_new((EVP_PKEY *)arg);
+}
+
+static VALUE
+ossl_x509_new_i(VALUE arg)
+{
+ return ossl_x509_new((X509 *)arg);
+}
+
+static VALUE
+ossl_x509_sk2ary_i(VALUE arg)
+{
+ return ossl_x509_sk2ary((STACK_OF(X509) *)arg);
+}
+
/*
* call-seq:
* PKCS12.new -> pkcs12
@@ -186,15 +204,15 @@ ossl_pkcs12_initialize(int argc, VALUE *argv, VALUE self)
ossl_raise(ePKCS12Error, "PKCS12_parse");
ERR_pop_to_mark();
if (key) {
- pkey = rb_protect((VALUE (*)(VALUE))ossl_pkey_new, (VALUE)key, &st);
+ pkey = rb_protect(ossl_pkey_new_i, (VALUE)key, &st);
if (st) goto err;
}
if (x509) {
- cert = rb_protect((VALUE (*)(VALUE))ossl_x509_new, (VALUE)x509, &st);
+ cert = rb_protect(ossl_x509_new_i, (VALUE)x509, &st);
if (st) goto err;
}
if (x509s) {
- ca = rb_protect((VALUE (*)(VALUE))ossl_x509_sk2ary, (VALUE)x509s, &st);
+ ca = rb_protect(ossl_x509_sk2ary_i, (VALUE)x509s, &st);
if (st) goto err;
}