crypto: ccp - AES CFB mode is a stream cipher
authorHook, Gary <Gary.Hook@amd.com>
Tue, 14 May 2019 21:53:16 +0000 (21:53 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 23 May 2019 06:01:07 +0000 (14:01 +0800)
CFB mode should be treated as a stream cipher, not block.

Fixes: 63b945091a07 ('crypto: ccp - CCP device driver and interface support')
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-ops.c

index 267a367bd076e45f6edfbc11a434a039be9d8357..3ecadeab919cd0ee90a07f736f89a2cfda19ebeb 100644 (file)
@@ -1,7 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * AMD Cryptographic Coprocessor (CCP) driver
  *
- * Copyright (C) 2013,2018 Advanced Micro Devices, Inc.
+ * Copyright (C) 2013-2019 Advanced Micro Devices, Inc.
  *
  * Author: Tom Lendacky <thomas.lendacky@amd.com>
  * Author: Gary R Hook <gary.hook@amd.com>
@@ -893,8 +894,7 @@ static int ccp_run_aes_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
                return -EINVAL;
 
        if (((aes->mode == CCP_AES_MODE_ECB) ||
-            (aes->mode == CCP_AES_MODE_CBC) ||
-            (aes->mode == CCP_AES_MODE_CFB)) &&
+            (aes->mode == CCP_AES_MODE_CBC)) &&
            (aes->src_len & (AES_BLOCK_SIZE - 1)))
                return -EINVAL;