summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/cavium/nitrox/nitrox_skcipher.c
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2019-05-22 16:08:21 -0400
committerSean Paul <seanpaul@chromium.org>2019-05-22 16:08:21 -0400
commit374ed5429346a021c8e2d26fafce14c5b15dedd0 (patch)
tree70739e93443494993197cc11f41c0fd0a0f3aac0 /drivers/crypto/cavium/nitrox/nitrox_skcipher.c
parent270afb37ae34fc1499d166f6edf4bc472f529d96 (diff)
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9 (diff)
downloadlinux-374ed5429346a021c8e2d26fafce14c5b15dedd0.tar.gz
linux-374ed5429346a021c8e2d26fafce14c5b15dedd0.tar.bz2
linux-374ed5429346a021c8e2d26fafce14c5b15dedd0.zip
Merge drm/drm-next into drm-misc-next
Backmerging 5.2-rc1 to -misc-next for robher Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/crypto/cavium/nitrox/nitrox_skcipher.c')
-rw-r--r--drivers/crypto/cavium/nitrox/nitrox_skcipher.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/crypto/cavium/nitrox/nitrox_skcipher.c b/drivers/crypto/cavium/nitrox/nitrox_skcipher.c
index d4935d6cefdd..7e4a5e69085e 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_skcipher.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_skcipher.c
@@ -257,12 +257,8 @@ static int nitrox_aes_decrypt(struct skcipher_request *skreq)
static int nitrox_3des_setkey(struct crypto_skcipher *cipher,
const u8 *key, unsigned int keylen)
{
- if (keylen != DES3_EDE_KEY_SIZE) {
- crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
- return -EINVAL;
- }
-
- return nitrox_skcipher_setkey(cipher, 0, key, keylen);
+ return unlikely(des3_verify_key(cipher, key)) ?:
+ nitrox_skcipher_setkey(cipher, 0, key, keylen);
}
static int nitrox_3des_encrypt(struct skcipher_request *skreq)