]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
geli: split the initalization of HMAC
authorMariusz Zaborski <oshogbo@FreeBSD.org>
Wed, 8 Feb 2023 16:41:06 +0000 (08:41 -0800)
committerGordon Tetlow <gordon@FreeBSD.org>
Wed, 8 Feb 2023 18:06:31 +0000 (10:06 -0800)
commit98933c7013a5c6ef5c0fdde8488b32bb78af23c6
tree0e6996df76f1232aae44be2791926c959f06f4a5
parentf3e20eb8d8f0b87ae828741c48e9ebd7913086ac
geli: split the initalization of HMAC

GELI allows to read a user key from a standard input.
However if user initialize multiple providers at once, the standard
input will be empty for the second and next providers.
This caused GELI to encrypt a master key with an empty key file.

This commits initialize the HMAC with the key file, and then reuse the
finalized structure to generate different encryption keys for different
providers.

Reported by: Nathan Dorfman
Tested by: philip
Approved by: so
Security: FreeBSD-SA-23:01.geli
Security: CVE-2023-0751

(cherry picked from commit 5fff09660e06a66bed6482da9c70df328e16bbb6)
(cherry picked from commit 88bb08452ee3bbf67ad701a4909bbee6e8b200a6)
lib/geom/eli/geom_eli.c