]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/60-test_x509_check_cert_pkey.t
2 # Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
10 use OpenSSL
::Test qw
/:DEFAULT srctop_file/;
11 use OpenSSL
::Test
::Utils
;
13 setup
("test_x509_check_cert_pkey");
18 ok
(run
(test
(["x509_check_cert_pkey_test",
19 srctop_file
("test", "certs", "servercert.pem"),
20 srctop_file
("test", "certs", "serverkey.pem"), "cert", "ok"])));
22 ok
(run
(test
(["x509_check_cert_pkey_test",
23 srctop_file
("test", "certs", "servercert.pem"),
24 srctop_file
("test", "certs", "wrongkey.pem"), "cert", "failed"])));
26 skip
"DSA disabled", 1, if disabled
("dsa");
28 ok
(run
(test
(["x509_check_cert_pkey_test",
29 srctop_file
("test", "certs", "server-dsa-cert.pem"),
30 srctop_file
("test", "certs", "server-dsa-key.pem"), "cert", "ok"])));
34 skip
"EC disabled", 1 if disabled
("ec");
35 ok
(run
(test
(["x509_check_cert_pkey_test",
36 srctop_file
("test", "certs", "server-ecdsa-cert.pem"),
37 srctop_file
("test", "certs", "server-ecdsa-key.pem"), "cert", "ok"])));
39 # certificate request (rsa)
40 ok
(run
(test
(["x509_check_cert_pkey_test",
41 srctop_file
("test", "certs", "x509-check.csr"),
42 srctop_file
("test", "certs", "x509-check-key.pem"), "req", "ok"])));
43 # mismatched certificate request (rsa)
44 ok
(run
(test
(["x509_check_cert_pkey_test",
45 srctop_file
("test", "certs", "x509-check.csr"),
46 srctop_file
("test", "certs", "wrongkey.pem"), "req", "failed"])));