lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOtvUMcmiKF6B3bM3T4mwNMO5xhXV_MFrJJKQZu+SP6wk3bFYA@mail.gmail.com>
Date:   Mon, 22 Jan 2018 09:08:16 +0200
From:   Gilad Ben-Yossef <gilad@...yossef.com>
To:     Stephan Mueller <smueller@...onox.de>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Ofir Drang <ofir.drang@....com>,
        Linux kernel mailing list <linux-kernel@...r.kernel.org>,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
        devel@...verdev.osuosl.org
Subject: Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

On Thu, Jan 11, 2018 at 12:03 PM, Stephan Mueller <smueller@...onox.de> wrote:
> Am Donnerstag, 11. Januar 2018, 10:17:10 CET schrieb Gilad Ben-Yossef:
>
> Hi Gilad,
>
>> +     // verify weak keys
>> +     if (ctx_p->flow_mode == S_DIN_to_DES) {
>> +             if (!des_ekey(tmp, key) &&
>> +                 (crypto_tfm_get_flags(tfm) & CRYPTO_TFM_REQ_WEAK_KEY)) {
>> +                     tfm->crt_flags |= CRYPTO_TFM_RES_WEAK_KEY;
>> +                     dev_dbg(dev, "weak DES key");
>> +                     return -EINVAL;
>> +             }
>> +     }
>> +     if (ctx_p->cipher_mode == DRV_CIPHER_XTS &&
>> +         xts_check_key(tfm, key, keylen)) {
>> +             dev_dbg(dev, "weak XTS key");
>> +             return -EINVAL;
>> +     }
>> +     if (ctx_p->flow_mode == S_DIN_to_DES &&
>> +         keylen == DES3_EDE_KEY_SIZE &&
>> +         cc_verify_3des_keys(key, keylen)) {
>> +             dev_dbg(dev, "weak 3DES key");
>> +             return -EINVAL;
>> +     }
>
> For the DES key, wouldn't it make sense to use __des3_ede_setkey?
>
> Note, I would plan to release a patch for review to change that function to
> disallow key1 == key2 or key1 == key3 or key2 == key3 in FIPS mode.

I took your advise and did just that in v2.

Thanks for the review!

Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ