diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-22 04:43:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-22 04:43:38 +0000 |
commit | 3911327572439a4c8786531b2251306f71799a3a (patch) | |
tree | 9b05cc6530df4f9743e06fd6b09f137a619953d9 | |
parent | 24513fe21eddef33d513413c0541d8935ec5ad80 (diff) |
* ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type.
[Bug #6094]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/openssl/ossl_pkey_rsa.c | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Thu Mar 22 13:43:31 2012 Nobuyoshi Nakada <[email protected]> + + * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type. + [Bug #6094] + Thu Mar 22 11:14:10 2012 NAKAMURA Usaku <[email protected]> * test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated. diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c index b224cdd5f9..4b20928bbd 100644 --- a/ext/openssl/ossl_pkey_rsa.c +++ b/ext/openssl/ossl_pkey_rsa.c @@ -95,7 +95,7 @@ rsa_blocking_gen(void *arg) #endif static RSA * -rsa_generate(int size, int exp) +rsa_generate(int size, unsigned long exp) { #if defined(HAVE_RSA_GENERATE_KEY_EX) && HAVE_BN_GENCB int i; @@ -168,7 +168,7 @@ ossl_rsa_s_generate(int argc, VALUE *argv, VALUE klass) rb_scan_args(argc, argv, "11", &size, &exp); - rsa = rsa_generate(NUM2INT(size), NIL_P(exp) ? RSA_F4 : NUM2INT(exp)); /* err handled by rsa_instance */ + rsa = rsa_generate(NUM2INT(size), NIL_P(exp) ? RSA_F4 : NUM2ULONG(exp)); /* err handled by rsa_instance */ obj = rsa_instance(klass, rsa); if (obj == Qfalse) { @@ -213,7 +213,7 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self) rsa = RSA_new(); } else if (FIXNUM_P(arg)) { - rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2INT(pass)); + rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2ULONG(pass)); if (!rsa) ossl_raise(eRSAError, NULL); } else { |