Skip to content

Commit 5f7f5c8

Browse files
committed
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>
1 parent 9eb0298 commit 5f7f5c8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crypto/asymmetric_keys/x509_public_key.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ static int x509_validate_trust(struct x509_certificate *cert,
220220

221221
if (!use_builtin_keys ||
222222
test_bit(KEY_FLAG_BUILTIN, &key->flags)) {
223-
ret = public_key_verify_signature(
224-
key->payload.data[asym_crypto], cert->sig);
223+
ret = verify_signature(key, cert->sig);
225224
if (ret == -ENOPKG)
226225
cert->unsupported_sig = true;
227226
}

0 commit comments

Comments
 (0)