Project

General

Profile

Bug #3902

Integer#to_bn in OpenSSL

Added by ohai (Ippei Obayashi) over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-dev:42336]

Description

=begin
ext/openssl で定義されている Integer#to_bn が以下のように正しく動作しません。
% ruby-1.9.2-p0 -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
% ruby-1.9.2-p0 -ropenssl -e '43.to_bn'
/home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/openssl/bn.rb:32:in initialize': can't convert Fixnum into String (TypeError)
from /home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/openssl/bn.rb:32:in
new'
from /home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/openssl/bn.rb:32:in to_bn'
from -e:1:in
'

以下の修正で直ると思います。
--- a/ext/openssl/lib/openssl/bn.rb
+++ b/ext/openssl/lib/openssl/bn.rb
@@ -29,7 +29,7 @@ end # OpenSSL
#
class Integer
def to_bn

  • OpenSSL::BN::new(self)
  • OpenSSL::BN::new(self.to_s) end end # Integer =end
#1

Updated by naruse (Yui NARUSE) over 9 years ago

  • Status changed from Open to Closed

=begin
r29407で修正しました
=end

Also available in: Atom PDF