]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
X.509: Use verify_signature() if we have a struct key * to use
authorDavid Howells <dhowells@redhat.com>
Wed, 6 Apr 2016 15:14:25 +0000 (16:14 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 11 Apr 2016 21:42:27 +0000 (22:42 +0100)
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>
crypto/asymmetric_keys/x509_public_key.c

index 9c8483ef1cfeb0e5eb885634d0916b330274ba37..117a6ee71a4d8b0863c3d55be6b0cb8460dd077a 100644 (file)
@@ -220,8 +220,7 @@ static int x509_validate_trust(struct x509_certificate *cert,
 
        if (!use_builtin_keys ||
            test_bit(KEY_FLAG_BUILTIN, &key->flags)) {
-               ret = public_key_verify_signature(
-                       key->payload.data[asym_crypto], cert->sig);
+               ret = verify_signature(key, cert->sig);
                if (ret == -ENOPKG)
                        cert->unsupported_sig = true;
        }