mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: d.kasatkin@samsung.com, zohar@linux.vnet.ibm.com
Cc: dhowells@redhat.com, keyrings@linux-nfs.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] X.509: x509_request_asymmetric_keys() doesn't need string length arguments
Date: Mon, 28 Jul 2014 14:54:49 +0100	[thread overview]
Message-ID: <20140728135449.18307.38548.stgit@warthog.procyon.org.uk> (raw)

x509_request_asymmetric_keys() doesn't need the lengths of the NUL-terminated
strings passing in as it can work that out for itself.

Signed-off-by: David Howells <dhowells@redhat.com>
---
 crypto/asymmetric_keys/x509_public_key.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
index a0f7cd196c9b..4ae982234d78 100644
--- a/crypto/asymmetric_keys/x509_public_key.c
+++ b/crypto/asymmetric_keys/x509_public_key.c
@@ -48,11 +48,10 @@ __setup("ca_keys=", ca_keys_setup);
  */
 static struct key *x509_request_asymmetric_key(struct key *keyring,
 					       const char *signer,
-					       size_t signer_len,
-					       const char *authority,
-					       size_t auth_len)
+					       const char *authority)
 {
 	key_ref_t key;
+	size_t signer_len = strlen(signer), auth_len = strlen(authority);
 	char *id;
 
 	/* Construct an identifier. */
@@ -193,9 +192,7 @@ static int x509_validate_trust(struct x509_certificate *cert,
 		return -EPERM;
 
 	key = x509_request_asymmetric_key(trust_keyring,
-					  cert->issuer, strlen(cert->issuer),
-					  cert->authority,
-					  strlen(cert->authority));
+					  cert->issuer, cert->authority);
 	if (!IS_ERR(key))  {
 		if (!use_builtin_keys
 		    || test_bit(KEY_FLAG_BUILTIN, &key->flags))


             reply	other threads:[~2014-07-28 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 13:54 David Howells [this message]
2014-07-28 13:54 ` [PATCH 2/2] PKCS#7: Use x509_request_asymmetric_key() David Howells
2014-07-29 12:03   ` Mimi Zohar
2014-07-29 12:02 ` [PATCH 1/2] X.509: x509_request_asymmetric_keys() doesn't need string length arguments 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=20140728135449.18307.38548.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=d.kasatkin@samsung.com \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zohar@linux.vnet.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

all inboxes | Powered by JetHome®