A local copy of OpenSSL from GitHub
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.
 
 
 
 
 
 
Matt Caswell 2256f456bc Make the Boring tests pass 6 years ago
..
certs EC certificate with compression point 6 years ago
ct Verify SCT signatures 7 years ago
d2i-tests add test for CVE-2016-7053 6 years ago
ocsp-tests Fix OCSP checking. 10 years ago
ossl_shim Make the Boring tests pass 6 years ago
recipes Added a test case for RSA_padding_add_PKCS1_PSS_mgf1. 6 years ago
smime-certs spelling fixes, just comments and readme. 6 years ago
ssl-tests Update and add test 6 years ago
testlib Update the kex modes tests to check various HRR scenarios 6 years ago
CAss.cnf RT3809: basicConstraints is critical 6 years ago
CAssdh.cnf Import of old SSLeay release: SSLeay 0.9.0b 24 years ago
CAssdsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 24 years ago
CAssrsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 24 years ago
CAtsa.cnf Use better defaults for TSA. 7 years ago
P1ss.cnf Use 2K RSA and SHA256 in tests 7 years ago
P2ss.cnf Use 2K RSA and SHA256 in tests 7 years ago
README test/README: clarify last test number group 6 years ago
README.external Encourage having external tests in multiple test recipes 6 years ago
README.ssltest.md Add test support for TLS signature types. 6 years ago
Sssdsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 24 years ago
Sssrsa.cnf Import of old SSLeay release: SSLeay 0.9.0b 24 years ago
Uss.cnf Create DSA and ECDSA certificates. 7 years ago
aborttest.c Copyright consolidation 02/10 6 years ago
afalgtest.c Handle inability to create AFALG socket 6 years ago
asn1_internal_test.c Add main() test methods to reduce test boilerplate. 6 years ago
asynciotest.c Let test handshakes stop on certain errors 6 years ago
asynctest.c Add test to show wrong behavior of ASYNC_WAIT_CTX 6 years ago
bad_dtls_test.c Solution proposal for issue #1647. 6 years ago
bftest.c Copyright consolidation 02/10 6 years ago
bio_enc_test.c Fix bio_enc_test 6 years ago
bioprinttest.c Whitespace cleanup in apps 6 years ago
bntest.c bntest: do not stop on first fautl encountered 6 years ago
bntests.pl Make bntest be (mostly) file-based. 6 years ago
bntests.txt bntests.txt: add a couple of checks of possibly negative zero 6 years ago
build.info test: add chacha_internal_test. 6 years ago
casttest.c Copyright consolidation 02/10 6 years ago
chacha_internal_test.c test: add chacha_internal_test. 6 years ago
cipher_overhead_test.c Add unit test for ssl_cipher_get_overhead() 6 years ago
cipherbytes_test.c Tests for SSL_bytes_to_cipher_list() 6 years ago
cipherlist_test.c update test 6 years ago
clienthellotest.c Fix a warning about an uninit var 6 years ago
cms-examples.pl Copyright consolidation: perl files 6 years ago
constant_time_test.c constant time test: include our internal/numbers.h rather than limits.h 6 years ago
crltest.c GH2176: Add X509_VERIFY_PARAM_get_time 6 years ago
ct_test.c Make sure things get deleted when test setup fails in ct_test.c 6 years ago
d2i_test.c Add main() test methods to reduce test boilerplate. 6 years ago
danetest.c Perform DANE-EE(3) name checks by default 6 years ago
danetest.in Perform DANE-EE(3) name checks by default 6 years ago
danetest.pem DANE support for X509_verify_cert() 7 years ago
destest.c spelling fixes, just comments and readme. 6 years ago
dhtest.c Fix the build and tests following constification of DH, DSA, RSA 6 years ago
dsatest.c Fix the build and tests following constification of DH, DSA, RSA 6 years ago
dtls_mtu_test.c Let test handshakes stop on certain errors 6 years ago
dtlstest.c Let test handshakes stop on certain errors 6 years ago
dtlsv1listentest.c Simplify and rename SSL_set_rbio() and SSL_set_wbio() 6 years ago
ecdhtest.c Copyright consolidation 02/10 6 years ago
ecdhtest_cavs.h Whitespace cleanup in apps 6 years ago
ecdsatest.c spelling fixes, just comments and readme. 6 years ago
ectest.c Remove some obsolete/obscure internal define switches: 6 years ago
enginetest.c Copyright consolidation 02/10 6 years ago
evp_extra_test.c Copyright consolidation 02/10 6 years ago
evp_test.c Avoid buffer underflow in evp_test. 6 years ago
evptests.txt Revert rc4test removal, it performs additional tests not in evptests.txt 6 years ago
exdatatest.c Exdata test was never enabled. 6 years ago
exptest.c Change callers to use the new constants. 6 years ago
generate_buildtest.pl Move the building of test/buildtest_*. to be done unconditionally 6 years ago
generate_ssl_tests.pl Reorganize SSL test structures 6 years ago
gmdifftest.c Copyright consolidation 02/10 6 years ago
handshake_helper.c Add compression tests 6 years ago
handshake_helper.h Use the built in boolean type for CompressionExpected 6 years ago
hmactest.c Fix hmac test case 6 6 years ago
ideatest.c Copyright consolidation 02/10 6 years ago
igetest.c Copyright consolidation 02/10 6 years ago
md2test.c check return values for EVP_Digest*() APIs 6 years ago
mdc2_internal_test.c Add main() test methods to reduce test boilerplate. 6 years ago
mdc2test.c check return values for EVP_Digest*() APIs 6 years ago
memleaktest.c Copyright consolidation 02/10 6 years ago
modes_internal_test.c Add main() test methods to reduce test boilerplate. 6 years ago
packettest.c Copyright consolidation 02/10 6 years ago
pbelutest.c Copyright consolidation 02/10 6 years ago
pkcs7-1.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
pkcs7.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
pkey_meth_test.c Add test to check EVP_PKEY method ordering. 6 years ago
pkits-test.pl Remove trailing whitespace from some files. 6 years ago
poly1305_internal_test.c Add main() test methods to reduce test boilerplate. 6 years ago
randtest.c Copyright consolidation 02/10 6 years ago
rc2test.c Copyright consolidation 02/10 6 years ago
rc4test.c Revert rc4test removal, it performs additional tests not in evptests.txt 6 years ago
rc5test.c Copyright consolidation 02/10 6 years ago
recordlentest.c Fix no-comp 6 years ago
rsa_test.c Remove some obsolete/obscure internal define switches: 6 years ago
run_tests.pl Make it possible to select or deselect test groups by number 6 years ago
sanitytest.c Platform sanity test 6 years ago
secmemtest.c Copyright consolidation 02/10 6 years ago
serverinfo.pem Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... 9 years ago
sha1test.c check return values for EVP_Digest*() APIs 6 years ago
sha256t.c check return values for EVP_Digest*() APIs 6 years ago
sha512t.c check return values for EVP_Digest*() APIs 6 years ago
shibboleth.pfx Add PKCS#12 UTF-8 interoperability test. 6 years ago
shlibloadtest.c Fix no-dso (shlibloadtest) 6 years ago
siphash_internal_test.c Add support for parameterized SipHash 6 years ago
smcont.txt test/smcont.txt: trigger assertion in bio_enc.c. 6 years ago
srptest.c Add SRP test vectors from RFC5054 6 years ago
ssl_test.c Use the built in boolean type for CompressionExpected 6 years ago
ssl_test.tmpl test/ssl_test.tmpl: make it work with elderly perl. 6 years ago
ssl_test_ctx.c Use the built in boolean type for CompressionExpected 6 years ago
ssl_test_ctx.h Use the built in boolean type for CompressionExpected 6 years ago
ssl_test_ctx_test.c Use the built in boolean type for CompressionExpected 6 years ago
ssl_test_ctx_test.conf Add compression tests 6 years ago
sslapitest.c Update early data API for writing to unauthenticated clients 6 years ago
sslcorrupttest.c Let test handshakes stop on certain errors 6 years ago
ssltest_old.c Remove some commented out code in the tests 6 years ago
ssltestlib.c Let test handshakes stop on certain errors 6 years ago
ssltestlib.h Let test handshakes stop on certain errors 6 years ago
test.cnf Use 2K RSA and SHA256 in tests 7 years ago
test_main.c Add main() test methods to reduce test boilerplate. 6 years ago
test_main.h Add main() test methods to reduce test boilerplate. 6 years ago
test_main_custom.c Add main() test methods to reduce test boilerplate. 6 years ago
test_main_custom.h Add main() test methods to reduce test boilerplate. 6 years ago
testcrl.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
testdsa.pem Add private/public key conversion tests 8 years ago
testdsapub.pem Add private/public key conversion tests 8 years ago
testec-p256.pem Add private/public key conversion tests 8 years ago
testecpub-p256.pem Add private/public key conversion tests 8 years ago
testp7.pem Change PKCS#7 test data to take account of removal of 22 years ago
testreq2.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
testrsa.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
testrsapub.pem Add private/public key conversion tests 8 years ago
testsid.pem Remove SSLv2 support 8 years ago
testutil.c Add main() test methods to reduce test boilerplate. 6 years ago
testutil.h Add -Wundef to --strict-warnings options. 6 years ago
testx509.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
threadstest.c include/openssl: don't include <windows.h> in public headers. 6 years ago
tls13encryptiontest.c Fix crash in tls13_enc 6 years ago
tls13secretstest.c Implement the early data changes required in tls13_change_cipher_state() 6 years ago
uitest.c UI: fix uitest for VMS 6 years ago
v3-cert1.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
v3-cert2.pem Import of old SSLeay release: SSLeay 0.8.1b 24 years ago
v3ext.c Add some accessor API's 6 years ago
v3nametest.c Copyright consolidation 02/10 6 years ago
verify_extra_test.c Fix some extra or missing whitespaces... 6 years ago
wpackettest.c Add a test for WPACKET_fill_lengths() 6 years ago
x509_internal_test.c Add main() test methods to reduce test boilerplate. 6 years ago
x509_time_test.c X509 time: tighten validation per RFC 5280 6 years ago
x509aux.c test/x509aux.c: Fix argv loop 6 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/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 test/testlib/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 test/testlib/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/Makefile
========================

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):

* among the variables for test executables at the beginning, add a line like
this:

{NAME}TEST= {name}test

* add `$({NAME}TEST)$(EXE_EXT)' to the assignment of EXE:

* add `$({NAME}TEST).o' to the assignment of OBJ:

* add `$({NAME}TEST).c' to the assignment of SRC:

* add the following lines for building the executable:

$({NAME}TEST)$(EXE_EXT): $({NAME}TEST).o $(DLIBCRYPTO)
@target=$({NAME}TEST); $(BUILD_CMD)