Commit c7b31c88 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Herbert Xu

crypto: ccree - turn errors to debug msgs

We have several loud error log messages that are already reported
via the normal return code mechanism and produce a lot of noise
when the new testmgr extra test are enabled. Turn these into
debug only messages
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2a6bc713
...@@ -385,13 +385,13 @@ static int validate_keys_sizes(struct cc_aead_ctx *ctx) ...@@ -385,13 +385,13 @@ static int validate_keys_sizes(struct cc_aead_ctx *ctx)
return -EINVAL; return -EINVAL;
break; break;
default: default:
dev_err(dev, "Invalid auth_mode=%d\n", ctx->auth_mode); dev_dbg(dev, "Invalid auth_mode=%d\n", ctx->auth_mode);
return -EINVAL; return -EINVAL;
} }
/* Check cipher key size */ /* Check cipher key size */
if (ctx->flow_mode == S_DIN_to_DES) { if (ctx->flow_mode == S_DIN_to_DES) {
if (ctx->enc_keylen != DES3_EDE_KEY_SIZE) { if (ctx->enc_keylen != DES3_EDE_KEY_SIZE) {
dev_err(dev, "Invalid cipher(3DES) key size: %u\n", dev_dbg(dev, "Invalid cipher(3DES) key size: %u\n",
ctx->enc_keylen); ctx->enc_keylen);
return -EINVAL; return -EINVAL;
} }
...@@ -399,7 +399,7 @@ static int validate_keys_sizes(struct cc_aead_ctx *ctx) ...@@ -399,7 +399,7 @@ static int validate_keys_sizes(struct cc_aead_ctx *ctx)
if (ctx->enc_keylen != AES_KEYSIZE_128 && if (ctx->enc_keylen != AES_KEYSIZE_128 &&
ctx->enc_keylen != AES_KEYSIZE_192 && ctx->enc_keylen != AES_KEYSIZE_192 &&
ctx->enc_keylen != AES_KEYSIZE_256) { ctx->enc_keylen != AES_KEYSIZE_256) {
dev_err(dev, "Invalid cipher(AES) key size: %u\n", dev_dbg(dev, "Invalid cipher(AES) key size: %u\n",
ctx->enc_keylen); ctx->enc_keylen);
return -EINVAL; return -EINVAL;
} }
...@@ -1559,7 +1559,7 @@ static int config_ccm_adata(struct aead_request *req) ...@@ -1559,7 +1559,7 @@ static int config_ccm_adata(struct aead_request *req)
/* taken from crypto/ccm.c */ /* taken from crypto/ccm.c */
/* 2 <= L <= 8, so 1 <= L' <= 7. */ /* 2 <= L <= 8, so 1 <= L' <= 7. */
if (l < 2 || l > 8) { if (l < 2 || l > 8) {
dev_err(dev, "illegal iv value %X\n", req->iv[0]); dev_dbg(dev, "illegal iv value %X\n", req->iv[0]);
return -EINVAL; return -EINVAL;
} }
memcpy(b0, req->iv, AES_BLOCK_SIZE); memcpy(b0, req->iv, AES_BLOCK_SIZE);
...@@ -2056,7 +2056,7 @@ static int cc_rfc4309_ccm_encrypt(struct aead_request *req) ...@@ -2056,7 +2056,7 @@ static int cc_rfc4309_ccm_encrypt(struct aead_request *req)
int rc = -EINVAL; int rc = -EINVAL;
if (!valid_assoclen(req)) { if (!valid_assoclen(req)) {
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen); dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
goto out; goto out;
} }
...@@ -2106,7 +2106,7 @@ static int cc_rfc4309_ccm_decrypt(struct aead_request *req) ...@@ -2106,7 +2106,7 @@ static int cc_rfc4309_ccm_decrypt(struct aead_request *req)
int rc = -EINVAL; int rc = -EINVAL;
if (!valid_assoclen(req)) { if (!valid_assoclen(req)) {
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen); dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
goto out; goto out;
} }
...@@ -2225,7 +2225,7 @@ static int cc_rfc4106_gcm_encrypt(struct aead_request *req) ...@@ -2225,7 +2225,7 @@ static int cc_rfc4106_gcm_encrypt(struct aead_request *req)
int rc = -EINVAL; int rc = -EINVAL;
if (!valid_assoclen(req)) { if (!valid_assoclen(req)) {
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen); dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
goto out; goto out;
} }
...@@ -2256,7 +2256,7 @@ static int cc_rfc4543_gcm_encrypt(struct aead_request *req) ...@@ -2256,7 +2256,7 @@ static int cc_rfc4543_gcm_encrypt(struct aead_request *req)
int rc = -EINVAL; int rc = -EINVAL;
if (!valid_assoclen(req)) { if (!valid_assoclen(req)) {
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen); dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
goto out; goto out;
} }
...@@ -2290,7 +2290,7 @@ static int cc_rfc4106_gcm_decrypt(struct aead_request *req) ...@@ -2290,7 +2290,7 @@ static int cc_rfc4106_gcm_decrypt(struct aead_request *req)
int rc = -EINVAL; int rc = -EINVAL;
if (!valid_assoclen(req)) { if (!valid_assoclen(req)) {
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen); dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
goto out; goto out;
} }
...@@ -2321,7 +2321,7 @@ static int cc_rfc4543_gcm_decrypt(struct aead_request *req) ...@@ -2321,7 +2321,7 @@ static int cc_rfc4543_gcm_decrypt(struct aead_request *req)
int rc = -EINVAL; int rc = -EINVAL;
if (!valid_assoclen(req)) { if (!valid_assoclen(req)) {
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen); dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
goto out; goto out;
} }
......
...@@ -302,7 +302,7 @@ static int cc_cipher_sethkey(struct crypto_skcipher *sktfm, const u8 *key, ...@@ -302,7 +302,7 @@ static int cc_cipher_sethkey(struct crypto_skcipher *sktfm, const u8 *key,
keylen = hki.keylen; keylen = hki.keylen;
if (validate_keys_sizes(ctx_p, keylen)) { if (validate_keys_sizes(ctx_p, keylen)) {
dev_err(dev, "Unsupported key size %d.\n", keylen); dev_dbg(dev, "Unsupported key size %d.\n", keylen);
return -EINVAL; return -EINVAL;
} }
...@@ -392,7 +392,7 @@ static int cc_cipher_setkey(struct crypto_skcipher *sktfm, const u8 *key, ...@@ -392,7 +392,7 @@ static int cc_cipher_setkey(struct crypto_skcipher *sktfm, const u8 *key,
/* STAT_PHASE_0: Init and sanity checks */ /* STAT_PHASE_0: Init and sanity checks */
if (validate_keys_sizes(ctx_p, keylen)) { if (validate_keys_sizes(ctx_p, keylen)) {
dev_err(dev, "Unsupported key size %d.\n", keylen); dev_dbg(dev, "Unsupported key size %d.\n", keylen);
return -EINVAL; return -EINVAL;
} }
...@@ -833,7 +833,7 @@ static int cc_cipher_process(struct skcipher_request *req, ...@@ -833,7 +833,7 @@ static int cc_cipher_process(struct skcipher_request *req,
/* TODO: check data length according to mode */ /* TODO: check data length according to mode */
if (validate_data_size(ctx_p, nbytes)) { if (validate_data_size(ctx_p, nbytes)) {
dev_err(dev, "Unsupported data size %d.\n", nbytes); dev_dbg(dev, "Unsupported data size %d.\n", nbytes);
rc = -EINVAL; rc = -EINVAL;
goto exit_process; goto exit_process;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment