aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ts.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-09-12 22:26:34 +0900
committerGitHub <noreply@github.com>2021-09-12 22:26:34 +0900
commit5c85b4385f114400d901ed7dd89ce43489b9bceb (patch)
treeb11ad2d8d5d99aed63bca148c459b919d8a43772 /ext/openssl/ossl_ts.c
parentcf54f72df20879dfb377c9ca4d397285c1560daa (diff)
parent258e30b6406d69025f09ec09ae22f5c08de6c80b (diff)
downloadruby-openssl-5c85b4385f114400d901ed7dd89ce43489b9bceb.tar.gz
Merge pull request #456 from ruby/compilation-warnings
Suppress compilation warnings
Diffstat (limited to 'ext/openssl/ossl_ts.c')
-rw-r--r--ext/openssl/ossl_ts.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/ext/openssl/ossl_ts.c b/ext/openssl/ossl_ts.c
index dbd73748..e2fd0fe0 100644
--- a/ext/openssl/ossl_ts.c
+++ b/ext/openssl/ossl_ts.c
@@ -146,6 +146,12 @@ obj_to_asn1obj(VALUE obj)
}
static VALUE
+obj_to_asn1obj_i(VALUE obj)
+{
+ return (VALUE)obj_to_asn1obj(obj);
+}
+
+static VALUE
get_asn1obj(ASN1_OBJECT *obj)
{
BIO *out;
@@ -1078,6 +1084,18 @@ ossl_tsfac_time_cb(struct TS_resp_ctx *ctx, void *data, long *sec, long *usec)
return 1;
}
+static VALUE
+ossl_evp_get_digestbyname_i(VALUE arg)
+{
+ return (VALUE)ossl_evp_get_digestbyname(arg);
+}
+
+static VALUE
+ossl_obj2bio_i(VALUE arg)
+{
+ return (VALUE)ossl_obj2bio((VALUE *)arg);
+}
+
/*
* Creates a Response with the help of an OpenSSL::PKey, an
* OpenSSL::X509::Certificate and a Request.
@@ -1146,7 +1164,7 @@ ossl_tsfac_create_ts(VALUE self, VALUE key, VALUE certificate, VALUE request)
goto end;
}
if (!NIL_P(def_policy_id) && !TS_REQ_get_policy_id(req)) {
- def_policy_id_obj = (ASN1_OBJECT*)rb_protect((VALUE (*)(VALUE))obj_to_asn1obj, (VALUE)def_policy_id, &status);
+ def_policy_id_obj = (ASN1_OBJECT*)rb_protect(obj_to_asn1obj_i, (VALUE)def_policy_id, &status);
if (status)
goto end;
}
@@ -1188,7 +1206,7 @@ ossl_tsfac_create_ts(VALUE self, VALUE key, VALUE certificate, VALUE request)
for (i = 0; i < RARRAY_LEN(allowed_digests); i++) {
rbmd = rb_ary_entry(allowed_digests, i);
- md = (const EVP_MD *)rb_protect((VALUE (*)(VALUE))ossl_evp_get_digestbyname, rbmd, &status);
+ md = (const EVP_MD *)rb_protect(ossl_evp_get_digestbyname_i, rbmd, &status);
if (status)
goto end;
TS_RESP_CTX_add_md(ctx, md);
@@ -1199,7 +1217,7 @@ ossl_tsfac_create_ts(VALUE self, VALUE key, VALUE certificate, VALUE request)
if (status)
goto end;
- req_bio = (BIO*)rb_protect((VALUE (*)(VALUE))ossl_obj2bio, (VALUE)&str, &status);
+ req_bio = (BIO*)rb_protect(ossl_obj2bio_i, (VALUE)&str, &status);
if (status)
goto end;