Tomas Mraz dabf4696d4 Copyright year updates 1 éve
..
certs aff2886eab Copyright year updates 1 éve
ct 8c6afbc55c Verify SCT signatures 8 éve
d2i-tests a378a46985 add test for CVE-2016-7053 8 éve
ocsp-tests 121738d1cb Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL 7 éve
ossl_shim fbbfd128c9 Fix header file include guard names 5 éve
recipes dabf4696d4 Copyright year updates 1 éve
smime-certs f040f25778 Check CMS failure during BIO setup with -stream is handled correctly 1 éve
ssl-tests a3fc812c0c Update copyright year 2 éve
testutil c3a54c3b08 Update copyright year 1 éve
CAss.cnf a7be5759cf RT3809: basicConstraints is critical 8 éve
CAssdh.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 26 éve
CAssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 26 éve
CAssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 26 éve
CAtsa.cnf f0ef20bf38 Added support for ESSCertIDv2 7 éve
P1ss.cnf fec669388c Use 2K RSA and SHA256 in tests 9 éve
P2ss.cnf fec669388c Use 2K RSA and SHA256 in tests 9 éve
README 109a00269d issue-8493: Fix for filenames with newlines using openssl dgst 5 éve
README.external 3b09585bd6 Remove unnecessary trailing whitespace 5 éve
README.ssltest.md a84e5c9aa8 Session resume broken switching contexts 7 éve
Sssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 26 éve
Sssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b 26 éve
Uss.cnf cb0585c2cb Create DSA and ECDSA certificates. 9 éve
aborttest.c 440e5d805f Copyright consolidation 02/10 8 éve
afalgtest.c defe51c178 Update copyright year 2 éve
asn1_decode_test.c 6f2a7abe22 Update copyright year 3 éve
asn1_encode_test.c d84596449d Revert "Fix test/asn1_encode_test.c to not use ASN1_FBOOLEAN" 3 éve
asn1_internal_test.c 0c5bc96fb7 Update copyright year 2 éve
asn1_string_table_test.c 31a80694d4 [Win] Fix some test method signatures ... 7 éve
asn1_time_test.c 1cb7eff45b Update copyright year 5 éve
asynciotest.c b5acbf9148 Reorganize local header files 5 éve
asynctest.c 83cf7abf8e Update copyright year 6 éve
bad_dtls_test.c b5acbf9148 Reorganize local header files 5 éve
bftest.c cbe2964821 Consistent formatting for sizeof(foo) 7 éve
bio_callback_test.c c11c28052f Extend the BIO callback tests to check the return value semantics 6 éve
bio_enc_test.c 0139ce7c92 Fix no-chacha and no-poly1305 7 éve
bio_memleak_test.c 6f2a7abe22 Update copyright year 3 éve
bioprinttest.c 24a535eaf0 Update copyright year 4 éve
bntest.c 0c5bc96fb7 Update copyright year 2 éve
bntests.pl 8d1ebff41c Make bntest be (mostly) file-based. 8 éve
build.info 624f858c82 Don't link test/ec_internal_test with libapps.a 2 éve
casttest.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
chacha_internal_test.c 0c994d54af Reorganize private crypto header files 5 éve
cipher_overhead_test.c b5acbf9148 Reorganize local header files 5 éve
cipherbytes_test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
cipherlist_test.c 72a7a7021f Update copyright year 5 éve
ciphername_test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
clienthellotest.c 6f2a7abe22 Update copyright year 3 éve
cmactest.c 19b4fe5844 Add a CMAC test 4 éve
cms-examples.pl e0a651945c Copyright consolidation: perl files 8 éve
cmsapitest.c e15e92dbd5 Add a CMS API test 6 éve
conf_include_test.c 1cb7eff45b Update copyright year 5 éve
constant_time_test.c b5acbf9148 Reorganize local header files 5 éve
crltest.c 72a7a7021f Update copyright year 5 éve
ct_test.c a3fc812c0c Update copyright year 2 éve
ctype_internal_test.c 0c994d54af Reorganize private crypto header files 5 éve
curve448_internal_test.c b5acbf9148 Reorganize local header files 5 éve
d2i_test.c cbe2964821 Consistent formatting for sizeof(foo) 7 éve
dane-cross.in 09126044f0 Test for DANE cross cert fix 3 éve
danetest.c defe51c178 Update copyright year 2 éve
danetest.in 5ae4ceb92c Perform DANE-EE(3) name checks by default 8 éve
danetest.pem 170b735820 DANE support for X509_verify_cert() 8 éve
data.bin 6d022b0474 Add a test case for duplicate engine loading 3 éve
destest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
dhtest.c 9c7d3022d6 Copyright year updates 1 éve
drbg_cavs_data.c c4d3c19b4c Update copyright year 6 éve
drbg_cavs_data.h fbbfd128c9 Fix header file include guard names 5 éve
drbg_cavs_test.c b5acbf9148 Reorganize local header files 5 éve
drbgtest.c 24a535eaf0 Update copyright year 4 éve
drbgtest.h 12fb8c3d2d Add DRBG random method 7 éve
dsa_no_digest_size_test.c cb809437d3 Add test for DSA signatures of raw digests of various sizes 6 éve
dsatest.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
dtls_mtu_test.c b5b37553bc Update copyright year 2 éve
dtlstest.c 0874d7f21b Update copyright year 2 éve
dtlsv1listentest.c 83cf7abf8e Update copyright year 6 éve
ec_internal_test.c 0874d7f21b Update copyright year 2 éve
ecdsatest.c 555b2593f7 [test] modernize ecdsatest and extend ECDSA sign KATs 5 éve
ecdsatest.h fbbfd128c9 Fix header file include guard names 5 éve
ecstresstest.c 1212818eb0 Update copyright year 6 éve
ectest.c 6f2a7abe22 Update copyright year 3 éve
enginetest.c 1cb7eff45b Update copyright year 5 éve
errtest.c 2de108dfa3 Save and restore the Windows error around TlsGetValue. 6 éve
evp_extra_test.c 0c5bc96fb7 Update copyright year 2 éve
evp_test.c defe51c178 Update copyright year 2 éve
evp_test.h c3fc7d9ac5 Add support for multiple update calls in evp_test 7 éve
exdatatest.c 83cf7abf8e Update copyright year 6 éve
exptest.c c3a54c3b08 Update copyright year 1 éve
fatalerrtest.c b0edda11cb Update copyright year 6 éve
generate_buildtest.pl 83cf7abf8e Update copyright year 6 éve
generate_ssl_tests.pl cb6afcd6ee Consolidate the locations where we have our internal perl modules 7 éve
gmdifftest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
gosttest.c 1e83954580 Add a GOST test 6 éve
handshake_helper.c 24a535eaf0 Update copyright year 4 éve
handshake_helper.h fbbfd128c9 Fix header file include guard names 5 éve
hmactest.c e7ff223a20 Update copyright year 4 éve
ideatest.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
igetest.c cbe2964821 Consistent formatting for sizeof(foo) 7 éve
lhash_test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
md2test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
mdc2_internal_test.c 83cf7abf8e Update copyright year 6 éve
mdc2test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
memleaktest.c 789dfc478e Update secmemtest and memeleaktest to use the test infrastructure. 7 éve
modes_internal_test.c b5acbf9148 Reorganize local header files 5 éve
ocspapitest.c 35fd99538a Update copyright year 5 éve
packettest.c defe51c178 Update copyright year 2 éve
pbelutest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
pemtest.c c3a54c3b08 Update copyright year 1 éve
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
pkey_meth_kdf_test.c 83cf7abf8e Update copyright year 6 éve
pkey_meth_test.c 83cf7abf8e Update copyright year 6 éve
pkits-test.pl 46f4e1bec5 Many spelling fixes/typo's corrected. 7 éve
poly1305_internal_test.c 0c994d54af Reorganize private crypto header files 5 éve
rc2test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
rc4test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
rc5test.c 176db6dc51 Use "" not <> for internal/ includes 7 éve
rdrand_sanitytest.c 72a7a7021f Update copyright year 5 éve
recordlentest.c b0edda11cb Update copyright year 6 éve
rsa_complex.c 4978ecb26e Add a compile time test to verify that openssl/rsa.h and complex.h can 6 éve
rsa_mp_test.c 3bded9cd35 rsa/rsa_gen.c: harmonize keygen's ability with RSA_security_bits. 7 éve
rsa_test.c cadb6f0e32 Fix use of uninitialized memory in test_rsa_oaep 3 éve
run_tests.pl e7ff223a20 Update copyright year 4 éve
sanitytest.c 1212818eb0 Update copyright year 6 éve
secmemtest.c 5e130ae632 test/secmemtest: test secure memory only if it is implemented 6 éve
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... 11 éve
serverinfo2.pem b878afae4b Add a SERVERINFOV2 format test file 7 éve
servername_test.c b5acbf9148 Reorganize local header files 5 éve
session.pem 6cf2dbd9fa Don't store the ticket nonce in the session 6 éve
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. 8 éve
shlibloadtest.c 0c994d54af Reorganize private crypto header files 5 éve
siphash_internal_test.c 0c994d54af Reorganize private crypto header files 5 éve
sm2_internal_test.c b9b45aa458 Add sm2 encryption test case from GM/T 0003.5-2012 3 éve
sm4_internal_test.c 0c994d54af Reorganize private crypto header files 5 éve
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. 8 éve
srptest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
ssl_cert_table_internal_test.c b5acbf9148 Reorganize local header files 5 éve
ssl_ctx_test.c c4ab488399 Add test cases for min/max protocol API 5 éve
ssl_test.c dbabc86296 Add a config option to disable automatic config loading 6 éve
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. 8 éve
ssl_test_ctx.c 72a7a7021f Update copyright year 5 éve
ssl_test_ctx.h fbbfd128c9 Fix header file include guard names 5 éve
ssl_test_ctx_test.c b0edda11cb Update copyright year 6 éve
ssl_test_ctx_test.conf cf72c75792 Implement Maximum Fragment Length TLS extension. 7 éve
sslapitest.c c3a54c3b08 Update copyright year 1 éve
sslbuffertest.c b5acbf9148 Reorganize local header files 5 éve
sslcorrupttest.c 3cb7c5cfef Use void in all function definitions that do not take any arguments 6 éve
ssltest_old.c 0c5bc96fb7 Update copyright year 2 éve
ssltestlib.c 0874d7f21b Update copyright year 2 éve
ssltestlib.h 0874d7f21b Update copyright year 2 éve
stack_test.c 1b3e2bbf64 Add a reserve call to the stack data structure. 7 éve
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). 6 éve
sysdefaulttest.c b0edda11cb Update copyright year 6 éve
test.cnf fec669388c Use 2K RSA and SHA256 in tests 9 éve
test_test.c c3a54c3b08 Update copyright year 1 éve
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
testdsa.pem 79a578b902 Add private/public key conversion tests 9 éve
testdsapub.pem 79a578b902 Add private/public key conversion tests 9 éve
testec-p256.pem 79a578b902 Add private/public key conversion tests 9 éve
testecpub-p256.pem 79a578b902 Add private/public key conversion tests 9 éve
tested25519.pem efdfc392aa More testing for CLI usage of Ed25519 and Ed448 keys 4 éve
tested25519pub.pem efdfc392aa More testing for CLI usage of Ed25519 and Ed448 keys 4 éve
tested448.pem efdfc392aa More testing for CLI usage of Ed25519 and Ed448 keys 4 éve
tested448pub.pem efdfc392aa More testing for CLI usage of Ed25519 and Ed448 keys 4 éve
testp7.pem dcb1ef5c22 Change PKCS#7 test data to take account of removal of 24 éve
testreq2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
testrsa_withattrs.der 9a48d4a4fe Testing private keys with extra attributes 3 éve
testrsa_withattrs.pem 9a48d4a4fe Testing private keys with extra attributes 3 éve
testrsapub.pem 79a578b902 Add private/public key conversion tests 9 éve
testsid.pem 45f55f6a5b Remove SSLv2 support 10 éve
testutil.h fbbfd128c9 Fix header file include guard names 5 éve
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
threadstest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
time_offset_test.c 83cf7abf8e Update copyright year 6 éve
tls13ccstest.c b5acbf9148 Reorganize local header files 5 éve
tls13encryptiontest.c 24a535eaf0 Update copyright year 4 éve
tls13secretstest.c b5acbf9148 Reorganize local header files 5 éve
uitest.c 31a80694d4 [Win] Fix some test method signatures ... 7 éve
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b 26 éve
v3ext.c 264a3f453c Fix a crash in v2i_IPAddrBlocks() 2 éve
v3nametest.c c3a54c3b08 Update copyright year 1 éve
verify_extra_test.c 0c5bc96fb7 Update copyright year 2 éve
versions.c efe749c840 Refuse to run test_cipherlist unless shared library matches build 6 éve
wpackettest.c b5acbf9148 Reorganize local header files 5 éve
x509_check_cert_pkey_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
x509_dup_cert_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything 7 éve
x509_internal_test.c 0874d7f21b Update copyright year 2 éve
x509_time_test.c 6f2a7abe22 Update copyright year 3 éve
x509aux.c 2b2e3106fc Update copyright year 3 éve

README

How to add recipes
==================

For any test that you want to perform, you write a script located in
test/recipes/, named {nn}-test_{name}.t, where {nn} is a two digit number and
{name} is a unique name of your choice.

Please note that if a test involves a new testing executable, you will need to
do some additions in test/Makefile. More on this later.


Naming conventions
=================

A test executable is named test/{name}test.c

A test recipe is named test/recipes/{nn}-test_{name}.t, where {nn} is a two
digit number and {name} is a unique name of your choice.

The number {nn} is (somewhat loosely) grouped as follows:

00-04 sanity, internal and essential API tests
05-09 individual symmetric cipher algorithms
10-14 math (bignum)
15-19 individual asymmetric cipher algorithms
20-24 openssl commands (some otherwise not tested)
25-29 certificate forms, generation and verification
30-35 engine and evp
60-79 APIs
70 PACKET layer
80-89 "larger" protocols (CA, CMS, OCSP, SSL, TSA)
90-98 misc
99 most time consuming tests [such as test_fuzz]


A recipe that just runs a test executable
=========================================

A script that just runs a program looks like this:

#! /usr/bin/perl

use OpenSSL::Test::Simple;

simple_test("test_{name}", "{name}test", "{name}");

{name} is the unique name you have chosen for your test.

The second argument to `simple_test' is the test executable, and `simple_test'
expects it to be located in test/

For documentation on OpenSSL::Test::Simple, do
`perldoc util/perl/OpenSSL/Test/Simple.pm'.


A recipe that runs a more complex test
======================================

For more complex tests, you will need to read up on Test::More and
OpenSSL::Test. Test::More is normally preinstalled, do `man Test::More' for
documentation. For OpenSSL::Test, do `perldoc util/perl/OpenSSL/Test.pm'.

A script to start from could be this:

#! /usr/bin/perl

use strict;
use warnings;
use OpenSSL::Test;

setup("test_{name}");

plan tests => 2; # The number of tests being performed

ok(test1, "test1");
ok(test2, "test1");

sub test1
{
# test feature 1
}

sub test2
{
# test feature 2
}


Changes to test/build.info
==========================

Whenever a new test involves a new test executable you need to do the
following (at all times, replace {NAME} and {name} with the name of your
test):

* add {name} to the list of programs under PROGRAMS_NO_INST

* create a three line description of how to build the test, you will have
to modify the include paths and source files if you don't want to use the
basic test framework:

SOURCE[{name}]={name}.c
INCLUDE[{name}]=.. ../include
DEPEND[{name}]=../libcrypto libtestutil.a

Generic form of C test executables
==================================

#include "testutil.h"

static int my_test(void)
{
int testresult = 0; /* Assume the test will fail */
int observed;

observed = function(); /* Call the code under test */
if (!TEST_int_eq(observed, 2)) /* Check the result is correct */
goto end; /* Exit on failure - optional */

testresult = 1; /* Mark the test case a success */
end:
cleanup(); /* Any cleanup you require */
return testresult;
}

int setup_tests(void)
{
ADD_TEST(my_test); /* Add each test separately */
return 1; /* Indicate success */
}

You should use the TEST_xxx macros provided by testutil.h to test all failure
conditions. These macros produce an error message in a standard format if the
condition is not met (and nothing if the condition is met). Additional
information can be presented with the TEST_info macro that takes a printf
format string and arguments. TEST_error is useful for complicated conditions,
it also takes a printf format string and argument. In all cases the TEST_xxx
macros are guaranteed to evaluate their arguments exactly once. This means
that expressions with side effects are allowed as parameters. Thus,

if (!TEST_ptr(ptr = OPENSSL_malloc(..)))

works fine and can be used in place of:

ptr = OPENSSL_malloc(..);
if (!TEST_ptr(ptr))

The former produces a more meaningful message on failure than the latter.