Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

Fix incorrect padding for messages smaller DEFAULT_PADDING_LENGTH - #414

Open
HarmlessEvil wants to merge 1 commit into
MetaMask:mainfrom
HarmlessEvil:fix/invalid-padding
Open

HarmlessEvil wants to merge 1 commit into
MetaMask:mainfrom
HarmlessEvil:fix/invalid-padding

Conversation

@HarmlessEvil

Copy link
Copy Markdown

We encountered an issue when encrypting messages with size that is smaller than DEFAULT_PADDING_LENGTH by NACL_EXTRA_BYTES. In this scenario, the current implementation uses a negative value for padding. A test is added demonstrating such behavior.

I consider the solution to be backward-compatible and only to improve the function because it will accept a wider range of inputs regarding their JSON-encoded length.

This branch has not been deployed

No deployments
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