svn commit: r213166 - head/sys/crypto/aesni

Pawel Jakub Dawidek pjd at FreeBSD.org
Sat Sep 25 10:32:52 UTC 2010


Author: pjd
Date: Sat Sep 25 10:32:52 2010
New Revision: 213166
URL: http://svn.freebsd.org/changeset/base/213166

Log:
  Fix two copy&paste bugs.
  
  MFC after:	2 weeks

Modified:
  head/sys/crypto/aesni/aesni_wrap.c

Modified: head/sys/crypto/aesni/aesni_wrap.c
==============================================================================
--- head/sys/crypto/aesni/aesni_wrap.c	Sat Sep 25 10:32:04 2010	(r213165)
+++ head/sys/crypto/aesni/aesni_wrap.c	Sat Sep 25 10:32:52 2010	(r213166)
@@ -232,7 +232,7 @@ aesni_cipher_setup_common(struct aesni_s
 
 	aesni_set_enckey(key, ses->enc_schedule, ses->rounds);
 	aesni_set_deckey(ses->enc_schedule, ses->dec_schedule, ses->rounds);
-	if (ses->algo == CRYPTO_AES_XTS)
+	if (ses->algo == CRYPTO_AES_CBC)
 		arc4rand(ses->iv, sizeof(ses->iv), 0);
 	else /* if (ses->algo == CRYPTO_AES_XTS) */ {
 		aesni_set_enckey(key + keylen / 16, ses->xts_schedule,
@@ -306,7 +306,7 @@ aesni_cipher_process(struct aesni_sessio
 			aesni_decrypt_cbc(ses->rounds, ses->dec_schedule,
 			    enccrd->crd_len, buf, ses->iv);
 		} else /* if (ses->algo == CRYPTO_AES_XTS) */ {
-			aesni_decrypt_xts(ses->rounds, ses->enc_schedule,
+			aesni_decrypt_xts(ses->rounds, ses->dec_schedule,
 			    ses->xts_schedule, enccrd->crd_len, buf, buf,
 			    ses->iv);
 		}


More information about the svn-src-all mailing list