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

Encryption: Get IV directly from the cipher object when encrypting the private key #2154

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

ardevd
Copy link
Collaborator

@ardevd ardevd commented Feb 12, 2018

In Android O and newer (at least) javax.crypto.spec.IvParameterSpec is unsupported. Get the IV directly from the cipher object instead. This has been tested on API level 27 and found to work well. E2E encryption keys can now be stored correctly since the private key can be encrypted successfully.

This fixes #2134 and all the other issues describing the same issue.

…e private key.

In Android O and newer (at least) javax.crypto.spec.IvParameterSpec is unsupported. Get the IV directly from the cipher object instead.
@ardevd
Copy link
Collaborator Author

ardevd commented Feb 12, 2018

Should probably be tested with lower API levels to make sure it works for all of them. Worst case we will have to use a if statement to generate the IV differently newer/older API levels.

@ardevd
Copy link
Collaborator Author

ardevd commented Feb 12, 2018

Tested on API level 23. Works fine there too.

@AndyScherzinger
Copy link
Member

Calling @tobiasKaminsky for e2e, should imho then be backported for 3.0.1

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Feb 14, 2018

👍
Thank you for this great finding! 🎉

Approved with PullApprove

@AndyScherzinger
Copy link
Member

❤️ Thanks a lot for your contribution @ardevd ❤️

@ardevd
Copy link
Collaborator Author

ardevd commented Feb 15, 2018

You're most welcome! Thanks for keeping things open source ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E2E: Unsupported class: class javax.crypto.spec.IvParameterSpec when encrypting the private key.
3 participants