Bug 559158
| Summary: | hexdigest method missing in ruby-libs-1.8.6.383-6 | |||
|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | James Turnbull <james> | |
| Component: | ruby | Assignee: | Jeroen van Meeuwen <vanmeeuwen+fedora> | |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | low | |||
| Version: | 12 | CC: | amarecek, jeremy, mtasaka, tagoh, thiagocsf, vanmeeuwen+fedora | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| 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 18:21:28 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: | ||||
| Bug Blocks: | 559234 | |||
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 Hmm, I wonder what has changed here (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? 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
(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. I've confirmed this call works fine on OSX, Ubuntu Karmic and Debian Lenny. Which are: OSX: ruby 1.8.7 (2008-08-11 patchlevel 72) Lenny: 1.8.7.72-3lenny1 Ubuntu: 1.8.7.174-1ubuntu1 Well, for now I guess this is NOTABUG for 1.8.6.x ruby. 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>
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) (Once re-retagging -7.fc13, not -8.fc13) Now the latest dist-f13 ruby is surely ruby-1.8.6.388-7.fc13. Sorry for sending multiple noise. 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"
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' (...) Would would try 1.8.6.399-5? (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 ) 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 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 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 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. 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. |
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.