Skip to content

Commit d0c3bcd

Browse files
committed
Merge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull crypto library fix from Eric Biggers: "Fix missing zeroization of the ChaCha state" * tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: lib/crypto: chacha: Zeroize permuted_state before it leaves scope
2 parents f1b24d8 + e504682 commit d0c3bcd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/crypto/chacha-block-generic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ void chacha_block_generic(struct chacha_state *state,
8787
&out[i * sizeof(u32)]);
8888

8989
state->x[12]++;
90+
91+
chacha_zeroize_state(&permuted_state);
9092
}
9193
EXPORT_SYMBOL(chacha_block_generic);
9294

@@ -110,5 +112,7 @@ void hchacha_block_generic(const struct chacha_state *state,
110112

111113
memcpy(&out[0], &permuted_state.x[0], 16);
112114
memcpy(&out[4], &permuted_state.x[12], 16);
115+
116+
chacha_zeroize_state(&permuted_state);
113117
}
114118
EXPORT_SYMBOL(hchacha_block_generic);

0 commit comments

Comments
 (0)