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

Throw on empty passphrase in encryptKey and SecretKeyPacket.encrypt #1508

Merged
merged 1 commit into from Mar 22, 2022

Conversation

larabr
Copy link
Collaborator

@larabr larabr commented Mar 22, 2022

Breaking change: openpgp.encryptKey will now throw if an empty string is given as passphrase. The operation used to succeed, but the resulting key was left in an inconsistent state, and e.g. serialization would not be possible.

Non-breaking changes:

  • options.passphrase in generateKey and reformatKey now defaults to undefined instead of ''. Passing '' will not throw for now, but this might change in the future to align with the encryptKey behaviour.
  • In TS, add GenerateKeyOptions as alias of KeyOptions, to clarify its scope.

@larabr larabr requested a review from twiss March 22, 2022 13:40
@larabr larabr merged commit 4713282 into openpgpjs:main Mar 22, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants