Feature #4412
[ext/openssl] Create Digest by OID
Description
=begin
Currently it is not possible to create a Digest instance by using
the OID instead of the name (sn or ln).
oid = OpenSSL::ASN1::ObjectId.new('SHA1')
digest = OpenSSL::ASN1::Digest.new(oid.oid)
=> Unsupported digest algorithm (1.3.14.3.2.26).
This is counter-intuitive, since the only thing that is always
available in the case of object identifiers is the numeric oid,
sn or ln are not always present. Since sn and ln are also quite
error-prone (spelling), I'd like to suggest to have all three possibilities
for instantiating a Digest: by sn, by ln and by oid.
I included a patch and a test to support this behaviour.
Regards,
Martin
=end
Files
Associated revisions
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
History
Updated by MartinBosslet (Martin Bosslet) over 8 years ago
- Assignee set to MartinBosslet (Martin Bosslet)
Updated by MartinBosslet (Martin Bosslet) over 8 years ago
- Status changed from Open to Assigned
Updated by Anonymous over 8 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r32040.
Martin, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- ext/openssl/ossl_digest.c: allow Digests to be created by sn, ln or oid.
- test/openssl/test_digest.rb: add tests for this. [Ruby 1.9 - Feature #4412] [ruby-core:35319]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e