mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7d4e89a7c0
commit
856e1f17f1
4 changed files with 25 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Sep 13 09:23:58 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@dotrb.org>
|
Sun Sep 12 21:21:50 2010 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* lib/date.rb: [ruby-core:32096] Thanks Colin Bartlett.
|
* lib/date.rb: [ruby-core:32096] Thanks Colin Bartlett.
|
||||||
|
|
|
@ -669,7 +669,7 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
|
||||||
VALUE vchecks;
|
VALUE vchecks;
|
||||||
int checks = BN_prime_checks;
|
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);
|
checks = NUM2INT(vchecks);
|
||||||
}
|
}
|
||||||
GetBN(self, bn);
|
GetBN(self, bn);
|
||||||
|
|
17
test/openssl/test_bn.rb
Normal file
17
test/openssl/test_bn.rb
Normal file
|
@ -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
|
|
@ -1,5 +1,5 @@
|
||||||
#define RUBY_VERSION "1.9.2"
|
#define RUBY_VERSION "1.9.2"
|
||||||
#define RUBY_PATCHLEVEL 38
|
#define RUBY_PATCHLEVEL 39
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
#define RUBY_VERSION_MINOR 9
|
#define RUBY_VERSION_MINOR 9
|
||||||
#define RUBY_VERSION_TEENY 1
|
#define RUBY_VERSION_TEENY 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue