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

Linux. Crash when decrypting: "Fatal error: Can't form Range with upperBound < lowerBound" #73

Open
ksinghal opened this issue Apr 22, 2021 · 1 comment

Comments

@ksinghal
Copy link

ksinghal commented Apr 22, 2021

OS: Linux
OpenSSL Version: 1.1.1

I am using the same exact code on MacOS and on Linux:

guard let decryptedData = try CryptorRSA.createEncrypted(with: data).decrypted(with: privateKey, algorithm: .sha1)?.data

I am attempting to decrypt data with a private key. It works properly on MacOS, but when running on Linux I get a crash with error:

Fatal error: Can't form Range with upperBound < lowerBound: file Swift/Range.swift, line 728

I noticed this is coming from line 697 in Sources/CryptorRSA.swift during the step with the comment "Extract encryptedKey, encryptedData, encryptedIV from data"

@ksinghal ksinghal changed the title Crash on Linux Linux. Crash when decrypting: "Fatal error: Can't form Range with upperBound < lowerBound" Apr 22, 2021
@mbarnach
Copy link
Member

How are you creating the key? And what kind? Some functions are only available on MacOS.

Could you make a simple test that shows the crash? Thanks.

You can also have a look at BlueCryptor and BlueEEC if RSA is not a strong requirement.

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