Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 559234

Summary: hexdigest method missing in ruby-libs-1.8.5-5.el5_3.7
Product: Red Hat Enterprise Linux 5 Reporter: Jeroen van Meeuwen <vanmeeuwen+fedora>
Component: rubyAssignee: Vít Ondruch <vondruch>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: urgent Docs Contact:
Priority: low    
Version: 5.4CC: james, jeremy, mtasaka, tagoh, vanmeeuwen+fedora
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 559158 Environment:
Last Closed: 2011-10-11 10:54:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 559158    
Bug Blocks:    
Attachments:
Description Flags
Patch applied to ruby-1.8.6.388 in Fedora none

Description Jeroen van Meeuwen 2010-01-27 14:27:49 UTC
Created attachment 387090 [details]
Patch applied to ruby-1.8.6.388 in Fedora

+++ This bug was initially created as a clone of Bug #559158 +++

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.

--- Additional comment from james on 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

--- Additional comment from kanarip on 2010-01-27 07:41:28 EST ---

Hmm, I wonder what has changed here

--- Additional comment from mtasaka.u-tokyo.ac.jp on 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?

--- Additional comment from james on 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

--- Additional comment from james on 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.

--- Additional comment from james on 2010-01-27 08:19:11 EST ---

I've confirmed this call works fine on OSX, Ubuntu Karmic and Debian Lenny.

--- Additional comment from james on 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

--- Additional comment from mtasaka.u-tokyo.ac.jp on 2010-01-27 08:59:08 EST ---

Well, for now I guess this is NOTABUG for 1.8.6.x ruby.

--- Additional comment from kanarip on 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 1 Jeroen van Meeuwen 2010-01-27 14:36:24 UTC
Note that this is a new thing in ruby > 1.8.7, but required for future versions of Puppet from EPEL. Please let me know if Red Hat's update policies allow this kind of modifications to a stable package, or whether we have to look at other means to make Puppet compatible with EL-5

Comment 2 Vít Ondruch 2011-10-11 10:54:21 UTC
Hi Jeroen,

Thank you for your report. However, I am sorry but I am closing this issue as NOTABUG, since I see no reason why backport such patch because:

1) This feature was never part of Ruby 1.8.5
2) RHEL 5 ships Puppet which presumable works with RHEL 5's Ruby