Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

merge revision(s) 30274:30279:

?\012
	* Backported the fix at
	  Mon Oct  4 09:30:42 2010  NARUSE, Yui  <naruse@ruby-lang.org>

	* ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
	  accepts only Strings, so call Integer#to_s(16).
	  16 is for an optimization. [ruby-dev:42336]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
?\012
	Make test-all run. require_relative is from 1.9.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
?\012
	* Backported the fix at
	  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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
?\012
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>

create mode 100644 test/openssl/test_bn.rb

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@31657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 3fe0181b82af89db7f521d423a2518e2559489ee 1 parent 4c5a678
Urabe, Shyouhei shyouhei authored
18 ChangeLog
... ... @@ -1,3 +1,21 @@
  1 +Fri May 20 23:06:31 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
  2 +
  3 + * Backported the fix at
  4 + Mon Sep 13 09:23:58 2010 NARUSE, Yui <naruse@ruby-lang.org>
  5 +
  6 + * ext/openssl/ossl_bn.c (ossl_bn_is_prime): fix comparison
  7 + with rb_scan_args. Before this fix, OpenSSL::BN#prime?
  8 + is fully broken.
  9 +
  10 +Fri May 20 23:06:31 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
  11 +
  12 + * Backported the fix at
  13 + Mon Oct 4 09:30:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
  14 +
  15 + * ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
  16 + accepts only Strings, so call Integer#to_s(16).
  17 + 16 is for an optimization. [ruby-dev:42336]
  18 +
1 19 Fri Feb 18 21:18:55 2011 Shugo Maeda <shugo@ruby-lang.org>
2 20
3 21 * test/ruby/test_exception.rb (TestException::test_to_s_taintness_propagation):
2  ext/openssl/lib/openssl/bn.rb
@@ -29,7 +29,7 @@ class BN
29 29 #
30 30 class Integer
31 31 def to_bn
32   - OpenSSL::BN::new(self)
  32 + OpenSSL::BN::new(self.to_s(16), 16)
33 33 end
34 34 end # Integer
35 35
2  ext/openssl/ossl_bn.c
@@ -669,7 +669,7 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
669 669 VALUE vchecks;
670 670 int checks = BN_prime_checks;
671 671
672   - if (rb_scan_args(argc, argv, "01", &vchecks) == 0) {
  672 + if (rb_scan_args(argc, argv, "01", &vchecks) == 1) {
673 673 checks = NUM2INT(vchecks);
674 674 }
675 675 GetBN(self, bn);
21 test/openssl/test_bn.rb
... ... @@ -0,0 +1,21 @@
  1 +begin
  2 + require "openssl"
  3 + require File.join(File.dirname(__FILE__), "utils.rb")
  4 +rescue LoadError
  5 +end
  6 +
  7 +if defined?(OpenSSL)
  8 +
  9 +class OpenSSL::TestBN < Test::Unit::TestCase
  10 + def test_integer_to_bn
  11 + assert_equal(999.to_bn, OpenSSL::BN.new(999.to_s(16), 16))
  12 + assert_equal((2 ** 107 - 1).to_bn, OpenSSL::BN.new((2 ** 107 - 1).to_s(16), 16))
  13 + end
  14 +
  15 + def test_prime_p
  16 + OpenSSL::BN.new((2 ** 107 - 1).to_s(16), 16).prime?
  17 + OpenSSL::BN.new((2 ** 127 - 1).to_s(16), 16).prime?(1)
  18 + end
  19 +end
  20 +
  21 +end
10 version.h
... ... @@ -1,15 +1,15 @@
1 1 #define RUBY_VERSION "1.8.7"
2   -#define RUBY_RELEASE_DATE "2011-02-18"
  2 +#define RUBY_RELEASE_DATE "2011-05-20"
3 3 #define RUBY_VERSION_CODE 187
4   -#define RUBY_RELEASE_CODE 20110218
5   -#define RUBY_PATCHLEVEL 334
  4 +#define RUBY_RELEASE_CODE 20110520
  5 +#define RUBY_PATCHLEVEL 335
6 6
7 7 #define RUBY_VERSION_MAJOR 1
8 8 #define RUBY_VERSION_MINOR 8
9 9 #define RUBY_VERSION_TEENY 7
10 10 #define RUBY_RELEASE_YEAR 2011
11   -#define RUBY_RELEASE_MONTH 2
12   -#define RUBY_RELEASE_DAY 18
  11 +#define RUBY_RELEASE_MONTH 5
  12 +#define RUBY_RELEASE_DAY 20
13 13
14 14 #ifdef RUBY_EXTERN
15 15 RUBY_EXTERN const char ruby_version[];

0 comments on commit 3fe0181

Please sign in to comment.
Something went wrong with that request. Please try again.