From: David Howells Date: Wed, 9 Jul 2014 15:48:00 +0000 (+0100) Subject: X.509: x509_request_asymmetric_keys() doesn't need string length arguments X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=185de09c6aa9d38ec04e34b2d9a996561963f895;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: David Howells Acked-by: Mimi Zohar --- 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))