You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Pauli 4f94f74898
Coverity 1458438: fix uninitialised memory access.
3 years ago
..
certs Generate new Ed488 certificates 3 years ago
ct Verify SCT signatures 7 years ago
d2i-tests add test for CVE-2016-7053 6 years ago
ocsp-tests Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL 6 years ago
ossl_shim Replace BUF_ string function calls with OPENSSL_ ones 3 years ago
recipes chunk 7 of CMP contribution to OpenSSL 3 years ago
smime-certs Remove RANDFILE settings from configuration files 3 years ago
ssl-tests Check that ed25519 and ed448 are allowed by the security level 3 years ago
testutil Fix common test framework options 3 years ago
CAss.cnf Remove RANDFILE settings from configuration files 3 years ago
CAssdh.cnf Remove RANDFILE settings from configuration files 3 years ago
CAssdsa.cnf Remove RANDFILE settings from configuration files 3 years ago
CAssrsa.cnf Remove RANDFILE settings from configuration files 3 years ago
CAtsa.cnf Remove RANDFILE settings from configuration files 3 years ago
P1ss.cnf Remove RANDFILE settings from configuration files 3 years ago
P2ss.cnf Remove RANDFILE settings from configuration files 3 years ago
README TEST: Add test recipe and help program to test BIO_f_prefix() 3 years ago
README.external Remove unnecessary trailing whitespace 4 years ago
README.ssltest.md Session resume broken switching contexts 6 years ago
Sssdsa.cnf Remove RANDFILE settings from configuration files 3 years ago
Sssrsa.cnf Remove RANDFILE settings from configuration files 3 years ago
Uss.cnf Remove RANDFILE settings from configuration files 3 years ago
aborttest.c Following the license change, modify the boilerplates in test/ 4 years ago
aesgcmtest.c Add EVP_CIPHER_CTX_tag_length() 4 years ago
afalgtest.c Following the license change, modify the boilerplates in test/ 4 years ago
asn1_decode_test.c Update source files for deprecation at 3.0 3 years ago
asn1_dsa_internal_test.c Reorganize private crypto header files 4 years ago
asn1_encode_test.c Update source files for deprecation at 3.0 3 years ago
asn1_internal_test.c Reorganize private crypto header files 4 years ago
asn1_string_table_test.c typo ANS1 -> ASN1 4 years ago
asn1_time_test.c Add duplication APIs to ASN1_TIME and related types 3 years ago
asynciotest.c Fix common test framework options 3 years ago
asynctest.c Deprecate most of debug-memory 3 years ago
bad_dtls_test.c TLS: use EVP for HMAC throughout libssl. 3 years ago
bftest.c Deprecate Low Level Blowfish APIs 3 years ago
bio_callback_test.c Following the license change, modify the boilerplates in test/ 4 years ago
bio_enc_test.c Following the license change, modify the boilerplates in test/ 4 years ago
bio_memleak_test.c Deprecate most of debug-memory 3 years ago
bio_prefix_text.c TEST: Add test recipe and help program to test BIO_f_prefix() 3 years ago
bioprinttest.c fix truncation of integers on 32bit AIX 4 years ago
bn_internal_test.c Reorganize private crypto header files 4 years ago
bn_rand_range.h Test of uniformity of BN_rand_range output. 4 years ago
bntest.c Fix some typos 3 years ago
bntests.pl Following the license change, modify the boilerplates in test/ 4 years ago
build.info chunk 7 of CMP contribution to OpenSSL 3 years ago
casttest.c Deprecate the Low Level CAST APIs 3 years ago
chacha_internal_test.c Reorganize private crypto header files 4 years ago
cipher_overhead_test.c Reorganize local header files 4 years ago
cipherbytes_test.c Following the license change, modify the boilerplates in test/ 4 years ago
cipherlist_test.c Ignore cipher suites when setting cipher list 4 years ago
ciphername_test.c Following the license change, modify the boilerplates in test/ 4 years ago
clienthellotest.c Fix common test framework options 3 years ago
cmp_asn_test.c chunk 6 of CMP contribution to OpenSSL 3 years ago
cmp_ctx_test.c chunk 7 of CMP contribution to OpenSSL 3 years ago
cmp_hdr_test.c fix various formatting nits in CMP contribution chunks 1-6 found by the new util/check-format.pl 3 years ago
cmp_msg_test.c fix various formatting nits in CMP contribution chunks 1-6 found by the new util/check-format.pl 3 years ago
cmp_protect_test.c chunk 7 of CMP contribution to OpenSSL 3 years ago
cmp_status_test.c chunk 5 of CMP contribution to OpenSSL 3 years ago
cmp_testlib.c add missing load_pkimsg() in test/cmp_testlib.c 3 years ago
cmp_testlib.h add missing load_pkimsg() in test/cmp_testlib.c 3 years ago
cmp_vfy_test.c chunk 7 of CMP contribution to OpenSSL 3 years ago
cms-examples.pl Following the license change, modify the boilerplates in test/ 4 years ago
cmsapitest.c Fix common test framework options 3 years ago
conf_include_test.c Remove RANDFILE settings from configuration files 3 years ago
confdump.c Make sure we free the CONF structure allocated by confdump 3 years ago
constant_time_test.c Reorganize local header files 4 years ago
context_internal_test.c Instead of global data store it in an OPENSSL_CTX 4 years ago
crltest.c Fix a memory leak with di2_X509_CRL reuse 4 years ago
ct_test.c Create a new embeddedSCTs1 that's signed using SHA256 3 years ago
ctype_internal_test.c Reorganize private crypto header files 4 years ago
curve448_internal_test.c Implement a stricter ECX_KEY type 3 years ago
d2i_test.c Fix common test framework options 3 years ago
danetest.c Fix common test framework options 3 years ago
danetest.in Following the license change, modify the boilerplates in test/ 4 years ago
danetest.pem DANE support for X509_verify_cert() 7 years ago
default-and-fips.cnf Add fips module integrity check 4 years ago
default-and-legacy.cnf test/recipes/30-test_evp.t: Modify to test with different providers 4 years ago
default.cnf test/recipes/30-test_evp.t: Modify to test with different providers 4 years ago
destest.c Deprecate the low level DES functions. 3 years ago
dhtest.c Add support for DH 'modp' group parameters (RFC 3526) 3 years ago
drbg_cavs_data.h Fix header file include guard names 4 years ago
drbg_cavs_data_ctr.c Following the license change, modify the boilerplates in test/ 4 years ago
drbg_cavs_data_hash.c Following the license change, modify the boilerplates in test/ 4 years ago
drbg_cavs_data_hmac.c Following the license change, modify the boilerplates in test/ 4 years ago
drbg_cavs_test.c Reorganize local header files 4 years ago
drbgtest.c tests/drbgtest: use new RAND_DRBG callback_data API instead of ex_data 3 years ago
drbgtest.h Following the license change, modify the boilerplates in test/ 4 years ago
dsa_no_digest_size_test.c Deprecate the low level DSA functions. 3 years ago
dsatest.c Deprecate the low level DSA functions. 3 years ago
dtls_mtu_test.c Reorganize local header files 4 years ago
dtlstest.c Fix common test framework options 3 years ago
dtlsv1listentest.c Following the license change, modify the boilerplates in test/ 4 years ago
ec_internal_test.c Deprecate the ECDSA and EV_KEY_METHOD functions. 3 years ago
ecdsatest.c Fix no-sm2 3 years ago
ecdsatest.h Fix header file include guard names 4 years ago
ecstresstest.c Remove tab characters from C source files. 4 years ago
ectest.c Add self-test for EC_POINT_hex2point 3 years ago
enginetest.c test/enginetest.c: Make sure no config file is loaded 4 years ago
errtest.c Modernise the ERR functionality further (new functions and deprecations) 4 years ago
evp_extra_test.c DSA: fix the DSA parameter logic in test. 3 years ago
evp_fetch_prov_test.c Deprecate the low level SHA functions. 3 years ago
evp_kdf_test.c Fix no-cmac and no-camellia 3 years ago
evp_pkey_dparams_test.c EC only uses approved curves in FIPS mode. 4 years ago
evp_pkey_provided_test.c Implement Provider side Key Management for X25519 and X448 3 years ago
evp_test.c Fix common test framework options 3 years ago
evp_test.h Following the license change, modify the boilerplates in test/ 4 years ago
exdatatest.c Add CRYPTO_alloc_ex_data() 4 years ago
exptest.c Following the license change, modify the boilerplates in test/ 4 years ago
fatalerrtest.c Fix common test framework options 3 years ago
ffc_internal_test.c Coverity 1458438: fix uninitialised memory access. 3 years ago
fips.cnf Add fips module integrity check 4 years ago
generate_buildtest.pl Following the license change, modify the boilerplates in test/ 4 years ago
generate_ssl_tests.pl Rework the perl fallback functionality 4 years ago
gmdifftest.c Following the license change, modify the boilerplates in test/ 4 years ago
gosttest.c Fix common test framework options 3 years ago
handshake_helper.c TLS: use EVP for HMAC throughout libssl. 3 years ago
handshake_helper.h Fix header file include guard names 4 years ago
hmactest.c Deprecate the low level HMAC functions 3 years ago
http_test.c Generalize the HTTP client so far implemented mostly in crypto/ocsp/ocsp_ht.c 3 years ago
ideatest.c Deprecate the low level IDEA functions. 3 years ago
igetest.c Deprecate the AES_ige_*() functions 3 years ago
keymgmt_internal_test.c Adapt test/keymgmt_internal_test.c to the redesigned interface 3 years ago
legacy.cnf test/recipes/30-test_evp.t: Modify to test with different providers 4 years ago
lhash_test.c Following the license change, modify the boilerplates in test/ 4 years ago
mdc2_internal_test.c Deprecate the low level MDC2 functions. 3 years ago
mdc2test.c Deprecate the low level MDC2 functions. 3 years ago
memleaktest.c test/memleaktest.c: Modify for use with address/leak sanitizer 3 years ago
modes_internal_test.c Deprecate the low level AES functions 3 years ago
namemap_internal_test.c Modify EVP_CIPHER_is_a() and EVP_MD_is_a() to handle legacy methods too 3 years ago
ocspapitest.c Fix common test framework options 3 years ago
ossl_test_endian.h Fix header file include guard names 4 years ago
p_test.c Rename provider and core get_param_types functions 4 years ago
packettest.c Make the PACKET/WPACKET code available to both libcrypto and libssl 4 years ago
param_build_test.c Remove unused ossl_param_bld_to_param_ex() function. 3 years ago
params_api_test.c test/params_api_test.c: Correct the checks of OSSL_PARAM_set_BN() 3 years ago
params_conversion_test.c Fix common test framework options 3 years ago
params_test.c Fix Typos 4 years ago
pbelutest.c Following the license change, modify the boilerplates in test/ 4 years ago
pemtest.c Following the license change, modify the boilerplates in test/ 4 years ago
pkcs7-1.pem
pkcs7.pem
pkey_meth_kdf_test.c Added new EVP/KDF API. 4 years ago
pkey_meth_test.c Following the license change, modify the boilerplates in test/ 4 years ago
pkits-test.pl Following the license change, modify the boilerplates in test/ 4 years ago
poly1305_internal_test.c Add ChaCha related ciphers to default provider 3 years ago
property_test.c Properties: make query cache reference count aware. 3 years ago
provider_internal_test.c Load the config file by default 4 years ago
provider_internal_test.conf.in Add test for the provider configuration module 4 years ago
provider_test.c Change OSSL_PARAM return size to not be a pointer. 4 years ago
rc2test.c Deprecate the low level RC2 functions 3 years ago
rc4test.c Deprecate the low level SHA functions. 3 years ago
rc5test.c Deprecate the low level RC5 functions 3 years ago
rdrand_sanitytest.c Remove extern declarations of OPENSSL_ia32cap_P 4 years ago
recordlentest.c Fix common test framework options 3 years ago
rsa_complex.c Following the license change, modify the boilerplates in test/ 4 years ago
rsa_mp_test.c Added internal functions for easy getting and setting all RSA parameters. 3 years ago
rsa_sp800_56b_test.c RSA generation: Use more bits of 1/sqrt(2) 3 years ago
rsa_test.c FIPS 186-4 RSA Generation & Validation 4 years ago
run_tests.pl Rework test/run_tests.pl to support selective verbosity and TAP copy 4 years ago
sanitytest.c Following the license change, modify the boilerplates in test/ 4 years ago
secmemtest.c Make secure-memory be a config option 3 years ago
serverinfo.pem
serverinfo2.pem Add a SERVERINFOV2 format test file 6 years ago
servername_test.c Fix common test framework options 3 years ago
session.pem Don't store the ticket nonce in the session 5 years ago
shibboleth.pfx Add PKCS#12 UTF-8 interoperability test. 7 years ago
shlibloadtest.c Reorganize public header files (part 1) 4 years ago
siphash_internal_test.c Reorganize private crypto header files 4 years ago
sm2_internal_test.c Deprecate the ECDSA and EV_KEY_METHOD functions. 3 years ago
sm4_internal_test.c Reorganize private crypto header files 4 years ago
smcont.txt test/smcont.txt: trigger assertion in bio_enc.c. 7 years ago
sparse_array_test.c Reorganize private crypto header files 4 years ago
srptest.c Following the license change, modify the boilerplates in test/ 4 years ago
ssl_cert_table_internal_test.c Reorganize local header files 4 years ago
ssl_ctx_test.c Add ssl_ctx_test to test suite. 3 years ago
ssl_test.c Fix common test framework options 3 years ago
ssl_test.tmpl test/ssl_test.tmpl: make it work with elderly perl. 7 years ago
ssl_test_ctx.c Fix end-point shared secret for DTLS/SCTP 4 years ago
ssl_test_ctx.h Fix header file include guard names 4 years ago
ssl_test_ctx_test.c Fix common test framework options 3 years ago
ssl_test_ctx_test.conf Implement Maximum Fragment Length TLS extension. 5 years ago
sslapitest.c Fix no-tls1_3 3 years ago
sslbuffertest.c Fix common test framework options 3 years ago
sslcorrupttest.c Fix common test framework options 3 years ago
sslprovidertest.c Add a test for SSL_CTX_new_with_libctx() 3 years ago
ssltest_old.c Deprecate most of debug-memory 3 years ago
ssltestlib.c Add a test for SSL_CTX_new_with_libctx() 3 years ago
ssltestlib.h Fix header file include guard names 4 years ago
stack_test.c Following the license change, modify the boilerplates in test/ 4 years ago
sysdefault.cnf Apply system_default configuration on SSL_CTX_new(). 5 years ago
sysdefaulttest.c Following the license change, modify the boilerplates in test/ 4 years ago
test.cnf Remove RANDFILE settings from configuration files 3 years ago
test_test.c Fix --strict-warnings build 4 years ago
testcrl.pem
testdsa.pem
testdsapub.pem
testec-p256.pem
testecpub-p256.pem
tested448.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
tested448pub.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
tested25519.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
tested25519pub.pem More testing for CLI usage of Ed25519 and Ed448 keys 3 years ago
testp7.pem
testreq2.pem
testrsa.pem
testrsapub.pem
testsid.pem
testutil.h Fix common test framework options 3 years ago
testx509.pem
threadstest.c Following the license change, modify the boilerplates in test/ 4 years ago
time_offset_test.c Following the license change, modify the boilerplates in test/ 4 years ago
tls13ccstest.c Fix common test framework options 3 years ago
tls13encryptiontest.c Reorganize local header files 4 years ago
tls13secretstest.c Explicitly fetch ciphers and digests in libssl 3 years ago
uitest.c Updated test command line parsing to support commmon commands 4 years ago
v3-cert1.pem
v3-cert2.pem
v3ext.c Fix common test framework options 3 years ago
v3nametest.c Following the license change, modify the boilerplates in test/ 4 years ago
verify_extra_test.c Fix common test framework options 3 years ago
versions.c Following the license change, modify the boilerplates in test/ 4 years ago
wpackettest.c Make the PACKET/WPACKET code available to both libcrypto and libssl 4 years ago
x509_check_cert_pkey_test.c Fix common test framework options 3 years ago
x509_dup_cert_test.c Fix common test framework options 3 years ago
x509_internal_test.c Join the x509 and x509v3 directories 4 years ago
x509_time_test.c coverity 1456639: fix NULL dereference 3 years ago
x509aux.c Fix common test framework options 3 years ago

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/build.info. Please refer to the section "Changes to
test/build.info" below.


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:
60 X509 subsystem
61 BIO subsystem
65 CMP subsystem
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 ../apps/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.