Bug #1184
Type error in Integer#to_bn (via Openssl)
| Status: | Assigned | Start date: | 02/21/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | ext | |||
| Target version: | Ruby 1.8.7 | |||
| ruby -v: | ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] |
Description
The openssl library adds the to_bn method to the Integer class for creating an instance of the OpenSSL::BN class. The code, located in openssl/bn.rb, is:
def to_bn
OpenSSL::BN::new(self)
end
However, the constructor for the BN class takes a String, not an Integer.
The following repoduces the error:
require 'openssl'
3.to_bn
=> TypeError: can't convert Fixnum into String
History
Updated by shyouhei (Shyouhei Urabe) over 1 year ago
- Status changed from Open to Assigned
- Assignee set to nahi (Hiroshi Nakamura)
It seems this bug remains in 1.8 branches. Fixed in 1.9. Please close if I'm wrong.
Updated by nahi (Hiroshi Nakamura) over 1 year ago
- Category set to ext
- Assignee changed from nahi (Hiroshi Nakamura) to shyouhei (Shyouhei Urabe)
- Target version set to Ruby 1.8.7
Fixed at trunk in r29407. It must be a simple bug so I backported the fix to ruby_1_8 at r30275. It should go to ruby_1_8_7 as well.