Skip to content

encrypt: copy input before XORKeyStream - #96

Open
team-humaki wants to merge 1 commit into
gorilla:mainfrom
team-humaki:encrypt-copy-before-xor
Open

team-humaki wants to merge 1 commit into
gorilla:mainfrom
team-humaki:encrypt-copy-before-xor

Conversation

@team-humaki

Copy link
Copy Markdown

XORKeyStream was applied in place, so encrypt and decrypt overwrote the caller's slice. Copy the plaintext/ciphertext (and IV) first so those buffers stay intact.

This is the in-place XOR mutation described in gorilla/csrf#201 (csrf encrypts cookies through this package).

XORKeyStream was applied in place, so encrypt/decrypt mutated the
caller's slice. Copy first so plaintext and ciphertext buffers stay intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant