PERFORCE change 1201689 for review
John-Mark Gurney
jmg at FreeBSD.org
Thu Oct 16 18:31:54 UTC 2014
http://p4web.freebsd.org/@@1201689?ac=10
Change 1201689 by jmg at jmg_carbon2 on 2014/10/16 18:31:41
switch if statements around so that we don't hit a NULL deref...
add comment that _ICM is the same for both encryption and
decryption...
This is part of the results from reviewing stage 2...
Submitted by: Mike Hamburg
Sponsored by: FreeBSD Foundation
Sponsored by: Netgate
Affected files ...
.. //depot/projects/opencrypto/sys/crypto/aesni/aesni.c#10 edit
Differences ...
==== //depot/projects/opencrypto/sys/crypto/aesni/aesni.c#10 (text+ko) ====
@@ -332,14 +332,14 @@
}
}
- /* CBC & XTS can only handle full blocks for now */
- if ((enccrd->crd_alg == CRYPTO_AES_CBC || enccrd->crd_alg ==
- CRYPTO_AES_XTS) && (enccrd->crd_len % AES_BLOCK_LEN) != 0) {
+ if (enccrd == NULL || (needauth && authcrd == NULL)) {
error = EINVAL;
goto out;
}
- if (enccrd == NULL || (needauth && authcrd == NULL)) {
+ /* CBC & XTS can only handle full blocks for now */
+ if ((enccrd->crd_alg == CRYPTO_AES_CBC || enccrd->crd_alg ==
+ CRYPTO_AES_XTS) && (enccrd->crd_len % AES_BLOCK_LEN) != 0) {
error = EINVAL;
goto out;
}
@@ -552,6 +552,7 @@
enccrd->crd_len, buf, ses->iv);
break;
case CRYPTO_AES_ICM:
+ /* encryption & decryption are the same */
aesni_encrypt_icm(ses->rounds, ses->enc_schedule,
enccrd->crd_len, buf, buf, ses->iv);
break;
More information about the p4-projects
mailing list