Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: cpt/des - switch to new verification routines

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ard Biesheuvel and committed by
Herbert Xu
0e1cbe97 a628c5a1

+5 -21
+5 -21
drivers/crypto/cavium/cpt/cptvf_algs.c
··· 7 7 #include <crypto/aes.h> 8 8 #include <crypto/algapi.h> 9 9 #include <crypto/authenc.h> 10 - #include <crypto/des.h> 10 + #include <crypto/internal/des.h> 11 11 #include <crypto/xts.h> 12 12 #include <linux/crypto.h> 13 13 #include <linux/err.h> ··· 322 322 static int cvm_cbc_des3_setkey(struct crypto_ablkcipher *cipher, const u8 *key, 323 323 u32 keylen) 324 324 { 325 - u32 flags = crypto_ablkcipher_get_flags(cipher); 326 - int err; 327 - 328 - err = __des3_verify_key(&flags, key); 329 - if (unlikely(err)) { 330 - crypto_ablkcipher_set_flags(cipher, flags); 331 - return err; 332 - } 333 - 334 - return cvm_setkey(cipher, key, keylen, DES3_CBC); 325 + return verify_ablkcipher_des3_key(cipher, key) ?: 326 + cvm_setkey(cipher, key, keylen, DES3_CBC); 335 327 } 336 328 337 329 static int cvm_ecb_des3_setkey(struct crypto_ablkcipher *cipher, const u8 *key, 338 330 u32 keylen) 339 331 { 340 - u32 flags = crypto_ablkcipher_get_flags(cipher); 341 - int err; 342 - 343 - err = __des3_verify_key(&flags, key); 344 - if (unlikely(err)) { 345 - crypto_ablkcipher_set_flags(cipher, flags); 346 - return err; 347 - } 348 - 349 - return cvm_setkey(cipher, key, keylen, DES3_ECB); 332 + return verify_ablkcipher_des3_key(cipher, key) ?: 333 + cvm_setkey(cipher, key, keylen, DES3_ECB); 350 334 } 351 335 352 336 static int cvm_enc_dec_init(struct crypto_tfm *tfm)