Skip to content

crypto/x509: does not implement other hash algorithms then SHA1WithRSA #988

Description

@gopherbot

by jdnurmi:

crypto/x509 does not actually use any algorithms but SHA1WithRSA, and any attempt to
create or validate one will fail.

I've attached a patch that expands its capabilities to include RSA+MD5,SHA256,384 &
512.

It is a breaking patch, in that anyone using CreateCertificate without having specified
SignatureAlgorithm will get an error.

It's a rough patch that just implements that bare functionality (and test fixes).  I am
completely open to fixing this for style or functionality as needed, or you can just run
with it;  I have verified go can verify its own generated certs, and that openSSL can
parse them -- though I've not done extensive validation tests.

I'm also by no means a crypto expert, but the places I needed to patch seemed pretty
straight forward.

Attachments:

  1. x509-patch.1 (4480 bytes)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions