]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
crypto: ccp - Remove user triggerable pr_err calls
authorTom Lendacky <thomas.lendacky@amd.com>
Tue, 10 Dec 2013 16:38:44 +0000 (10:38 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Dec 2013 12:06:22 +0000 (20:06 +0800)
Remove the pr_err calls that are issued during parameter
checking in some AES operations. This will eliminate the
possibility of filling up syslog through these paths.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-crypto-aes-cmac.c
drivers/crypto/ccp/ccp-crypto-aes-xts.c
drivers/crypto/ccp/ccp-crypto-aes.c

index 5b9cd982339d981af59f73a52106259d9ccab0f4..64dd35e291b052ba6a6ba4501322d8c881ed2bb1 100644 (file)
@@ -63,10 +63,8 @@ static int ccp_do_cmac_update(struct ahash_request *req, unsigned int nbytes,
        unsigned int len, need_pad, sg_count;
        int ret;
 
-       if (!ctx->u.aes.key_len) {
-               pr_err("AES key not set\n");
+       if (!ctx->u.aes.key_len)
                return -EINVAL;
-       }
 
        if (nbytes)
                rctx->null_msg = 0;
index d100b48415b656299a41672dec1011bb54ab100b..0237ab58f2427e75b3fb4b61eb505d6d26170bf3 100644 (file)
@@ -125,20 +125,14 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request *req,
        unsigned int unit;
        int ret;
 
-       if (!ctx->u.aes.key_len) {
-               pr_err("AES key not set\n");
+       if (!ctx->u.aes.key_len)
                return -EINVAL;
-       }
 
-       if (req->nbytes & (AES_BLOCK_SIZE - 1)) {
-               pr_err("AES request size is not a multiple of the block size\n");
+       if (req->nbytes & (AES_BLOCK_SIZE - 1))
                return -EINVAL;
-       }
 
-       if (!req->info) {
-               pr_err("AES IV not supplied");
+       if (!req->info)
                return -EINVAL;
-       }
 
        for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++)
                if (!(req->nbytes & (unit_size_map[unit].size - 1)))
index c0befdb2240b2832f1eb430dc5d779e07571c7c7..e46490db0f6326b6f5ee58acc3fdf6a576f60968 100644 (file)
@@ -76,24 +76,18 @@ static int ccp_aes_crypt(struct ablkcipher_request *req, bool encrypt)
        unsigned int iv_len = 0;
        int ret;
 
-       if (!ctx->u.aes.key_len) {
-               pr_err("AES key not set\n");
+       if (!ctx->u.aes.key_len)
                return -EINVAL;
-       }
 
        if (((ctx->u.aes.mode == CCP_AES_MODE_ECB) ||
             (ctx->u.aes.mode == CCP_AES_MODE_CBC) ||
             (ctx->u.aes.mode == CCP_AES_MODE_CFB)) &&
-           (req->nbytes & (AES_BLOCK_SIZE - 1))) {
-               pr_err("AES request size is not a multiple of the block size\n");
+           (req->nbytes & (AES_BLOCK_SIZE - 1)))
                return -EINVAL;
-       }
 
        if (ctx->u.aes.mode != CCP_AES_MODE_ECB) {
-               if (!req->info) {
-                       pr_err("AES IV not supplied");
+               if (!req->info)
                        return -EINVAL;
-               }
 
                memcpy(rctx->iv, req->info, AES_BLOCK_SIZE);
                iv_sg = &rctx->iv_sg;