Source
655
655
{
656
656
struct omap_des_ctx *ctx = crypto_ablkcipher_ctx(cipher);
657
657
struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher);
658
658
659
659
if (keylen != DES_KEY_SIZE && keylen != (3*DES_KEY_SIZE))
660
660
return -EINVAL;
661
661
662
662
pr_debug("enter, keylen: %d\n", keylen);
663
663
664
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
666
u32 tmp[DES_EXPKEY_WORDS];
667
667
int ret = des_ekey(tmp, key);
668
668
669
669
if (!ret) {
670
670
tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY;
671
671
return -EINVAL;
672
672
}
673
673
}
674
674
675
675
memcpy(ctx->key, key, keylen);