Skip to content

Commit

Permalink
X.509: x509_request_asymmetric_keys() doesn't need string length argu…
Browse files Browse the repository at this point in the history
…ments

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 <[email protected]>
Acked-by: Mimi Zohar <[email protected]>
  • Loading branch information
dhowells committed Jul 28, 2014
1 parent 63d2551 commit 185de09
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crypto/asymmetric_keys/x509_public_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 185de09

Please sign in to comment.