-
Notifications
You must be signed in to change notification settings - Fork 143
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
Swift 5.2 Crash while calling TSGenerateSymmetricKey, encrypt and decrypt methods. #687
Comments
Hm... That's weird. I just tried the following snippet with 0.13 and it works: let key = TSGenerateSymmetricKey()!
let cellSeal = TSCellSeal(key: key)!
let inputData = "test message".data(using: .utf8)!
let encrypted = try! cellSeal.encrypt(Data())
let decrypted = try! cellSeal.decrypt(encrypted)
assert(decrypted == inputData) Though, this might be some Swift 5.2 issue specifically. Unfortunately, I have only Swift 5 available at the moment 😞 @vixentael, your Xcode is newer, IIRC. Can you please check with Swift 5.2? @hudzanton, just for context, is it something new for 0.13, or 0.12 breaks as well? There is no let key = "test key".data(using: .utf8)!
let cellSeal = TSCellSeal(key: key)!
let inputData = "test message".data(using: .utf8)!
let encrypted = try! cellSeal.wrap(inputData)
let decrypted = try! cellSeal.unwrapData(encrypted) |
@ilammy It worked perfectly in 0.12.0 using wrap, unwrap and generating key on my side. I got this issue after updating to 0.13.0. |
@ilammy sorry for trouble, I updated Xcode and now I don't have any crashes. I will close this issue. |
@hudzanton noooooooooooooo, i've already created a small test project, tested on numerous devices and OS versions, and was going to send you a test project and ask for details :D Couldn't reproduce the crash, thought. I tried using Xcode 11.6 and Xcode-12-beta2. Which Xcode you've updated to? |
@vixentael sorry for trouble =( I was using Xcode 11.6 when I had a crash, then I downloaded Xcode 12-beta3 and installed Xcode tools for Xcode12-beta 3. After that, it doesn't crash on both Xcode 11.6 and Xcode 12-beta3. Thank you for the effort and all work you put in this project! I was really waiting for a 0.13.0 release to get TSGenerateSymmetricKey(). |
@hudzanton thank you for details, and thank you for opening the issue! It was useful for us, as we revisited our Swift/ObjC code base one more time. We'll update test suits and examples to showcase new APIs more.
Thank you! Let your data stay secure 🧡 |
Describe the bug
iOS Application crashes after update to themis 0.13.0 and using new methods TSGenerateSymmetricKey, encrypt and decrypt.
To Reproduce
Steps to reproduce the behavior:
1a. Use let masterKeyData: Data = TSGenerateSymmetricKey()
1b. Use let decryptedData = try cellSeal.decrypt(data)
1c. Use let encryptedData = try cellSeal.encrypt(data)
2. App crashes without any error message poiting out to called themis method.
Expected behavior
1.a returns generated key
1.b returns decryptedData
1.c returns encryptedData
Environment (please complete the following information):
Additional context
Xcode 11.6, Swift 5.2
The text was updated successfully, but these errors were encountered: