]>
Commit | Line | Data |
---|---|---|
596d6b7e RS |
1 | #! /usr/bin/env perl |
2 | # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. | |
3 | # | |
909f1a2e | 4 | # Licensed under the Apache License 2.0 (the "License"). You may not use |
596d6b7e RS |
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 | |
8 | ||
0c85cc50 RL |
9 | |
10 | use strict; | |
11 | use warnings; | |
12 | ||
13 | use File::Spec; | |
42e0ccdf | 14 | use OpenSSL::Test qw/:DEFAULT srctop_file/; |
340166a9 | 15 | use OpenSSL::Test::Utils; |
0c85cc50 RL |
16 | |
17 | setup("test_ec"); | |
18 | ||
d1eec097 | 19 | plan tests => 14; |
0c85cc50 | 20 | |
42e0ccdf | 21 | require_ok(srctop_file('test','recipes','tconversion.pl')); |
0c85cc50 RL |
22 | |
23 | ok(run(test(["ectest"])), "running ectest"); | |
24 | ||
d1eec097 P |
25 | # TODO: remove these when the 'ec' app is removed. |
26 | # Also consider moving this to the 20-25 test section because it is testing | |
27 | # the command line tool in addition to the algorithm. | |
81722fdf NT |
28 | SKIP: { |
29 | skip "Skipping EC conversion test", 3 | |
b0cfe526 | 30 | if disabled("ec"); |
81722fdf NT |
31 | |
32 | subtest 'EC conversions -- private key' => sub { | |
33 | tconversion("ec", srctop_file("test","testec-p256.pem")); | |
34 | }; | |
35 | subtest 'EC conversions -- private key PKCS#8' => sub { | |
36 | tconversion("ec", srctop_file("test","testec-p256.pem"), "pkey"); | |
37 | }; | |
38 | subtest 'EC conversions -- public key' => sub { | |
39 | tconversion("ec", srctop_file("test","testecpub-p256.pem"), | |
40 | "ec", "-pubin", "-pubout"); | |
41 | }; | |
42 | } | |
43 | ||
d1eec097 P |
44 | SKIP: { |
45 | skip "Skipping PKEY conversion test", 3 | |
46 | if disabled("ec"); | |
47 | ||
48 | subtest 'PKEY conversions -- private key' => sub { | |
49 | tconversion("pkey", srctop_file("test","testec-p256.pem")); | |
50 | }; | |
51 | subtest 'PKEY conversions -- private key PKCS#8' => sub { | |
52 | tconversion("pkey", srctop_file("test","testec-p256.pem"), "pkey"); | |
53 | }; | |
54 | subtest 'PKEY conversions -- public key' => sub { | |
55 | tconversion("pkey", srctop_file("test","testecpub-p256.pem"), | |
56 | "pkey", "-pubin", "-pubout"); | |
57 | }; | |
58 | } | |
59 | ||
81722fdf NT |
60 | SKIP: { |
61 | skip "Skipping EdDSA conversion test", 6 | |
62 | if disabled("ec"); | |
63 | ||
64 | subtest 'Ed25519 conversions -- private key' => sub { | |
d1eec097 | 65 | tconversion("pkey", srctop_file("test", "tested25519.pem")); |
81722fdf NT |
66 | }; |
67 | subtest 'Ed25519 conversions -- private key PKCS#8' => sub { | |
d1eec097 | 68 | tconversion("pkey", srctop_file("test", "tested25519.pem"), "pkey"); |
81722fdf NT |
69 | }; |
70 | subtest 'Ed25519 conversions -- public key' => sub { | |
d1eec097 | 71 | tconversion("pkey", srctop_file("test", "tested25519pub.pem"), |
81722fdf NT |
72 | "pkey", "-pubin", "-pubout"); |
73 | }; | |
74 | ||
75 | subtest 'Ed448 conversions -- private key' => sub { | |
d1eec097 | 76 | tconversion("pkey", srctop_file("test", "tested448.pem")); |
81722fdf NT |
77 | }; |
78 | subtest 'Ed448 conversions -- private key PKCS#8' => sub { | |
d1eec097 | 79 | tconversion("pkey", srctop_file("test", "tested448.pem"), "pkey"); |
81722fdf NT |
80 | }; |
81 | subtest 'Ed448 conversions -- public key' => sub { | |
d1eec097 | 82 | tconversion("pkey", srctop_file("test", "tested448pub.pem"), |
81722fdf NT |
83 | "pkey", "-pubin", "-pubout"); |
84 | }; | |
0c85cc50 | 85 | } |