ruby-changes:23052
From: nobu <ko1@a...>
Date: Thu, 22 Mar 2012 13:43:48 +0900 (JST)
Subject: [ruby-changes:23052] nobu:r35102 (trunk): * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type.
nobu 2012-03-22 13:43:38 +0900 (Thu, 22 Mar 2012) New Revision: 35102 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35102 Log: * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type. [Bug #6094] Modified files: trunk/ChangeLog trunk/ext/openssl/ossl_pkey_rsa.c Index: ChangeLog =================================================================== --- ChangeLog (revision 35101) +++ ChangeLog (revision 35102) @@ -1,3 +1,8 @@ +Thu Mar 22 13:43:31 2012 Nobuyoshi Nakada <nobu@r...> + + * ext/openssl/ossl_pkey_rsa.c (rsa_generate): fix argument type. + [Bug #6094] + Thu Mar 22 11:14:10 2012 NAKAMURA Usaku <usa@r...> * test/ruby/test_io.rb (TestIO#test_pos_with_getc): updated. Index: ext/openssl/ossl_pkey_rsa.c =================================================================== --- ext/openssl/ossl_pkey_rsa.c (revision 35101) +++ ext/openssl/ossl_pkey_rsa.c (revision 35102) @@ -95,7 +95,7 @@ #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 @@ 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 @@ 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 { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/