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

Allow encryption of empty strings #33

Merged
merged 1 commit into from
Apr 9, 2015

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Apr 9, 2015

Running OpenSSL::Cipher#update with an empty string results in an ArgumentError which prevents Fernet from working. This patch only calls #update conditionally, which allows encryption to go through even for an empty string.

Fixes #32.

Running `OpenSSL::Cipher#update` with an empty string results in an
`ArgumentError` which prevents Fernet from working. This patch only
calls `#update` conditionally, which allows encryption to go through
even for an empty string.

Fixes fernet#32.
@hgmnz hgmnz merged commit db6dfa7 into fernet:master Apr 9, 2015
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.

Encrypting an empty string is not allowed
2 participants