fullsailor / pkcs7

Implements a subset of PKCS#7/Crytpographic Message Syntax (rfc2315, rfc5652)
MIT License
123 stars 201 forks source link

verifySignature: always use the certificate's algorithm #28

Closed mariusae closed 6 years ago

mariusae commented 6 years ago

VerifySignature previously hardcoded x509.SHA1WithRSA as the verification signature. As of Go 1.10, the x509 package verifies that the requested algorithm matches the certificate's public key type. VerifySignature would then fail for certificates with DSA keys, such as AWS's EC2 instance identity documents.

Fix this by always using the certificate's algorithm directly.