Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfc4055 missing *WithRSAEncryption Algorithm Identifiers #137

Open
gareththered opened this issue Jul 12, 2020 · 2 comments · Fixed by inexio/pyasn1-modules#17
Open

rfc4055 missing *WithRSAEncryption Algorithm Identifiers #137

gareththered opened this issue Jul 12, 2020 · 2 comments · Fixed by inexio/pyasn1-modules#17

Comments

@gareththered
Copy link

The rfc4055 module has identifiers for raw sha224 to sha512, but none for the withRSAEncryption variants.

It has the following, which is discussed in the 5th paragraph of RFC 4055 Section 5:

sha256Identifier = rfc5280.AlgorithmIdentifier()
sha256Identifier['algorithm'] = id_sha256
sha256Identifier['parameters'] = univ.Null("")

But it doesn't have, the following which is discussed in the subsequent paragraphs of Section 5 of the RFC:

sha256WithRSAEncryptionIdentifier = rfc5280.AlgorithmIdentifier()
sha256WithRSAEncryptionIdentifier['algorithm'] = sha256WithRSAEncryption
sha256WithRSAEncryptionIdentifier['parameters'] = univ.Null("")

The same goes for sha224, sha384 and sha512.

@russhousley
Copy link
Contributor

Only the OIDs are included in the ASN.1 module in Section 6, which was used to make this module.

The sha224, sha384, and sha256 identifiers are in the module:

sha1Identifier = rfc5280.AlgorithmIdentifier()
sha1Identifier['algorithm'] = id_sha1
sha1Identifier['parameters'] = univ.Null("")

sha224Identifier = rfc5280.AlgorithmIdentifier()
sha224Identifier['algorithm'] = id_sha224
sha224Identifier['parameters'] = univ.Null("")

sha256Identifier = rfc5280.AlgorithmIdentifier()
sha256Identifier['algorithm'] = id_sha256
sha256Identifier['parameters'] = univ.Null("")

sha384Identifier = rfc5280.AlgorithmIdentifier()
sha384Identifier['algorithm'] = id_sha384
sha384Identifier['parameters'] = univ.Null("")

sha512Identifier = rfc5280.AlgorithmIdentifier()
sha512Identifier['algorithm'] = id_sha512
sha512Identifier['parameters'] = univ.Null("")

@russhousley
Copy link
Contributor

It seem that this repository is not being maintained any more. I have made recent additions to https://github.com/inexio/pyasn1-modules.

For your convenience, I will add these in that repository:

sha224WithRSAEncryptionIdentifier = rfc5280.AlgorithmIdentifier()
sha224WithRSAEncryptionIdentifier['algorithm'] = sha224WithRSAEncryption
sha224WithRSAEncryptionIdentifier['parameters'] = univ.Null("")

sha256WithRSAEncryptionIdentifier = rfc5280.AlgorithmIdentifier()
sha256WithRSAEncryptionIdentifier['algorithm'] = sha256WithRSAEncryption
sha256WithRSAEncryptionIdentifier['parameters'] = univ.Null("")

sha384WithRSAEncryptionIdentifier = rfc5280.AlgorithmIdentifier()
sha384WithRSAEncryptionIdentifier['algorithm'] = sha384WithRSAEncryption
sha384WithRSAEncryptionIdentifier['parameters'] = univ.Null("")

sha512WithRSAEncryptionIdentifier = rfc5280.AlgorithmIdentifier()
sha512WithRSAEncryptionIdentifier['algorithm'] = sha512WithRSAEncryption
sha512WithRSAEncryptionIdentifier['parameters'] = univ.Null("")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants