-
Notifications
You must be signed in to change notification settings - Fork 277
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
[bug] The MinSize
specified for ChaCha20Poly1305 in crypto is incorrect
#4395
Labels
Comments
DCNick3
added a commit
to DCNick3/iroha
that referenced
this issue
Mar 28, 2024
Signed-off-by: Nikita Strygin <[email protected]>
1 task
Erigara
pushed a commit
to DCNick3/iroha
that referenced
this issue
Mar 29, 2024
Signed-off-by: Nikita Strygin <[email protected]>
DCNick3
added a commit
that referenced
this issue
Mar 29, 2024
Signed-off-by: Nikita Strygin <[email protected]>
DCNick3
added a commit
to DCNick3/iroha
that referenced
this issue
Apr 1, 2024
Signed-off-by: Nikita Strygin <[email protected]>
DCNick3
added a commit
to DCNick3/iroha
that referenced
this issue
Apr 1, 2024
This allows to pass mock time sources to parts of iroha Signed-off-by: Nikita Strygin <[email protected]>
DCNick3
added a commit
to DCNick3/iroha
that referenced
this issue
Apr 1, 2024
… time source Signed-off-by: Nikita Strygin <[email protected]>
DCNick3
added a commit
to DCNick3/iroha
that referenced
this issue
Apr 1, 2024
Signed-off-by: Nikita Strygin <[email protected]>
Fixed in #4396 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
(identified by @Erigara)
When doing
impl Encryptor for ChaCha20Poly1305
iniroha_crypto
, we currently specifyU36
as aMinSize
(which is used to error out if a message too short is passed to the decryptor).This, however, is incorrect. In actuality, the shortest possible message we can have is 28 bytes. Here's a breakdown:
ChaChaPoly1305
outputs alen(input) + 16
ciphertext (same length as input + 128-bit tag from Poly1305); see https://www.rfc-editor.org/rfc/rfc8439#section-2.8Encryptor
prepends it with a 96-bit (12 bytes) nonce0 + 16 + 12 = 28
This results in iroha crashing when receiving short messages.
test:
The text was updated successfully, but these errors were encountered: