keyrings.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anatol Pomozov <anatol.pomozov@gmail.com>
To: keyrings@vger.kernel.org
Cc: zohar@linux.ibm.com, Anatol Pomozov <anatol.pomozov@gmail.com>
Subject: [PATCH v2] encrypted-keys: Print more useful debug info if encryption algo is not available
Date: Mon, 05 Oct 2020 22:52:58 +0000	[thread overview]
Message-ID: <20201005225258.200181-1-anatol.pomozov@gmail.com> (raw)

It helps to improve a cryptic message "encrypted_key failed to alloc_cipher (-2)".
Adding algo name makes it easier to understand what cipher has failed.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
---
 security/keys/encrypted-keys/encrypted.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 192e531c146f..c09d48f53682 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -84,8 +84,8 @@ static int aes_get_sizes(void)
 
 	tfm = crypto_alloc_skcipher(blkcipher_alg, 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(tfm)) {
-		pr_err("encrypted_key: failed to alloc_cipher (%ld)\n",
-		       PTR_ERR(tfm));
+		pr_err("encrypted_key: failed to alloc_cipher for %s (%ld)\n",
+		       blkcipher_alg, PTR_ERR(tfm));
 		return PTR_ERR(tfm);
 	}
 	ivsize = crypto_skcipher_ivsize(tfm);
-- 
2.28.0

             reply	other threads:[~2020-10-05 22:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 22:52 Anatol Pomozov [this message]
2020-10-06 15:56 ` [PATCH v2] encrypted-keys: Print more useful debug info if encryption algo is not available Jarkko Sakkinen
2020-10-06 15:56 ` Jarkko Sakkinen
2020-10-06 17:18 ` Anatol Pomozov
2020-10-06 23:39 ` Jarkko Sakkinen
2020-10-07  0:33 ` Mimi Zohar
2020-10-07  3:15 ` Jarkko Sakkinen
2020-10-12 20:18 ` Mimi Zohar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201005225258.200181-1-anatol.pomozov@gmail.com \
    --to=anatol.pomozov@gmail.com \
    --cc=keyrings@vger.kernel.org \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).