You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(because it fails to create the privateKey - returns nil)
Proposed Solution
It appears the issue (based on code comments) is that it is stripping the first 26 bytes on any key type (public or private), but should ONLY strip the bytes for a private key.
So, making a change to only strip if the type is private.
Will get a PR out - assuming that is the correct fix.
The text was updated successfully, but these errors were encountered:
LowAmmo
added a commit
to LowAmmo/BlueRSA
that referenced
this issue
Feb 5, 2025
Getting a Unit Test Failure when running on Xcode 15 and Xcode 16, targeting the iPhone Simulator or the Mac.
BlueRSA/Tests/CryptorRSATests/CryptorRSATests.swift
Line 793 in b70be8c
The specific error that is thrown from the
CryptorRSA.createPublicKey()
method is:The actual failing API is the call to
SecKeyCreateWithData
BlueRSA/Sources/CryptorRSA/CryptorRSAUtilities.swift
Line 145 in b70be8c
The key line seems to be where we are stripping the first 27 bytes due to the 26th byte being
0x30
-BlueRSA/Sources/CryptorRSA/CryptorRSAUtilities.swift
Line 225 in b70be8c
(not advancing 26 bytes there allows the test to pass, however then a different test fails -
test_private_initWithPKCS8
BlueRSA/Tests/CryptorRSATests/CryptorRSATests.swift
Line 299 in b70be8c
(because it fails to create the privateKey - returns nil)
Proposed Solution
It appears the issue (based on code comments) is that it is stripping the first 26 bytes on any key type (public or private), but should ONLY strip the bytes for a private key.
So, making a change to only strip if the type is private.
Will get a PR out - assuming that is the correct fix.
The text was updated successfully, but these errors were encountered: