Commit 185de09c authored by David Howells's avatar David Howells

X.509: x509_request_asymmetric_keys() doesn't need string length arguments

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: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 63d2551e
...@@ -48,11 +48,10 @@ __setup("ca_keys=", ca_keys_setup); ...@@ -48,11 +48,10 @@ __setup("ca_keys=", ca_keys_setup);
*/ */
static struct key *x509_request_asymmetric_key(struct key *keyring, static struct key *x509_request_asymmetric_key(struct key *keyring,
const char *signer, const char *signer,
size_t signer_len, const char *authority)
const char *authority,
size_t auth_len)
{ {
key_ref_t key; key_ref_t key;
size_t signer_len = strlen(signer), auth_len = strlen(authority);
char *id; char *id;
/* Construct an identifier. */ /* Construct an identifier. */
...@@ -193,9 +192,7 @@ static int x509_validate_trust(struct x509_certificate *cert, ...@@ -193,9 +192,7 @@ static int x509_validate_trust(struct x509_certificate *cert,
return -EPERM; return -EPERM;
key = x509_request_asymmetric_key(trust_keyring, key = x509_request_asymmetric_key(trust_keyring,
cert->issuer, strlen(cert->issuer), cert->issuer, cert->authority);
cert->authority,
strlen(cert->authority));
if (!IS_ERR(key)) { if (!IS_ERR(key)) {
if (!use_builtin_keys if (!use_builtin_keys
|| test_bit(KEY_FLAG_BUILTIN, &key->flags)) || test_bit(KEY_FLAG_BUILTIN, &key->flags))
......
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