Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Mar 2021 20:57:46 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 4ecfdf7b47b2 - stable/13 - armv8crypto: fix AES-XTS regression introduced by ed9b7f44
Message-ID:  <202103072057.127Kvkfk008325@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by gonzo:

URL: https://cgit.FreeBSD.org/src/commit/?id=4ecfdf7b47b2ca6ef038610339a96586d04de5ab

commit 4ecfdf7b47b2ca6ef038610339a96586d04de5ab
Author:     Oleksandr Tymoshenko <gonzo@FreeBSD.org>
AuthorDate: 2021-03-07 20:03:47 +0000
Commit:     Oleksandr Tymoshenko <gonzo@FreeBSD.org>
CommitDate: 2021-03-07 20:41:15 +0000

    armv8crypto: fix AES-XTS regression introduced by ed9b7f44
    
    Initialization of the XTS key schedule was accidentally dropped
    when adding AES-GCM support so all-zero schedule was used instead.
    This rendered previously created GELI partitions unusable.
    This change restores proper XTS key schedule initialization.
    
    Reported by:    Peter Jeremy <peter@rulingia.com>
    MFC after:      immediately
    
    (cherry picked from commit 748be78e60ccc4a26325a636347debb1f7e6749b)
---
 sys/crypto/armv8/armv8_crypto.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c
index 24f6eff5608d..95bb96124323 100644
--- a/sys/crypto/armv8/armv8_crypto.c
+++ b/sys/crypto/armv8/armv8_crypto.c
@@ -305,6 +305,9 @@ armv8_crypto_cipher_setup(struct armv8_crypto_session *ses,
 		aes_v8_set_decrypt_key(key,
 		    keylen * 8, &ses->dec_schedule);
 
+	if (csp->csp_cipher_alg == CRYPTO_AES_XTS)
+		aes_v8_set_encrypt_key(key + keylen, keylen * 8, &ses->xts_schedule);
+
 	if (csp->csp_cipher_alg == CRYPTO_AES_NIST_GCM_16) {
 		memset(H.c, 0, sizeof(H.c));
 		aes_v8_encrypt(H.c, H.c, &ses->enc_schedule);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103072057.127Kvkfk008325>