From: Martin Bosslet <Martin.Bosslet@...>
Date: 2011-05-19T08:03:29+09:00
Subject: [ruby-core:36322] [Ruby 1.9 - Bug #4734][Assigned] [ext/openssl] DSA#sign error


Issue #4734 has been reported by Martin Bosslet.

----------------------------------------
Bug #4734: [ext/openssl] DSA#sign error
http://redmine.ruby-lang.org/issues/4734

Author: Martin Bosslet
Status: Assigned
Priority: Normal
Assignee: Martin Bosslet
Category: ext
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2011-05-17 trunk 31593) [i686-linux]


Hi, 

imo the following should work just fine:

  data = 'Sign me!'
  digest = OpenSSL::Digest::SHA256.new
  pkey = OpenSSL::PKey::DSA.new(512)
  signature = pkey.sign(digest, data)

At least it does for PKey::RSA. But the above produces (OpenSSL 0.9.8k):

  in `sign': wrong public key type (OpenSSL::PKey::PKeyError)

I'll look into it - but I'd appreciate if someone could please
verify that this is really a bug and try to reproduce the error?

Regards,
Martin


  


-- 
http://redmine.ruby-lang.org