ruby-changes:17783
From: yugui <ko1@a...>
Date: Mon, 15 Nov 2010 20:43:56 +0900 (JST)
Subject: [ruby-changes:17783] Ruby:r29794 (ruby_1_9_2): merges r29237 and r29238 from trunk into ruby_1_9_2.
yugui 2010-11-15 20:43:42 +0900 (Mon, 15 Nov 2010) New Revision: 29794 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29794 Log: merges r29237 and r29238 from trunk into ruby_1_9_2. -- * ext/openssl/ossl_bn.c (ossl_bn_is_prime): fix comparison with rb_scan_args. Before this fix, OpenSSL::BN#prime? is fully broken. -- Add ML ref [ruby-dev:42225] for r29237. Added files: branches/ruby_1_9_2/test/openssl/test_bn.rb Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/ext/openssl/ossl_bn.c branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 29793) +++ ruby_1_9_2/ChangeLog (revision 29794) @@ -1,3 +1,9 @@ +Mon Sep 13 09:23:58 2010 NARUSE, Yui <naruse@r...> + + * ext/openssl/ossl_bn.c (ossl_bn_is_prime): fix comparison + with rb_scan_args. Before this fix, OpenSSL::BN#prime? + is fully broken. [ruby-dev:42225] + Sun Sep 12 21:21:50 2010 Tadayoshi Funaba <tadf@d...> * lib/date.rb: [ruby-core:32096] Thanks Colin Bartlett. Index: ruby_1_9_2/ext/openssl/ossl_bn.c =================================================================== --- ruby_1_9_2/ext/openssl/ossl_bn.c (revision 29793) +++ ruby_1_9_2/ext/openssl/ossl_bn.c (revision 29794) @@ -669,7 +669,7 @@ VALUE vchecks; int checks = BN_prime_checks; - if (rb_scan_args(argc, argv, "01", &vchecks) == 0) { + if (rb_scan_args(argc, argv, "01", &vchecks) == 1) { checks = NUM2INT(vchecks); } GetBN(self, bn); Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 29793) +++ ruby_1_9_2/version.h (revision 29794) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 38 +#define RUBY_PATCHLEVEL 39 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 Index: ruby_1_9_2/test/openssl/test_bn.rb =================================================================== --- ruby_1_9_2/test/openssl/test_bn.rb (revision 0) +++ ruby_1_9_2/test/openssl/test_bn.rb (revision 29794) @@ -0,0 +1,17 @@ +begin + require "openssl" +rescue LoadError +end +require "digest/md5" +require "test/unit" + +if defined?(OpenSSL) + +class OpenSSL::TestBN < Test::Unit::TestCase + def test_prime_p + OpenSSL::BN.new((2 ** 107 - 1).to_s(16), 16).prime? + OpenSSL::BN.new((2 ** 127 - 1).to_s(16), 16).prime?(1) + end +end + +end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/