Matt Caswell e65a79d2aa Add an Ed25519 signature maleability test il y a 6 ans
..
certs 83c81eebed Add some test brainpool certificates il y a 6 ans
ct 8c6afbc55c Verify SCT signatures il y a 8 ans
d2i-tests a378a46985 add test for CVE-2016-7053 il y a 8 ans
ocsp-tests 121738d1cb Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL il y a 7 ans
ossl_shim 2fe3e2b682 Fix BoringSSL external test failures il y a 6 ans
recipes e65a79d2aa Add an Ed25519 signature maleability test il y a 6 ans
smime-certs 1aee92bf0f Add alternative CMS P-256 cert il y a 7 ans
ssl-tests c486283cb8 Update copyright year il y a 6 ans
testutil 1212818eb0 Update copyright year il y a 6 ans
CAss.cnf a7be5759cf RT3809: basicConstraints is critical il y a 8 ans
CAssdh.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
CAssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
CAssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
CAtsa.cnf f0ef20bf38 Added support for ESSCertIDv2 il y a 7 ans
P1ss.cnf fec669388c Use 2K RSA and SHA256 in tests il y a 9 ans
P2ss.cnf fec669388c Use 2K RSA and SHA256 in tests il y a 9 ans
README f90486f4de Fix test documentation. il y a 7 ans
README.external 46f4e1bec5 Many spelling fixes/typo's corrected. il y a 7 ans
README.ssltest.md a84e5c9aa8 Session resume broken switching contexts il y a 7 ans
Sssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
Sssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
Uss.cnf cb0585c2cb Create DSA and ECDSA certificates. il y a 9 ans
aborttest.c 440e5d805f Copyright consolidation 02/10 il y a 8 ans
afalgtest.c c517ac4c3f Revert "Modify test/afalgtest to fail if the afalg engine couldn't be loaded" il y a 6 ans
asn1_decode_test.c c2278c8bc4 TESTS: add test of decoding of invalid zero length ASN.1 INTEGER zero il y a 6 ans
asn1_encode_test.c 0d66475908 Update copyright year il y a 6 ans
asn1_internal_test.c 1212818eb0 Update copyright year il y a 6 ans
asn1_string_table_test.c 31a80694d4 [Win] Fix some test method signatures ... il y a 7 ans
asn1_time_test.c f5e3115361 test/asn1_time_test.c: make it work on 64-bit HP-UX. il y a 6 ans
asynciotest.c 35e742ecac Update code for the final RFC version of TLSv1.3 (RFC8446) il y a 6 ans
asynctest.c 83cf7abf8e Update copyright year il y a 6 ans
bad_dtls_test.c d68a0eaf45 Remove unicode characters from source il y a 7 ans
bftest.c cbe2964821 Consistent formatting for sizeof(foo) il y a 7 ans
bio_callback_test.c 52d78cc5eb Extend the BIO callback tests to check the return value semantics il y a 6 ans
bio_enc_test.c 0139ce7c92 Fix no-chacha and no-poly1305 il y a 7 ans
bioprinttest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
bntest.c 7d79d13a56 Fixed range of random produced in BN_is_prime_fasttest_ex() to be 1 < rand < w-1. It was using 1<= rand < w (which is wrong by 1 on both ends) il y a 6 ans
bntests.pl 8d1ebff41c Make bntest be (mostly) file-based. il y a 8 ans
build.info 1c615e4ce9 Test: link drbgtest statically against libcrypto il y a 6 ans
casttest.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
chacha_internal_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
cipher_overhead_test.c c486283cb8 Update copyright year il y a 6 ans
cipherbytes_test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
cipherlist_test.c 3cb7c5cfef Use void in all function definitions that do not take any arguments il y a 6 ans
ciphername_test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
clienthellotest.c 7d7f6834e5 Enhance ssltestlib's create_ssl_ctx_pair to take min and max proto version il y a 6 ans
cms-examples.pl e0a651945c Copyright consolidation: perl files il y a 8 ans
cmsapitest.c e15e92dbd5 Add a CMS API test il y a 6 ans
conf_include_test.c c9ecb13191 NCONF_get_number refix. il y a 6 ans
constant_time_test.c 0d66475908 Update copyright year il y a 6 ans
crltest.c 4483fbae10 Factorise duplicated code. il y a 7 ans
ct_test.c bc278f30f0 Add an explicit cast to time_t il y a 6 ans
ctype_internal_test.c b0edda11cb Update copyright year il y a 6 ans
curve448_internal_test.c 2935f6241c VMS: turn on name mangling for all our programs il y a 6 ans
d2i_test.c cbe2964821 Consistent formatting for sizeof(foo) il y a 7 ans
danetest.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
danetest.in 5ae4ceb92c Perform DANE-EE(3) name checks by default il y a 8 ans
danetest.pem 170b735820 DANE support for X509_verify_cert() il y a 8 ans
destest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
dhtest.c 9ba9d81b1c test/dhtest.c: fix resource leak il y a 6 ans
drbg_cavs_data.h 8bf3665196 Added DRBG_HMAC & DRBG_HASH + Added defaults for setting DRBG for master/public/private + renamed generate_counter back to reseed_counter + generated new cavs data tests il y a 6 ans
drbg_cavs_data_ctr.c 8bf3665196 Added DRBG_HMAC & DRBG_HASH + Added defaults for setting DRBG for master/public/private + renamed generate_counter back to reseed_counter + generated new cavs data tests il y a 6 ans
drbg_cavs_data_hash.c 8bf3665196 Added DRBG_HMAC & DRBG_HASH + Added defaults for setting DRBG for master/public/private + renamed generate_counter back to reseed_counter + generated new cavs data tests il y a 6 ans
drbg_cavs_data_hmac.c 8bf3665196 Added DRBG_HMAC & DRBG_HASH + Added defaults for setting DRBG for master/public/private + renamed generate_counter back to reseed_counter + generated new cavs data tests il y a 6 ans
drbg_cavs_test.c 8bf3665196 Added DRBG_HMAC & DRBG_HASH + Added defaults for setting DRBG for master/public/private + renamed generate_counter back to reseed_counter + generated new cavs data tests il y a 6 ans
drbgtest.c 1c615e4ce9 Test: link drbgtest statically against libcrypto il y a 6 ans
drbgtest.h c486283cb8 Update copyright year il y a 6 ans
dsa_no_digest_size_test.c cb809437d3 Add test for DSA signatures of raw digests of various sizes il y a 6 ans
dsatest.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
dtls_mtu_test.c 83cf7abf8e Update copyright year il y a 6 ans
dtlstest.c f1358634af Add a test for duplicated DTLS records il y a 6 ans
dtlsv1listentest.c 83cf7abf8e Update copyright year il y a 6 ans
ecdsatest.c 5f9f67b9d4 Fix no-engine il y a 6 ans
ecstresstest.c 1212818eb0 Update copyright year il y a 6 ans
ectest.c 9cc570d4c4 Use the new non-curve type specific EC functions internally il y a 6 ans
enginetest.c e3662075c3 Add EVP_PKEY_METHOD redirection test il y a 7 ans
errtest.c 2de108dfa3 Save and restore the Windows error around TlsGetValue. il y a 6 ans
evp_extra_test.c 10d5b415f9 Add a test where we reuse the EVP_PKEY_CTX for two HKDF test runs il y a 6 ans
evp_test.c 6e624a6453 KMAC implementation using EVP_MAC il y a 6 ans
evp_test.h c3fc7d9ac5 Add support for multiple update calls in evp_test il y a 7 ans
exdatatest.c 83cf7abf8e Update copyright year il y a 6 ans
exptest.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
fatalerrtest.c b0edda11cb Update copyright year il y a 6 ans
generate_buildtest.pl 83cf7abf8e Update copyright year il y a 6 ans
generate_ssl_tests.pl cb6afcd6ee Consolidate the locations where we have our internal perl modules il y a 7 ans
gmdifftest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
gosttest.c 1e83954580 Add a GOST test il y a 6 ans
handshake_helper.c a51c9f637c Added missing signature algorithm reflection functions il y a 6 ans
handshake_helper.h b0edda11cb Update copyright year il y a 6 ans
hmactest.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
ideatest.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
igetest.c cbe2964821 Consistent formatting for sizeof(foo) il y a 7 ans
lhash_test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
md2test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
mdc2_internal_test.c 83cf7abf8e Update copyright year il y a 6 ans
mdc2test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
memleaktest.c 789dfc478e Update secmemtest and memeleaktest to use the test infrastructure. il y a 7 ans
modes_internal_test.c 3cb7c5cfef Use void in all function definitions that do not take any arguments il y a 6 ans
ocspapitest.c cb091295a9 Wrap more of ocspapitest.c in OPENSSL_NO_OCSP il y a 7 ans
packettest.c b0edda11cb Update copyright year il y a 6 ans
pbelutest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
pemtest.c 1212818eb0 Update copyright year il y a 6 ans
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
pkey_meth_kdf_test.c 83cf7abf8e Update copyright year il y a 6 ans
pkey_meth_test.c 83cf7abf8e Update copyright year il y a 6 ans
pkits-test.pl 46f4e1bec5 Many spelling fixes/typo's corrected. il y a 7 ans
poly1305_internal_test.c 6738bf1417 Update copyright year il y a 6 ans
rc2test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
rc4test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
rc5test.c 176db6dc51 Use "" not <> for internal/ includes il y a 7 ans
rdrand_sanitytest.c 3cb7c5cfef Use void in all function definitions that do not take any arguments il y a 6 ans
recordlentest.c b0edda11cb Update copyright year il y a 6 ans
rsa_complex.c da5fac72b1 Add a compile time test to verify that openssl/rsa.h and complex.h can il y a 6 ans
rsa_mp_test.c 3bded9cd35 rsa/rsa_gen.c: harmonize keygen's ability with RSA_security_bits. il y a 7 ans
rsa_test.c c486283cb8 Update copyright year il y a 6 ans
run_tests.pl 6ec5fce25e Update copyright year il y a 6 ans
sanitytest.c 1212818eb0 Update copyright year il y a 6 ans
secmemtest.c 8529b15642 test/secmemtest: test secure memory only if it is implemented il y a 6 ans
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... il y a 11 ans
serverinfo2.pem b878afae4b Add a SERVERINFOV2 format test file il y a 7 ans
servername_test.c 1212818eb0 Update copyright year il y a 6 ans
session.pem 6cf2dbd9fa Don't store the ticket nonce in the session il y a 6 ans
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. il y a 8 ans
shlibloadtest.c ea5def1478 Extend dladdr() for AIX, consequence from changes for openssl#6368. il y a 6 ans
siphash_internal_test.c c7af8b0a26 test/siphash_internal_test.c: ensure the SIPHASH structure is zeroed il y a 6 ans
sm2_internal_test.c 00433bad41 Make SM2 ID stick to specification il y a 6 ans
sm4_internal_test.c f19a5ff9ab SM4: Add SM4 block cipher to EVP il y a 7 ans
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. il y a 8 ans
srptest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
ssl_cert_table_internal_test.c 2935f6241c VMS: turn on name mangling for all our programs il y a 6 ans
ssl_test.c dbabc86296 Add a config option to disable automatic config loading il y a 6 ans
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. il y a 8 ans
ssl_test_ctx.c 32097b33bd Change Post Handshake auth so that it is opt-in il y a 6 ans
ssl_test_ctx.h 32097b33bd Change Post Handshake auth so that it is opt-in il y a 6 ans
ssl_test_ctx_test.c b0edda11cb Update copyright year il y a 6 ans
ssl_test_ctx_test.conf cf72c75792 Implement Maximum Fragment Length TLS extension. il y a 7 ans
sslapitest.c fb8c83599e Add a test for SSL_CTX_set0_CA_list()/SSL_CTX_set_client_CA_list() il y a 6 ans
sslbuffertest.c b0edda11cb Update copyright year il y a 6 ans
sslcorrupttest.c 3cb7c5cfef Use void in all function definitions that do not take any arguments il y a 6 ans
ssltest_old.c a51c9f637c Added missing signature algorithm reflection functions il y a 6 ans
ssltestlib.c f1358634af Add a test for duplicated DTLS records il y a 6 ans
ssltestlib.h f1358634af Add a test for duplicated DTLS records il y a 6 ans
stack_test.c 1b3e2bbf64 Add a reserve call to the stack data structure. il y a 7 ans
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). il y a 6 ans
sysdefaulttest.c b0edda11cb Update copyright year il y a 6 ans
test.cnf fec669388c Use 2K RSA and SHA256 in tests il y a 9 ans
test_test.c 3ef97bd8cb Relocate memcmp test. il y a 6 ans
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
testdsa.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testdsapub.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testec-p256.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testecpub-p256.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testp7.pem dcb1ef5c22 Change PKCS#7 test data to take account of removal of il y a 24 ans
testreq2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
testrsapub.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testsid.pem 45f55f6a5b Remove SSLv2 support il y a 10 ans
testutil.h b7af3f1433 Test support for time_t comparisons. il y a 7 ans
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
threadstest.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
time_offset_test.c 83cf7abf8e Update copyright year il y a 6 ans
tls13ccstest.c 3cb7c5cfef Use void in all function definitions that do not take any arguments il y a 6 ans
tls13encryptiontest.c 2935f6241c VMS: turn on name mangling for all our programs il y a 6 ans
tls13secretstest.c 2935f6241c VMS: turn on name mangling for all our programs il y a 6 ans
uitest.c 31a80694d4 [Win] Fix some test method signatures ... il y a 7 ans
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
v3ext.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
v3nametest.c 3cb7c5cfef Use void in all function definitions that do not take any arguments il y a 6 ans
verify_extra_test.c 6ec5fce25e Update copyright year il y a 6 ans
versions.c efe749c840 Refuse to run test_cipherlist unless shared library matches build il y a 6 ans
wpackettest.c c486283cb8 Update copyright year il y a 6 ans
x509_check_cert_pkey_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
x509_dup_cert_test.c ad887416f1 Update the test framework so that the need for test_main is removed. Everything il y a 7 ans
x509_internal_test.c 2935f6241c VMS: turn on name mangling for all our programs il y a 6 ans
x509_time_test.c 83cf7abf8e Update copyright year il y a 6 ans
x509aux.c fd38836ba8 Update copyright year il y a 6 ans

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_equal(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.