diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2013-12-10 11:38:44 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-12-20 07:06:22 -0500 |
commit | 369f3dabad95aaa3b04ec390d5489d9d46e51395 (patch) | |
tree | 494d90d88310fe987d9ae659f4697962557a3525 /drivers/crypto | |
parent | d5aa80952aba9071b50a74c8daf7feb1caa2fd8c (diff) |
crypto: ccp - Remove user triggerable pr_err calls
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>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 4 | ||||
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-aes-xts.c | 12 | ||||
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-aes.c | 12 |
3 files changed, 7 insertions, 21 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c index 5b9cd982339d..64dd35e291b0 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c | |||
@@ -63,10 +63,8 @@ static int ccp_do_cmac_update(struct ahash_request *req, unsigned int nbytes, | |||
63 | unsigned int len, need_pad, sg_count; | 63 | unsigned int len, need_pad, sg_count; |
64 | int ret; | 64 | int ret; |
65 | 65 | ||
66 | if (!ctx->u.aes.key_len) { | 66 | if (!ctx->u.aes.key_len) |
67 | pr_err("AES key not set\n"); | ||
68 | return -EINVAL; | 67 | return -EINVAL; |
69 | } | ||
70 | 68 | ||
71 | if (nbytes) | 69 | if (nbytes) |
72 | rctx->null_msg = 0; | 70 | rctx->null_msg = 0; |
diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c index d100b48415b6..0237ab58f242 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-xts.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-xts.c | |||
@@ -125,20 +125,14 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request *req, | |||
125 | unsigned int unit; | 125 | unsigned int unit; |
126 | int ret; | 126 | int ret; |
127 | 127 | ||
128 | if (!ctx->u.aes.key_len) { | 128 | if (!ctx->u.aes.key_len) |
129 | pr_err("AES key not set\n"); | ||
130 | return -EINVAL; | 129 | return -EINVAL; |
131 | } | ||
132 | 130 | ||
133 | if (req->nbytes & (AES_BLOCK_SIZE - 1)) { | 131 | if (req->nbytes & (AES_BLOCK_SIZE - 1)) |
134 | pr_err("AES request size is not a multiple of the block size\n"); | ||
135 | return -EINVAL; | 132 | return -EINVAL; |
136 | } | ||
137 | 133 | ||
138 | if (!req->info) { | 134 | if (!req->info) |
139 | pr_err("AES IV not supplied"); | ||
140 | return -EINVAL; | 135 | return -EINVAL; |
141 | } | ||
142 | 136 | ||
143 | for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++) | 137 | for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++) |
144 | if (!(req->nbytes & (unit_size_map[unit].size - 1))) | 138 | if (!(req->nbytes & (unit_size_map[unit].size - 1))) |
diff --git a/drivers/crypto/ccp/ccp-crypto-aes.c b/drivers/crypto/ccp/ccp-crypto-aes.c index c0befdb2240b..e46490db0f63 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes.c +++ b/drivers/crypto/ccp/ccp-crypto-aes.c | |||
@@ -76,24 +76,18 @@ static int ccp_aes_crypt(struct ablkcipher_request *req, bool encrypt) | |||
76 | unsigned int iv_len = 0; | 76 | unsigned int iv_len = 0; |
77 | int ret; | 77 | int ret; |
78 | 78 | ||
79 | if (!ctx->u.aes.key_len) { | 79 | if (!ctx->u.aes.key_len) |
80 | pr_err("AES key not set\n"); | ||
81 | return -EINVAL; | 80 | return -EINVAL; |
82 | } | ||
83 | 81 | ||
84 | if (((ctx->u.aes.mode == CCP_AES_MODE_ECB) || | 82 | if (((ctx->u.aes.mode == CCP_AES_MODE_ECB) || |
85 | (ctx->u.aes.mode == CCP_AES_MODE_CBC) || | 83 | (ctx->u.aes.mode == CCP_AES_MODE_CBC) || |
86 | (ctx->u.aes.mode == CCP_AES_MODE_CFB)) && | 84 | (ctx->u.aes.mode == CCP_AES_MODE_CFB)) && |
87 | (req->nbytes & (AES_BLOCK_SIZE - 1))) { | 85 | (req->nbytes & (AES_BLOCK_SIZE - 1))) |
88 | pr_err("AES request size is not a multiple of the block size\n"); | ||
89 | return -EINVAL; | 86 | return -EINVAL; |
90 | } | ||
91 | 87 | ||
92 | if (ctx->u.aes.mode != CCP_AES_MODE_ECB) { | 88 | if (ctx->u.aes.mode != CCP_AES_MODE_ECB) { |
93 | if (!req->info) { | 89 | if (!req->info) |
94 | pr_err("AES IV not supplied"); | ||
95 | return -EINVAL; | 90 | return -EINVAL; |
96 | } | ||
97 | 91 | ||
98 | memcpy(rctx->iv, req->info, AES_BLOCK_SIZE); | 92 | memcpy(rctx->iv, req->info, AES_BLOCK_SIZE); |
99 | iv_sg = &rctx->iv_sg; | 93 | iv_sg = &rctx->iv_sg; |