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

Test need for bitstring compression #2

Open
kezike opened this issue Feb 22, 2023 · 2 comments
Open

Test need for bitstring compression #2

kezike opened this issue Feb 22, 2023 · 2 comments

Comments

@kezike
Copy link
Collaborator

kezike commented Feb 22, 2023

Problem: Address FIXME comment about potentially moving leading zeros for bitstring compression

Reference: Comment from PR #1

@kezike
Copy link
Collaborator Author

kezike commented Feb 28, 2023

Hi @dlongley, could you elaborate on this FIXME comment? Are you suggesting that we somehow exploit the fact that the first byte of all public and secret PKCS8 and SPKI prefixes is 48, which only requires 6 bits?

@dlongley
Copy link
Member

@kezike,

could you elaborate on this FIXME comment?

I probably should have said "may need to remove any leading zeros for bitstring compression", not "move".

Are you suggesting that we somehow exploit the fact that the first byte of all public and secret PKCS8 and SPKI prefixes is 48, which only requires 6 bits?

No, nothing that exotic :). IIRC, the issue was related to differences in implementations and how they handle possible leading zeros in key material. At the time I was writing the code there were some differences in implementations, e.g., perhaps some would export keys that removed the leading zeros and others would not. I think I found that, however, all the implementations I was able to test could import zero-padded keys, so I just normalized the code to do that. I was not able to test any WebKit browsers (like Safari) to see if there was any issue with this. Ideally there is no additional complexity needed in the code.

So, I'd recommend just removing the FIXME -- and getting some testing on Safari. If that works, we can close the issue.

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

2 participants