From: Ippei Obayashi Date: 2010-10-04T04:19:28+09:00 Subject: [ruby-dev:42336] [Ruby-Feature#3902][Open] Integer#to_bn in OpenSSL Feature #3902: Integer#to_bn in OpenSSL http://redmine.ruby-lang.org/issues/show/3902 起票者: Ippei Obayashi ステータス: Open, 優先度: Normal カテゴリ: ext 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 ---------------------------------------- http://redmine.ruby-lang.org