OSDN Git Service

staging: ccree: register setkey for none hash macs
authorGilad Ben-Yossef <gilad@benyossef.com>
Sun, 25 Jun 2017 07:47:20 +0000 (10:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jun 2017 14:29:15 +0000 (16:29 +0200)
commitc51831be99e13f117721d6e1908d12849e31cab9
tree56b0f6064f4c2883de3308fbe497c55e9f549469
parent454527d0d94f49f96d893e6aa6d6df1b90f2a45f
staging: ccree: register setkey for none hash macs

The original ccree driver was registering a useless setkey
method even for non-MAC hash transformations. Somewhere
around v4.9 a check was added that failed hash operations
if a setkey method was registered but was not called,
so during the initial upstream port code was added to
only register the setkey method for MAC type hash transform.

Unfortunately, the ccree driver also registers non-hash based
MAC transforms and the code had a logic error that stopped
it registering a setkey callback even for those, thus rendering
them useless.

This commit fixes the logic mistake, thus correctly registering
a setkey method only for MAC transformations, leaving it out
for non-MAC ones, whether they are hash based on not.

Fixes: 50cfbbb7e627 ("staging: ccree: add ahash support").

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ccree/ssi_hash.c