omap-des.c (23d19ba06b9c5614d6457f5fed349ec8f6d4dac9) | omap-des.c (231baecdef7a906579925ccf1bd45aa734f32320) |
---|---|
1/* 2 * Support for OMAP DES and Triple DES HW acceleration. 3 * 4 * Copyright (c) 2013 Texas Instruments Incorporated 5 * Author: Joel Fernandes <joelf@ti.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as published --- 648 unchanged lines hidden (view full) --- 657 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); 658 659 if (keylen != DES_KEY_SIZE && keylen != (3*DES_KEY_SIZE)) 660 return -EINVAL; 661 662 pr_debug("enter, keylen: %d\n", keylen); 663 664 /* Do we need to test against weak key? */ | 1/* 2 * Support for OMAP DES and Triple DES HW acceleration. 3 * 4 * Copyright (c) 2013 Texas Instruments Incorporated 5 * Author: Joel Fernandes <joelf@ti.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as published --- 648 unchanged lines hidden (view full) --- 657 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); 658 659 if (keylen != DES_KEY_SIZE && keylen != (3*DES_KEY_SIZE)) 660 return -EINVAL; 661 662 pr_debug("enter, keylen: %d\n", keylen); 663 664 /* Do we need to test against weak key? */ |
665 if (tfm->crt_flags & CRYPTO_TFM_REQ_WEAK_KEY) { | 665 if (tfm->crt_flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS) { |
666 u32 tmp[DES_EXPKEY_WORDS]; 667 int ret = des_ekey(tmp, key); 668 669 if (!ret) { 670 tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY; 671 return -EINVAL; 672 } 673 } --- 494 unchanged lines hidden --- | 666 u32 tmp[DES_EXPKEY_WORDS]; 667 int ret = des_ekey(tmp, key); 668 669 if (!ret) { 670 tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY; 671 return -EINVAL; 672 } 673 } --- 494 unchanged lines hidden --- |