Project

General

Profile

Actions

Bug #3902

closed

Integer#to_bn in OpenSSL

Added by ohai (Ippei Obayashi) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
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
Actions #1

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Closed

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

Actions

Also available in: Atom PDF

Like0
Like0