Bug 559158 - hexdigest method missing in ruby-libs-1.8.6.383-6
Summary: hexdigest method missing in ruby-libs-1.8.6.383-6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ruby
Version: 12
Hardware: All
OS: Linux
low
urgent
Target Milestone: ---
Assignee: Jeroen van Meeuwen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 559234
TreeView+ depends on / blocked
 
Reported: 2010-01-27 10:12 UTC by James Turnbull
Modified: 2010-05-31 18:28 UTC (History)
6 users (show)

Fixed In Version: ruby-1.8.6.399-5.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 559234 (view as bug list)
Environment:
Last Closed: 2010-05-31 18:21:28 UTC


Attachments (Terms of Use)

Description James Turnbull 2010-01-27 10:12:26 UTC
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 10:39:56 UTC
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 12:41:28 UTC
Hmm, I wonder what has changed here

Comment 3 Mamoru TASAKA 2010-01-27 13:02:57 UTC
(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 13:09:05 UTC
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 13:11:44 UTC
(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 13:19:11 UTC
I've confirmed this call works fine on OSX, Ubuntu Karmic and Debian Lenny.

Comment 7 James Turnbull 2010-01-27 13:29:36 UTC
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 13:59:08 UTC
Well, for now I guess this is NOTABUG for 1.8.6.x ruby.

Comment 9 Jeroen van Meeuwen 2010-01-27 14:26:01 UTC
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 16:26:26 UTC
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 16:29:44 UTC
(Once re-retagging -7.fc13, not -8.fc13)

Comment 12 Mamoru TASAKA 2010-01-27 16:34:05 UTC
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 06:46:35 UTC
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-03 04:48:36 UTC
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 18:03:48 UTC
Would would try 1.8.6.399-5?

Comment 16 Mamoru TASAKA 2010-05-18 18:07:00 UTC
(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-19 03:43:33 UTC
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-19 03:44:32 UTC
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 19:12:56 UTC
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 18:21:21 UTC
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 18:28:33 UTC
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.