Skip to content

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

Merged
tobiasKaminsky merged 1 commit into
nextcloud:masterfrom
ardevd:master
Feb 14, 2018
Merged

Encryption: Get IV directly from the cipher object when encrypting the private key#2154
tobiasKaminsky merged 1 commit into
nextcloud:masterfrom
ardevd:master

Conversation

@ardevd

@ardevd ardevd commented Feb 12, 2018

Copy link
Copy Markdown
Collaborator

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

ardevd commented Feb 12, 2018

Copy link
Copy Markdown
Collaborator Author

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

ardevd commented Feb 12, 2018

Copy link
Copy Markdown
Collaborator Author

Tested on API level 23. Works fine there too.

@AndyScherzinger

Copy link
Copy Markdown
Member

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

@tobiasKaminsky

tobiasKaminsky commented Feb 14, 2018

Copy link
Copy Markdown
Member

👍
Thank you for this great finding! 🎉

Approved with PullApprove

@AndyScherzinger

Copy link
Copy Markdown
Member

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

@ardevd

ardevd commented Feb 15, 2018

Copy link
Copy Markdown
Collaborator Author

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