Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Better error message for wrong encoding#22

Open
ankane wants to merge 1 commit intomiscreant:developfrom
ankane:error_message
Open

Better error message for wrong encoding#22
ankane wants to merge 1 commit intomiscreant:developfrom
ankane:error_message

Conversation

@ankane
Copy link
Copy Markdown

@ankane ankane commented Dec 14, 2020

Hi, thanks for this neat library! This improves the error message when the ciphertext has the wrong encoding. The current message is IV must be Encoding::BINARY, which makes it seem like the nonce instead of the ciphertext.

	3: from /Users/andrew/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/aead.rb:90:in `open'
	2: from /Users/andrew/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/aes/siv.rb:71:in `open'
	1: from /Users/andrew/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/internals/aes/ctr.rb:31:in `encrypt'
/Users/user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/miscreant-0.3.0/lib/miscreant/internals/util.rb:64:in `validate_bytestring': IV must be Encoding::BINARY (ArgumentError)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant