summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/openssl/openssl_missing.h15
-rw-r--r--ext/openssl/ossl_engine.c2
-rw-r--r--ext/openssl/ossl_pkey.c2
-rw-r--r--ext/openssl/ossl_ssl.c2
-rw-r--r--ext/openssl/ossl_ssl_session.c6
5 files changed, 15 insertions, 12 deletions
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 3061a322d15..619cf6fdb5e 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -18,6 +18,9 @@ extern "C" {
#ifndef TYPEDEF_D2I_OF
typedef char *d2i_of_void();
#endif
+#ifndef TYPEDEF_I2D_OF
+typedef int i2d_of_void();
+#endif
/*
* These functions are not included in headers of OPENSSL <= 0.9.6b
@@ -30,33 +33,33 @@ typedef char *d2i_of_void();
#if !defined(PEM_write_bio_DSAPublicKey)
# define PEM_write_bio_DSAPublicKey(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_DSAPublicKey,\
+ PEM_ASN1_write_bio((i2d_of_void *)i2d_DSAPublicKey,\
PEM_STRING_DSA_PUBLIC,\
bp,(char *)x, NULL, NULL, 0, NULL, NULL)
#endif
#if !defined(DSAPrivateKey_dup)
-# define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPrivateKey, \
+# define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPrivateKey, \
(d2i_of_void *)d2i_DSAPrivateKey,(char *)dsa)
#endif
#if !defined(DSAPublicKey_dup)
-# define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPublicKey, \
+# define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPublicKey, \
(d2i_of_void *)d2i_DSAPublicKey,(char *)dsa)
#endif
#if !defined(X509_REVOKED_dup)
-# define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((int (*)())i2d_X509_REVOKED, \
+# define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((i2d_of_void *)i2d_X509_REVOKED, \
(d2i_of_void *)d2i_X509_REVOKED, (char *)rev)
#endif
#if !defined(PKCS7_SIGNER_INFO_dup)
-# define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((int (*)())i2d_PKCS7_SIGNER_INFO, \
+# define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_SIGNER_INFO, \
(d2i_of_void *)d2i_PKCS7_SIGNER_INFO, (char *)si)
#endif
#if !defined(PKCS7_RECIP_INFO_dup)
-# define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((int (*)())i2d_PKCS7_RECIP_INFO, \
+# define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_RECIP_INFO, \
(d2i_of_void *)d2i_PKCS7_RECIP_INFO, (char *)ri)
#endif
diff --git a/ext/openssl/ossl_engine.c b/ext/openssl/ossl_engine.c
index 52651ea8807..2dfed654f4f 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -119,7 +119,7 @@ ossl_engine_s_by_id(VALUE klass, VALUE id)
if(!ENGINE_init(e))
ossl_raise(eEngineError, NULL);
ENGINE_ctrl(e, ENGINE_CTRL_SET_PASSWORD_CALLBACK,
- 0, NULL, (void(*)())ossl_pem_passwd_cb);
+ 0, NULL, (void(*)(void))ossl_pem_passwd_cb);
ERR_clear_error();
return obj;
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index fc93fe165cb..903a3bb1e5c 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -177,7 +177,7 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
str = rb_str_new(0, EVP_PKEY_size(pkey)+16);
if (!EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey))
ossl_raise(ePKeyError, NULL);
- assert(buf_len <= RSTRING_LEN(str));
+ assert((long)buf_len <= RSTRING_LEN(str));
rb_str_set_len(str, buf_len);
return str;
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index bf331f64031..767f81e54e7 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -905,7 +905,7 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eArgError, "arg must be Time or nil");
}
- SSL_CTX_flush_sessions(ctx, tm);
+ SSL_CTX_flush_sessions(ctx, (long)tm);
return self;
}
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index b236e4d5f68..d5fdba6aed4 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -107,7 +107,7 @@ static VALUE ossl_ssl_session_get_time(VALUE self)
if (t == 0)
return Qnil;
- return rb_funcall(rb_cTime, rb_intern("at"), 1, LONG2NUM(t));
+ return rb_funcall(rb_cTime, rb_intern("at"), 1, TIMET2NUM(t));
}
/*
@@ -126,14 +126,14 @@ static VALUE ossl_ssl_session_get_timeout(VALUE self)
t = SSL_SESSION_get_timeout(ctx);
- return ULONG2NUM(t);
+ return TIMET2NUM(t);
}
#define SSLSESSION_SET_TIME(func) \
static VALUE ossl_ssl_session_set_##func(VALUE self, VALUE time_v) \
{ \
SSL_SESSION *ctx; \
- time_t t; \
+ unsigned long t; \
\
GetSSLSession(self, ctx); \
\