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: Key creation failure if byte 27 of key data is 0x30 #52

Open
djones6 opened this issue Oct 1, 2019 · 0 comments
Open

Bug: Key creation failure if byte 27 of key data is 0x30 #52

djones6 opened this issue Oct 1, 2019 · 0 comments

Comments

@djones6
Copy link
Contributor

djones6 commented Oct 1, 2019

If you try to create an RSA key with data where byte 27 happens to be 0x30, key creation fails.

I tracked this down to an unsafe assumption in the stripX509CertificateHeader function:
https://github.com/IBM-Swift/BlueRSA/blob/master/Sources/CryptorRSA/CryptorRSAUtilities.swift#L228
which is called here:
https://github.com/IBM-Swift/BlueRSA/blob/master/Sources/CryptorRSA/CryptorRSAKey.swift#L624

I found this while debugging intermittent test failures in the CI. The symptom on Linux is a crash because we don't handle a failure from OpenSSL properly - I have a fix for that in the issue.swift51 branch, but I haven't figured out what to do about this problem yet.

djones6 added a commit that referenced this issue Oct 2, 2019
dannys42 added a commit that referenced this issue Nov 19, 2024
* ci: Update to Swift 5.1

* Handle failure of d2i_PUBKEY_bio

* Add test for #52

---------

Co-authored-by: Danny Sung <danny@dannysung.com>
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