Bug 559158 - hexdigest method missing in ruby-libs-1.8.6.383-6
hexdigest method missing in ruby-libs-1.8.6.383-6
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
12
All Linux
low Severity urgent
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 559234
  Show dependency treegraph
 
Reported: 2010-01-27 05:12 EST by James Turnbull
Modified: 2010-05-31 14:28 EDT (History)
6 users (show)

See Also:
Fixed In Version: ruby-1.8.6.399-5.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 559234 (view as bug list)
Environment:
Last Closed: 2010-05-31 14:21:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Turnbull 2010-01-27 05:12:26 EST
Description of problem:

Missing hexdigest method after ruby upgrade to 1.8.6.383-6.

Version-Release number of selected component (if applicable):

ruby-libs-1.8.6.383-6

How reproducible:

Easily.

Steps to Reproduce:

$ irb
irb(main):001:0> require 'openssl'
=> true
irb(main):002:0> OpenSSL::Digest.methods.include?("hexdigest")
=> false

This method was present in the previous release.  This will break a LOT of software (including Puppet) that uses OpenSSL hexdigests.
Comment 1 James Turnbull 2010-01-27 05:39:56 EST
The method seems available in the sub-digests just not in the Digests module:

$ irb
> OpenSSL::Digest::SHA1.methods.include?("hexdigest")
=> true
> OpenSSL::Digest::MD5.methods.include?("hexdigest")
=> true
Comment 2 Jeroen van Meeuwen 2010-01-27 07:41:28 EST
Hmm, I wonder what has changed here
Comment 3 Mamoru TASAKA 2010-01-27 08:02:57 EST
(In reply to comment #0)
> This method was present in the previous release. 

By the way what exactly does "the previous release" mean?
Would you tell us what EVR (Epoch-Version-Release) of ruby
worked?
Comment 4 James Turnbull 2010-01-27 08:09:05 EST
Sorry - I just updated Ruby before the error appeared giving me the assumption it worked but it might not have been the case.  This code (which works on OSX and hence I didn't pick it up until I started testing on other platforms):

OpenSSL::Digest.hexdigest(md, content.to_der).scan(/../).join(':').upcase
Comment 5 James Turnbull 2010-01-27 08:11:44 EST
(In reply to comment #4)
> Sorry - I just updated Ruby before the error appeared giving me the assumption
> it worked but it might not have been the case.  This code (which works on OSX
> and hence I didn't pick it up until I started testing on other platforms):
> 
> OpenSSL::Digest.hexdigest(md, content.to_der).scan(/../).join(':').upcase    

So it might have been an older change than that and I apologise for leading you down a rabbit hole.
Comment 6 James Turnbull 2010-01-27 08:19:11 EST
I've confirmed this call works fine on OSX, Ubuntu Karmic and Debian Lenny.
Comment 7 James Turnbull 2010-01-27 08:29:36 EST
Which are:

OSX: ruby 1.8.7 (2008-08-11 patchlevel 72)
Lenny: 1.8.7.72-3lenny1
Ubuntu: 1.8.7.174-1ubuntu1
Comment 8 Mamoru TASAKA 2010-01-27 08:59:08 EST
Well, for now I guess this is NOTABUG for 1.8.6.x ruby.
Comment 9 Jeroen van Meeuwen 2010-01-27 09:26:01 EST
Note that this method does not exist on EL-5's version of Ruby either. (ruby-1.8.5-5.el5_3.7).

The fix seems to be to apply revision 15600 to Ruby:

[jmeeuwen@ghandalf SPECS]$ ruby -ropenssl -e 'OpenSSL::Digest.methods.include?("hexdigest")'
[jmeeuwen@ghandalf SPECS]$ ruby -ropenssl -e ' puts OpenSSL::Digest.methods.include?("hexdigest")'
true
[jmeeuwen@ghandalf SPECS]$ irb
irb(main):001:0> require 'openssl'
=> true
irb(main):002:0> OpenSSL::Digest.methods.include?("hexdigest")
=> true
irb(main):003:0>
Comment 10 Mamoru TASAKA 2010-01-27 11:26:26 EST
With ruby-1.8.6.388-8.fc13 rebuilding rubygem-actionpack 2.3.4
(and 2.3.5 which I am trying) fails on "rake test":

http://koji.fedoraproject.org/koji/taskinfo?taskID=1948498

with messages like:
Message: <"wrong argument (String)! (Expected kind of OpenSSL::Digest)">

Once untagging ruby-1.8.6.388-8.fc13

(Sorry, it seems that I have done something wrong. Now retagging
 -7.fc13 as dist-f13)
Comment 11 Mamoru TASAKA 2010-01-27 11:29:44 EST
(Once re-retagging -7.fc13, not -8.fc13)
Comment 12 Mamoru TASAKA 2010-01-27 11:34:05 EST
Now the latest dist-f13 ruby is surely ruby-1.8.6.388-7.fc13.
Sorry for sending multiple noise.
Comment 13 Mamoru TASAKA 2010-01-28 01:46:35 EST
I guess this is a mistake of OpenSSL::Digest::Digest .

irb(main):001:0> require "openssl"
=> true
irb(main):002:0> OpenSSL::Digest::Digest.hexdigest('md5', 'foo')
=> "acbd18db4cc2f85cedef654fccc4a4d8"
irb(main):003:0> OpenSSL::Digest::Digest.hexdigest('sha256', 'foo')
=> "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
Comment 14 Thiago Figueiro 2010-02-02 23:48:36 EST
I can confirm this bug in ruby-1.8.6.388-8.fc13 (http://koji.fedoraproject.org/koji/buildinfo?buildID=153296).

After upgrade from ruby-1.8.5-5.7 some applications started throwing this error:

  Status: 500 Internal Server Error
  wrong argument (String)! (Expected kind of OpenSSL::Digest)
    /usr/lib/ruby/1.8/openssl/digest.rb:55:in `initialize'
(...)
Comment 15 Mamoru TASAKA 2010-05-18 14:03:48 EDT
Would would try 1.8.6.399-5?
Comment 16 Mamoru TASAKA 2010-05-18 14:07:00 EDT
(I will request to make 1.8.6.399-5 pushed into testing once the
 previous 1.8.6.399-4 is pushed into testing to avoid bodhi side
 confusion. If you want to try now, please visit:
 http://koji.fedoraproject.org/koji/packageinfo?packageID=125 )
Comment 17 Fedora Update System 2010-05-18 23:43:33 EDT
ruby-1.8.6.399-5.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-5.fc13
Comment 18 Fedora Update System 2010-05-18 23:44:32 EDT
ruby-1.8.6.399-5.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/ruby-1.8.6.399-5.fc12
Comment 19 Fedora Update System 2010-05-19 15:12:56 EDT
ruby-1.8.6.399-5.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ruby'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/ruby-1.8.6.399-5.fc12
Comment 20 Fedora Update System 2010-05-31 14:21:21 EDT
ruby-1.8.6.399-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 21 Fedora Update System 2010-05-31 14:28:33 EDT
ruby-1.8.6.399-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.