summaryrefslogtreecommitdiffstats
path: root/crypto/asymmetric_keys
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-04-06 11:14:25 -0400
committerDavid Howells <dhowells@redhat.com>2016-04-11 17:42:27 -0400
commit5f7f5c81e59be5ce262c5b7d0ede9565a2558d80 (patch)
tree3ee2a1d54b10aeae4d272cb17e143130fe105b0a /crypto/asymmetric_keys
parent9eb029893ad5bf9303ed7f145860b312cbe5f889 (diff)
X.509: Use verify_signature() if we have a struct key * to use
We should call verify_signature() rather than directly calling public_key_verify_signature() if we have a struct key to use as we shouldn't be poking around in the private data of the key struct as that's subtype dependent. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'crypto/asymmetric_keys')
-rw-r--r--crypto/asymmetric_keys/x509_public_key.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
index 9c8483ef1cfe..117a6ee71a4d 100644
--- a/crypto/asymmetric_keys/x509_public_key.c
+++ b/crypto/asymmetric_keys/x509_public_key.c
@@ -220,8 +220,7 @@ static int x509_validate_trust(struct x509_certificate *cert,
220 220
221 if (!use_builtin_keys || 221 if (!use_builtin_keys ||
222 test_bit(KEY_FLAG_BUILTIN, &key->flags)) { 222 test_bit(KEY_FLAG_BUILTIN, &key->flags)) {
223 ret = public_key_verify_signature( 223 ret = verify_signature(key, cert->sig);
224 key->payload.data[asym_crypto], cert->sig);
225 if (ret == -ENOPKG) 224 if (ret == -ENOPKG)
226 cert->unsupported_sig = true; 225 cert->unsupported_sig = true;
227 } 226 }