aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-07-09 11:48:00 -0400
committerDavid Howells <dhowells@redhat.com>2014-07-28 09:55:55 -0400
commit185de09c6aa9d38ec04e34b2d9a996561963f895 (patch)
treeb5dcf2c98eecd595ee2ad2bfb172f7d73dd37ea2
parent63d2551ea7e2c34b533f2b6b0646cc825d9ee509 (diff)
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 <dhowells@redhat.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
-rw-r--r--crypto/asymmetric_keys/x509_public_key.c9
1 files 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);
48 */ 48 */
49static struct key *x509_request_asymmetric_key(struct key *keyring, 49static struct key *x509_request_asymmetric_key(struct key *keyring,
50 const char *signer, 50 const char *signer,
51 size_t signer_len, 51 const char *authority)
52 const char *authority,
53 size_t auth_len)
54{ 52{
55 key_ref_t key; 53 key_ref_t key;
54 size_t signer_len = strlen(signer), auth_len = strlen(authority);
56 char *id; 55 char *id;
57 56
58 /* Construct an identifier. */ 57 /* Construct an identifier. */
@@ -193,9 +192,7 @@ static int x509_validate_trust(struct x509_certificate *cert,
193 return -EPERM; 192 return -EPERM;
194 193
195 key = x509_request_asymmetric_key(trust_keyring, 194 key = x509_request_asymmetric_key(trust_keyring,
196 cert->issuer, strlen(cert->issuer), 195 cert->issuer, cert->authority);
197 cert->authority,
198 strlen(cert->authority));
199 if (!IS_ERR(key)) { 196 if (!IS_ERR(key)) {
200 if (!use_builtin_keys 197 if (!use_builtin_keys
201 || test_bit(KEY_FLAG_BUILTIN, &key->flags)) 198 || test_bit(KEY_FLAG_BUILTIN, &key->flags))