]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
aesni: Avoid modifying session keys in hmac_update()
authorMark Johnston <markj@FreeBSD.org>
Tue, 27 Apr 2021 00:04:25 +0000 (20:04 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 26 May 2021 19:36:30 +0000 (15:36 -0400)
commit71c7f71de5789daff5bc6dedba82544fa97eec84
tree09097f099f7bcc52684d6b447e3526297ab94a3a
parent81526c74d9cd16944ca240573680c358a031c989
aesni: Avoid modifying session keys in hmac_update()

Otherwise aesni_process() is not thread-safe for AES+SHA-HMAC
transforms, since hmac_update() updates the caller-supplied key directly
to create the derived key.  Use a buffer on the stack to store a copy of
the key used for computing inner and outer digests.

This is a direct commit to stable/12 as the bug is not present in later
branches.

Approved by: so
Security: EN-21:11.aesni
Reviewed by: kib

(cherry picked from commit 62e32cf9140e6c13663dcd69ec3b3c7ca4579782)
sys/crypto/aesni/aesni.c
sys/crypto/aesni/aesni.h