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

bug: subject/issuer hash calculation incompatibility #1037

Open
simhnna opened this issue Jun 15, 2023 · 0 comments
Open

bug: subject/issuer hash calculation incompatibility #1037

simhnna opened this issue Jun 15, 2023 · 0 comments

Comments

@simhnna
Copy link

simhnna commented Jun 15, 2023

https://github.com/digitalbazaar/forge/blob/main/lib/x509.js#L1377 and https://github.com/digitalbazaar/forge/blob/main/lib/x509.js#L1393

vs

https://github.com/digitalbazaar/forge/blob/main/lib/x509.js#L2824

AFAIK the first two use the raw bytes of the attributes while the second uses the string contents of type and value of the attributes

This causes certificates that are directly generated by code and added to a CA to have a different hash than the same certificate after a pem encode/decode operation

Not sure which hash is the correct one

Here are two commits, one adding a failing test and the other fixing the test (but failing the existing hash calculation test) https://github.com/simhnna/forge/tree/failing-test

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

No branches or pull requests

1 participant