[macruby-changes] [5179] MacRuby/trunk/ext/openssl/lib/openssl/bn.rb

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 17 16:19:04 PST 2011


Revision: 5179
          http://trac.macosforge.org/projects/ruby/changeset/5179
Author:   watson1978 at gmail.com
Date:     2011-01-17 16:18:59 -0800 (Mon, 17 Jan 2011)
Log Message:
-----------
OpenSSL::BN.new accepts only Strings, so call Integer#to_s(16). Merged from CRuby 1.9 r29407.
see https://github.com/ruby/ruby/commit/3a633b812e3676d4a1c8f20426d0354be530e056

Test Script:
{{{
require 'openssl'
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

assert_equal(999.to_bn, OpenSSL::BN.new(999.to_s(16), 16))

puts :ok
}}}

Revision Links:
--------------
    http://trac.macosforge.org/projects/ruby/changeset/29407

Modified Paths:
--------------
    MacRuby/trunk/ext/openssl/lib/openssl/bn.rb

Modified: MacRuby/trunk/ext/openssl/lib/openssl/bn.rb
===================================================================
--- MacRuby/trunk/ext/openssl/lib/openssl/bn.rb	2011-01-17 14:58:01 UTC (rev 5178)
+++ MacRuby/trunk/ext/openssl/lib/openssl/bn.rb	2011-01-18 00:18:59 UTC (rev 5179)
@@ -29,7 +29,7 @@
 #
 class Integer
   def to_bn
-    OpenSSL::BN::new(self)
+    OpenSSL::BN::new(self.to_s(16), 16)
   end
 end # Integer
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110117/f068c526/attachment.html>


More information about the macruby-changes mailing list