Shane Lontis 4343a4187d Add self tests for rsa encryption il y a 4 ans
..
certs b3c5aadf4c apps: make use of OSSL_STORE for generalized certs and CRLs loading il y a 4 ans
ct 433deaffce Use .cnf for config files, not .conf il y a 4 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 823a113574 Fix API rename issue in shim layer that calls EVP_MAC_CTX_set_params il y a 4 ans
recipes 4343a4187d Add self tests for rsa encryption il y a 4 ans
smime-certs 0f84cbc3e2 Update copyright year il y a 4 ans
ssl-tests 8ca6c6669f Test mte with stitched ciphersuites in TLSv1.0 il y a 4 ans
testutil 1bb6f70da3 testutil: Add provider.c with test_get_libctx(), to use at least for SSL and CMP il y a 4 ans
CAtsa.cnf 23f3993127 Remove RANDFILE settings from configuration files il y a 5 ans
README-dev.md 036cbb6bbf Rename NOTES*, README*, VERSION, HACKING, LICENSE to .md or .txt il y a 4 ans
README-external.md 1dc1ea182b Fix many MarkDown issues in {NOTES*,README*,HACKING,LICENSE}.md files il y a 4 ans
README.md cb9bb7350d 99-test_fuzz.t: Clean up and re-organize such that sub-tests could be split easily il y a 4 ans
README.ssltest.md 257e9d03b0 Fix issues reported by markdownlint il y a 4 ans
aborttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
acvp_test.c 0ab18e7924 Add EVP signature with libctx methods. il y a 4 ans
acvp_test.inc 4f2271d58a Add ACVP fips module tests il y a 4 ans
aesgcmtest.c 37322687b0 Retire EVP_CTRL_GET_IV il y a 4 ans
afalgtest.c e39e295e20 Update copyright year il y a 4 ans
asn1_decode_test.c 936c2b9e93 Update source files for deprecation at 3.0 il y a 5 ans
asn1_dsa_internal_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
asn1_encode_test.c 936c2b9e93 Update source files for deprecation at 3.0 il y a 5 ans
asn1_internal_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
asn1_string_table_test.c 275a7b9e5e typo ANS1 -> ASN1 il y a 6 ans
asn1_time_test.c 33388b44b6 Update copyright year il y a 4 ans
asynciotest.c 33388b44b6 Update copyright year il y a 4 ans
asynctest.c e39e295e20 Update copyright year il y a 4 ans
bad_dtls_test.c 865adf97c9 Revert "The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*" il y a 4 ans
bftest.c 33388b44b6 Update copyright year il y a 4 ans
bio_callback_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
bio_enc_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
bio_memleak_test.c 454afd9866 Update copyright year il y a 4 ans
bio_prefix_text.c 51a7c4b5f2 TEST: Add test recipe and help program to test BIO_f_prefix() il y a 4 ans
bioprinttest.c c4683009ad TEST: Adjust test/bioprinttest.c to behave like the testutil routines il y a 4 ans
bn_internal_test.c 454afd9866 Update copyright year il y a 4 ans
bn_rand_range.h 5d2f3e4a6c Test of uniformity of BN_rand_range output. il y a 5 ans
bntest.c 08073700cc NonStop port updates for 3.0.0. il y a 4 ans
bntests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
build.info f0c62c5328 TEST: Add a test of EC key generation with encoding spec il y a 4 ans
ca-and-certs.cnf 4e6e57cfcd Cleanup cert config files for tests il y a 4 ans
casttest.c 33388b44b6 Update copyright year il y a 4 ans
chacha_internal_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
cipher_overhead_test.c 706457b7bd Reorganize local header files il y a 5 ans
cipherbytes_test.c 6ac1cd10ba Fix safestack issues in ssl.h il y a 4 ans
cipherlist_test.c 6ac1cd10ba Fix safestack issues in ssl.h il y a 4 ans
ciphername_test.c 6ac1cd10ba Fix safestack issues in ssl.h il y a 4 ans
clienthellotest.c 33388b44b6 Update copyright year il y a 4 ans
cmactest.c a370ff8daa Add a CMAC test il y a 4 ans
cmp_asn_test.c 3dbc5156b0 chunk 6 of CMP contribution to OpenSSL il y a 5 ans
cmp_client_test.c 798f932980 Fix safestack issues in cmp.h il y a 4 ans
cmp_ctx_test.c 798f932980 Fix safestack issues in cmp.h il y a 4 ans
cmp_hdr_test.c 798f932980 Fix safestack issues in cmp.h il y a 4 ans
cmp_msg_test.c 798f932980 Fix safestack issues in cmp.h il y a 4 ans
cmp_protect_test.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
cmp_server_test.c ab28b59064 Add libctx/provider support to cmp_server_test il y a 4 ans
cmp_status_test.c b4780134df Fix safestack issues in asn1.h il y a 4 ans
cmp_testlib.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
cmp_testlib.h 9afa0748cf TEST: Fix CMP tests so they load keys in the current library context il y a 4 ans
cmp_vfy_test.c 98c35dc48d Fix safestack issues in crmf.h il y a 4 ans
cms-examples.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
cmsapitest.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
conf_include_test.c 23f3993127 Remove RANDFILE settings from configuration files il y a 5 ans
confdump.c e74e562f1c Fix safestack issues in conf.h il y a 4 ans
constant_time_test.c 706457b7bd Reorganize local header files il y a 5 ans
context_internal_test.c 1aedc35fd6 Instead of global data store it in an OPENSSL_CTX il y a 5 ans
crltest.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
ct_test.c 9d01ac71a0 Fix safestack issues in ct.h il y a 4 ans
ctype_internal_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
curve448_internal_test.c 33388b44b6 Update copyright year il y a 4 ans
d2i_test.c 33388b44b6 Update copyright year il y a 4 ans
danetest.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
danetest.in 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
danetest.pem 170b735820 DANE support for X509_verify_cert() il y a 8 ans
data.txt 036cbb6bbf Rename NOTES*, README*, VERSION, HACKING, LICENSE to .md or .txt il y a 4 ans
data2.txt 036cbb6bbf Rename NOTES*, README*, VERSION, HACKING, LICENSE to .md or .txt il y a 4 ans
default-and-fips.cnf 1cd2c1f857 Update some nits around the FIPS module il y a 4 ans
default-and-legacy.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
default.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
defltfips_test.c bfa6aaab45 Test that EVP_default_properties_is_fips_enabled() works early il y a 4 ans
destest.c 33388b44b6 Update copyright year il y a 4 ans
dhtest.c 33388b44b6 Update copyright year il y a 4 ans
drbg_cavs_data.h ae4186b004 Fix header file include guard names il y a 5 ans
drbg_extra_test.h a6ed19dc9a Amend references to "OpenSSL license" il y a 4 ans
drbgtest.c 4f14a378f8 prov/drbg: cleanup some RAND_DRBG leftovers il y a 4 ans
drbgtest.h 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
dsa_no_digest_size_test.c 33388b44b6 Update copyright year il y a 4 ans
dsatest.c 023b188ca5 Make EVP_PKEY_CTX_[get|set]_group_name work for DH too il y a 4 ans
dtls_mtu_test.c 6ac1cd10ba Fix safestack issues in ssl.h il y a 4 ans
dtlstest.c 33388b44b6 Update copyright year il y a 4 ans
dtlsv1listentest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
ec_internal_test.c 33388b44b6 Update copyright year il y a 4 ans
ecdsatest.c f844f9eb44 Rename FIPS_MODE to FIPS_MODULE il y a 4 ans
ecdsatest.h ae4186b004 Fix header file include guard names il y a 5 ans
ecstresstest.c dd6b270618 Remove tab characters from C source files. il y a 5 ans
ectest.c c0f39ded68 Add Explicit EC parameter support to providers. il y a 4 ans
endecode_test.c 1251cddf8d TEST: modify test/endecode_test.c to not use legacy keys il y a 4 ans
enginetest.c 41bbba5375 EVP: deprecate the EVP_X_meth_ functions. il y a 4 ans
errtest.c 17b7f89684 TEST: fix test/errtest.c il y a 4 ans
evp_extra_test.c f0c62c5328 TEST: Add a test of EC key generation with encoding spec il y a 4 ans
evp_extra_test2.c e31eda006f TEST: Add test to exercise OPENSSL_CTX_set0_default() il y a 4 ans
evp_fetch_prov_test.c 41bbba5375 EVP: deprecate the EVP_X_meth_ functions. il y a 4 ans
evp_kdf_test.c 660c534435 Revert "kdf: make function naming consistent." il y a 4 ans
evp_libctx_test.c 24c4ea958e Fix stacks of OPENSSL_STRING, OPENSSL_CSTRING and OPENSSL_BLOCK il y a 4 ans
evp_pkey_dparams_test.c 10c25644e3 EC only uses approved curves in FIPS mode. il y a 5 ans
evp_pkey_provided_test.c ece9304c96 Rename OSSL_SERIALIZER / OSSL_DESERIALIZER to OSSL_ENCODE / OSSL_DECODE il y a 4 ans
evp_test.c ec0ce188f4 EVP: Centralise fetching error reporting il y a 4 ans
evp_test.h 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
exdatatest.c 00c405b365 Update copyright year il y a 4 ans
exptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
fatalerrtest.c 33388b44b6 Update copyright year il y a 4 ans
ffc_internal_test.c 63794b048c Add multiple fixes for ffc key generation using invalid p,q,g parameters. il y a 4 ans
filterprov.c 363b1e5dae Make the naming scheme for dispatched functions more consistent il y a 4 ans
fips-and-base.cnf 39d9be390a Add CLI tests in FIPS configuration il y a 4 ans
fips.cnf bfa6aaab45 Test that EVP_default_properties_is_fips_enabled() works early il y a 4 ans
generate_buildtest.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
generate_ssl_tests.pl 33388b44b6 Update copyright year il y a 4 ans
gmdifftest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
gosttest.c 5e30f2fd58 Use a non-default libctx in sslapitest il y a 4 ans
handshake_helper.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
handshake_helper.h ae4186b004 Fix header file include guard names il y a 5 ans
hexstr_test.c f32af93c92 Fix ERR_print_errors so that it matches the documented format in doc/man3/ERR_error_string.pod il y a 4 ans
hmactest.c 33388b44b6 Update copyright year il y a 4 ans
http_test.c e74e562f1c Fix safestack issues in conf.h il y a 4 ans
ideatest.c 33388b44b6 Update copyright year il y a 4 ans
igetest.c 7573fe1af5 Deprecate the AES_ige_*() functions il y a 5 ans
insta.priv.pem 8d9a4d833f Chunk 11 of CMP contribution to OpenSSL: CMP command-line interface il y a 4 ans
insta_ca.cert.pem 8d9a4d833f Chunk 11 of CMP contribution to OpenSSL: CMP command-line interface il y a 4 ans
keymgmt_internal_test.c 33388b44b6 Update copyright year il y a 4 ans
legacy.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
lhash_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
mdc2_internal_test.c 33388b44b6 Update copyright year il y a 4 ans
mdc2test.c 33388b44b6 Update copyright year il y a 4 ans
memleaktest.c ea7a952c8a test/memleaktest.c: Modify for use with address/leak sanitizer il y a 5 ans
modes_internal_test.c 33388b44b6 Update copyright year il y a 4 ans
namemap_internal_test.c c720fc35f4 namemap: change ossl_namemap_empty() to do what the documentation says. il y a 4 ans
ocspapitest.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
ossl_store_test.c 97f7a6d42e Fix coverity issue: CID 1466482 - Resource leak in OSSL_STORE_SEARCH_by_key_fingerprint() il y a 4 ans
p_test.c 363b1e5dae Make the naming scheme for dispatched functions more consistent il y a 4 ans
packettest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
param_build_test.c 5fdaa38feb params: add OSSL_PARAM helpers for time_t. il y a 4 ans
params_api_test.c e23d850ff3 Add and use internal header that implements endianness check il y a 4 ans
params_conversion_test.c 33388b44b6 Update copyright year il y a 4 ans
params_test.c 33388b44b6 Update copyright year il y a 4 ans
pbelutest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
pemtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
pkcs12_format_test.c c5ec6dcf0b Add new APIs to get PKCS12 secretBag OID and value il y a 4 ans
pkcs12_helper.c add3392727 Fix safestack issues in pkcs12.h il y a 4 ans
pkcs12_helper.h c5ec6dcf0b Add new APIs to get PKCS12 secretBag OID and value il y a 4 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 194de849cc Extend the EVP_PKEY KDF to KDF provider bridge to also support Scrypt il y a 4 ans
pkey_meth_test.c 0f84cbc3e2 Update copyright year il y a 4 ans
pkits-test.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
poly1305_internal_test.c 3d5a7578e0 Add ChaCha related ciphers to default provider il y a 5 ans
property_test.c 454afd9866 Update copyright year il y a 4 ans
provider_fallback_test.c f995e5bdcd TEST: Add provider_fallback_test, to test aspects of fallback providers il y a 4 ans
provider_internal_test.c 29dc6e00f2 Load the config file by default il y a 5 ans
provider_internal_test.cnf.in 433deaffce Use .cnf for config files, not .conf il y a 4 ans
provider_status_test.c 04cb5ec0b7 Add 'on demand self test' and status test to providers il y a 4 ans
provider_test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. il y a 5 ans
proxy.cnf 4e6e57cfcd Cleanup cert config files for tests il y a 4 ans
rand_status_test.c 4516bf7422 rand: instantiate the DRBGs upon first use. il y a 4 ans
rc2test.c 33388b44b6 Update copyright year il y a 4 ans
rc4test.c 33388b44b6 Update copyright year il y a 4 ans
rc5test.c 33388b44b6 Update copyright year il y a 4 ans
rdrand_sanitytest.c 24fd8541d4 Remove extern declarations of OPENSSL_ia32cap_P il y a 5 ans
recordlentest.c 33388b44b6 Update copyright year il y a 4 ans
rsa_complex.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
rsa_mp_test.c 33388b44b6 Update copyright year il y a 4 ans
rsa_sp800_56b_test.c 4f2271d58a Add ACVP fips module tests il y a 4 ans
rsa_test.c 33388b44b6 Update copyright year il y a 4 ans
run_tests.pl ef0f01c0af Avoid uninitialised variable warning for jobs il y a 4 ans
sanitytest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
secmemtest.c 33388b44b6 Update copyright year il y a 4 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 33388b44b6 Update copyright year il y a 4 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 50cd4768c6 Reorganize public header files (part 1) il y a 5 ans
siphash_internal_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
sm2_internal_test.c 33388b44b6 Update copyright year il y a 4 ans
sm4_internal_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. il y a 8 ans
sparse_array_test.c 25f2138b0a Reorganize private crypto header files il y a 5 ans
srptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
ssl_cert_table_internal_test.c 706457b7bd Reorganize local header files il y a 5 ans
ssl_ctx_test.c 454afd9866 Update copyright year il y a 4 ans
ssl_test.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. il y a 8 ans
ssl_test_ctx.c e74e562f1c Fix safestack issues in conf.h il y a 4 ans
ssl_test_ctx.h 6725682d77 Add X509 related libctx changes. il y a 4 ans
ssl_test_ctx_test.c 06cee80a84 testutil: Make SETUP_TEST_FIXTURE return 0 on fixture == NULL il y a 4 ans
ssl_test_ctx_test.cnf 433deaffce Use .cnf for config files, not .conf il y a 4 ans
sslapitest.c 22fbfe6a7d Fix safestack issues in srp.h il y a 4 ans
sslbuffertest.c 33388b44b6 Update copyright year il y a 4 ans
sslcorrupttest.c 6ac1cd10ba Fix safestack issues in ssl.h il y a 4 ans
ssltest_old.c 24c4ea958e Fix stacks of OPENSSL_STRING, OPENSSL_CSTRING and OPENSSL_BLOCK il y a 4 ans
ssltestlib.c 0d52ede716 Fix error path in int create_ssl_ctx_pair() il y a 4 ans
ssltestlib.h 33388b44b6 Update copyright year il y a 4 ans
stack_test.c 225c9660a5 Ignore unused return values from some sk_*() macros il y a 4 ans
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). il y a 6 ans
sysdefaulttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
test.cnf d462b5ff21 Add -section option to 'req' command il y a 4 ans
test_test.c e0249827b3 Fix --strict-warnings build il y a 5 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
tested25519.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys il y a 5 ans
tested25519pub.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys il y a 5 ans
tested448.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys il y a 5 ans
tested448pub.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys il y a 5 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 10203a3472 Support writing RSA keys using the traditional format again il y a 4 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 1bb6f70da3 testutil: Add provider.c with test_get_libctx(), to use at least for SSL and CMP il y a 4 ans
testx509.pem 1e41dadfa7 Extend X509 cert checks and error reporting in v3_{purp,crld}.c and x509_{set,vfy}.c il y a 4 ans
threadstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
time_offset_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
tls-provider.c bfa6aaab45 Test that EVP_default_properties_is_fips_enabled() works early il y a 4 ans
tls13ccstest.c 33388b44b6 Update copyright year il y a 4 ans
tls13encryptiontest.c ec27e619e8 Move MAC removal responsibility to the various protocol "enc" functions il y a 4 ans
tls13secretstest.c 33388b44b6 Update copyright year il y a 4 ans
uitest.c f84de16f39 apps_ui.c: Improve error handling and return value of setup_ui_method() il y a 4 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
v3_ca_exts.cnf 4acd484d55 Make x509 -force_pubkey test case with self-issued cert more realistic il y a 4 ans
v3ext.c 33388b44b6 Update copyright year il y a 4 ans
v3nametest.c e144fd36ce Fix safestack issues in x509v3.h il y a 4 ans
verify_extra_test.c e6623cfbff Fix safestack issues in x509.h il y a 4 ans
versions.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 6 ans
wpackettest.c 12cbb8e049 WPACKET: don't write DER length when we don't want to il y a 4 ans
x509_check_cert_pkey_test.c 33388b44b6 Update copyright year il y a 4 ans
x509_dup_cert_test.c 33388b44b6 Update copyright year il y a 4 ans
x509_internal_test.c 878dc8dd95 Join the x509 and x509v3 directories il y a 5 ans
x509_time_test.c 33388b44b6 Update copyright year il y a 4 ans
x509aux.c 33388b44b6 Update copyright year il y a 4 ans

README-dev.md

Guidelines for test developers

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.

Note that the test infrastructure automatically sets up all required environment variables (such as OPENSSL_MODULES, OPENSSL_CONF, etc.) for the tests. Individual tests may choose to override the default settings as required.