]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/25-test_gen.t
2 # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (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
14 use OpenSSL
::Test qw
/:DEFAULT srctop_file/;
15 use OpenSSL
::Test
::Utils
;
23 my $CA = srctop_file
("certs", "testca.pem");
25 unlink "$T.1", "$T.2", "$T.key";
26 open RND
, ">>", ".rnd";
27 print RND
"string to make the random number generator think it has entropy";
30 subtest
"generating certificate requests" => sub {
32 if (disabled
("rsa")) {
33 @req_new = ("-newkey", "dsa:".srctop_file
("apps", "dsa512.pem"));
36 note
("There should be a 2 sequences of .'s and some +'s.");
37 note
("There should not be more that at most 80 per line");
40 unlink "testkey.pem", "testreq.pem";
44 ok
(run
(app
(["openssl", "req", "-config", srctop_file
("test", "test.cnf"),
45 @req_new, "-out", "testreq.pem"])),
46 "Generating request");
48 ok
(run
(app
(["openssl", "req", "-config", srctop_file
("test", "test.cnf"),
49 "-verify", "-in", "testreq.pem", "-noout"])),
50 "Verifying signature on request");