summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--ext/openssl/ossl_rand.c2
-rw-r--r--ext/openssl/ossl_ssl.c2
-rw-r--r--ext/openssl/ossl_x509store.c8
4 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1843641..ea9a4a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Thu Mar 24 11:48:19 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/openssl/ossl_rand.c (ossl_rand_egd_bytes): use NUM2INT because
+ the result is used with functions whose argument is int.
+
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_purpose): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509store_set_trust): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_purpose): ditto.
+
+ * ext/openssl/ossl_x509store.c (ossl_x509stctx_set_trust): ditto.
+
Thu Mar 24 11:36:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
* ext/openssl/ossl_x509name.c: id_aref's type is ID.
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index 92f5aaa..7d4e0b8 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.c
@@ -149,7 +149,7 @@ ossl_rand_egd(VALUE self, VALUE filename)
static VALUE
ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)
{
- long n = NUM2INT(len);
+ int n = NUM2INT(len);
SafeStringValue(filename);
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index e5cce0f..fd451b3 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -630,7 +630,7 @@ ossl_sslctx_setup(VALUE self)
if(!NIL_P(val)) SSL_CTX_set_timeout(ctx, NUM2LONG(val));
val = ossl_sslctx_get_verify_dep(self);
- if(!NIL_P(val)) SSL_CTX_set_verify_depth(ctx, NUM2LONG(val));
+ if(!NIL_P(val)) SSL_CTX_set_verify_depth(ctx, NUM2INT(val));
val = ossl_sslctx_get_options(self);
if(!NIL_P(val)) SSL_CTX_set_options(ctx, NUM2LONG(val));
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index e785648..5d341c5 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -170,7 +170,7 @@ ossl_x509store_set_purpose(VALUE self, VALUE purpose)
{
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
X509_STORE *store;
- long p = NUM2LONG(purpose);
+ int p = NUM2INT(purpose);
GetX509Store(self, store);
X509_STORE_set_purpose(store, p);
@@ -186,7 +186,7 @@ ossl_x509store_set_trust(VALUE self, VALUE trust)
{
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
X509_STORE *store;
- long t = NUM2LONG(trust);
+ int t = NUM2INT(trust);
GetX509Store(self, store);
X509_STORE_set_trust(store, t);
@@ -526,7 +526,7 @@ static VALUE
ossl_x509stctx_set_purpose(VALUE self, VALUE purpose)
{
X509_STORE_CTX *store;
- long p = NUM2LONG(purpose);
+ int p = NUM2INT(purpose);
GetX509StCtx(self, store);
X509_STORE_CTX_set_purpose(store, p);
@@ -538,7 +538,7 @@ static VALUE
ossl_x509stctx_set_trust(VALUE self, VALUE trust)
{
X509_STORE_CTX *store;
- long t = NUM2LONG(trust);
+ int t = NUM2INT(trust);
GetX509StCtx(self, store);
X509_STORE_CTX_set_trust(store, t);