Project

General

Profile

Actions

Bug #4734

closed

[ext/openssl] DSA#sign error

Added by MartinBosslet (Martin Bosslet) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
-
Backport:
[ruby-core:36322]

Description

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

Updated by naruse (Yui NARUSE) over 13 years ago

I can reproduce it with

  • ruby 1.9.3dev (2011-05-18 trunk 31621) [x86_64-freebsd8.2]
  • OpenSSL 0.9.8q 2 Dec 2010"

Updated by nahi (Hiroshi Nakamura) over 13 years ago

  • ruby -v changed from ruby 1.9.3dev (2011-05-17 trunk 31593) [i686-linux] to -

Sorry, I should have aware of this ticket.

Non-DSS1 DSA signing is from openssl 1.0.0. It should work on openssl >= 1.0.0.

Tests in ruby_1_8 branch (test/openssl/test_x509cert.rb) should have
related tests. The tests are synced with jruby-ossl but it's not
merged yet to trunk. Can you merge that? Let me know if I should do
that.

Regards,
// NaHi

Updated by MartinBosslet (Martin Bosslet) over 13 years ago

Thanks Yui for testing!

@nahi (Hiroshi Nakamura): OK, I understand now. I'll try with openssl >= 1.0.0 to see if
it works there.
I can merge the tests from ruby_1_8 to trunk after that, that's OK.

Thanks for your input, both of you!
-Martin

2011/5/19 Hiroshi Nakamura :

Sorry, I should have aware of this ticket.

Non-DSS1 DSA signing is from openssl 1.0.0. It should work on openssl >= 1.0.0.

Tests in ruby_1_8 branch (test/openssl/test_x509cert.rb) should have
related tests. The tests are synced with jruby-ossl but it's not
merged yet to trunk. Can you merge that? Let me know if I should do
that.

Regards,
// NaHi

Updated by MartinBosslet (Martin Bosslet) over 13 years ago

  • Status changed from Assigned to Closed

I merged the tests from 1.8 and added further tests to test_pkey_dsa.rb.

Regards,
Martin

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0