aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2019-04-02Correct the checks of module availability in provider test programsRichard Levitte3-18/+8
Previously, the macro OPENSSL_NO_SHARED was defined of the test/p_test module wasn't built, but the provider test programs didn't check that macro. We rename it to OPENSSL_NO_MODULE, since that name describes the situation more than OPENSSL_NO_SHARED does, and use it. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8623)
2019-04-02Configuration / build: make it possible to disable building of modulesRichard Levitte1-1/+1
While we're at it, sort out inconsistencies with the build of modules: - not building shared libraries means not building dynamic engines. However, other modules may still be built. - not having DSO functionality doesn't mean not to build modules (even though we can't use them from apps linked with libraries that are built this way). Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8623)
2019-04-01sslapitest: add test ktls RxBoris Pismenny1-15/+136
Add a unit-test for ktls receive side. Change-Id: I890588681d05fba419f644f6d903be6dc83c9ed5 Signed-off-by: Boris Pismenny <borisp@mellanox.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7848)
2019-03-30fixed public range check in ec_GF2m_simple_oct2pointShane Lontis1-0/+62
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/8607)
2019-03-30issue-8493: Fix for filenames with newlines using openssl dgstPauli1-1/+1
The output format now matches coreutils *dgst tools. [ edited to remove trailing white space ] Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8578)
2019-03-30Add test cases for SM2 cert verificationPaul Yang4-4/+30
This follows #8321 which added the SM2 certificate verification feature. This commit adds some test cases for #8321. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8465)
2019-03-29Correctly initialise PACKET to zero in the tests to avoid possible problemsPauli4-8/+27
with padding bytes. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8611)
2019-03-29Propery initialise struct sslapitest_log_counts to zero using memset.Pauli1-2/+4
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8611)
2019-03-29Add the FIPS related continuous random number generator (CRNG) testing.Pauli1-4/+150
Refer to FIPS 140-2 section 4.9.2 Conditional Tests for details. The check is fairly simplistic, being for the entropy sources to not feed the DRBG the same block of seed material twice in a row. Only the first DRBG in a chain is subject to this check, latter DRBGs are assumed to be safely seeded via the earlier DRBGs. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8599)
2019-03-28coverity fixes for SSKDF + mac_app + kdf test cleanupShane Lontis1-255/+119
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8566)
2019-03-28Fix test builds.Pauli2-1/+1
/usr/include/bits/waitstatus.h includes endian.h under some libc's. This clashes with the new test header file, so rename the latter. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8600)
2019-03-28Detect endian without relying on defined symbols.Pauli2-10/+35
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8572)
2019-03-27Don't allow SHAKE128/SHAKE256 with HMACMatt Caswell1-0/+8
See discussion in github issue #8563 Fixes #8563 Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8584)
2019-03-27Fix a memory leak in ARIA GCMMatt Caswell1-1/+31
Fixes #8567 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8586)
2019-03-27Fix no-ecMatt Caswell1-18/+23
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8588)
2019-03-26style nit fixShane Lontis1-2/+2
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8580)
2019-03-25replaced snprintf with BIO version (for windows builds)Shane Lontis2-4/+4
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8571)
2019-03-21Add a test for EVP_MD_fetchMatt Caswell1-0/+102
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8513)
2019-03-20removed BN_clear NULL checksShane Lontis2-27/+66
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8507)
2019-03-19Single step kdf implementationShane Lontis2-1/+1256
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8230)
2019-03-19Fix resource leak coverity 1443711.Pauli1-5/+4
Free the allocated pointer on error. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8503)
2019-03-19Add -new and -subj options to x509 app for direct cert generationDavid von Oheimb1-1/+20
Complete and improve error output of parse_name() in apps/apps.c Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8193)
2019-03-18add 'Signature Value:' line and correct indentation when printing X.509 ↵David von Oheimb3-45/+48
signature value Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
2019-03-18update reference output of test_x509 in test/certs/cyrillic.*David von Oheimb2-4/+2
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
2019-03-18coverity fixes for bntest.cShane Lontis1-174/+212
Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8508)
2019-03-17test/params_api_test.c: fix size_t assumptionsRichard Levitte1-2/+2
size_t isn't always as large as a int64_t, so the compiler complains about possible data loss. In this case, we are in control, so a simple cast will do. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8497)
2019-03-14Enable pkeyutl to use Ed448 and Ed25519Matt Caswell1-20/+42
With the recent addition of the -rawin option it should be possible for pkeyutl to sign and verify with Ed448 and Ed2559. The main remaining stumbling block is that those algorirthms only support "oneshot" operation. This commit enables pkeyutl to handle that. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8431)
2019-03-13Fix memory leak in ectestNicola Tuveri1-0/+1
Fixes #8462 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8466)
2019-03-13test/params_test.c: use TEST_double_eq to check doublesRichard Levitte1-3/+3
TEST_ulong_eq was used previously because TEST_double_eq didn't exist at the time. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8469)
2019-03-13test/params_test.c: make more global variables staticRichard Levitte1-2/+2
Again, compilers that don't like them being undeclared... Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8469)
2019-03-13test/params_test.c: make construct_api_params() staticRichard Levitte1-1/+1
With enough warning flags, compilers complain when a non-static function hasn't been properly declared... Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8469)
2019-03-13test/params_test.c: Add run-time constructed OSSL_PARAM variantRichard Levitte1-29/+111
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8396)
2019-03-13test/params_test.c: Add API test case, and mixed methodsRichard Levitte1-3/+85
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8396)
2019-03-13test/params_test.c: Add "real world" parameter testingRichard Levitte3-1/+406
test/params_test.c is a program that tries to mimic how a provider and an application would or could handle OSSL_PARAM arrays. For the moment, this program tests a very raw way of handling OSSL_PARAM arrays. It is, however, written in a way that will hopefully make it possible to extend with other methods as APIs arise, and to set up test cases where a "provider" handles the array one way while the "application" handles it another way. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8396)
2019-03-13Fix no-dsoMatt Caswell2-5/+16
Don't try to load external provider modules in tests if we don't have DSO capability Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8459)
2019-03-13Fix various no-* optionsMatt Caswell1-19/+37
no-cmac, no-poly1305 and no-siphash all caused the new test_mac to fail. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8458)
2019-03-12Change OSSL_PARAM_UTF8_STRING_PTR to OSSL_PARAM_UTF8_PTRRichard Levitte1-2/+2
In unrelated code Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8451)
2019-03-12OSSL_PARAM helper functions.Pauli5-1/+654
Provide a number of functions to allow parameters to be set and retrieved in a type safe manner. Functions are provided for many integral types plus double, BIGNUM, UTF8 strings and OCTET strings. All of the integer functions will widen the parameter data as required. This permits a degree of malleability in the parameter definition. For example a type can be changed from a thirty two bit integer to a sixty four bit one without changing application code. Only four and eight byte integral sizes are supported here. A pair of real functions are available for doubles. A pair of functions is available for BIGNUMs. These accept any sized unsigned integer input and convert to/from a BIGNUM. For each OCTET and UTF8 strings, four functions are defined. This provide get and set functionality for string and for pointers to strings. The latter avoiding copies but have other inherent risks. Finally, some utility macros and functions are defined to allow OSSL_PARAM definition arrays to be specified in a simple manner. There are two macro and one function for most types. The exception being BIGNUM, for which there is one macro and one function. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8451)
2019-03-12Rename 'buffer' to 'data' in OSSL_PARAMRichard Levitte3-8/+8
The OSSL_PARAM attribute names |buffer| and |buffer_size| may lead to confusion, as they may make some think that the memory pointed at is an intermediate memory are. This is not generally the case, so we rename |buffer| and |buffer_size| to |data| and |data_size| Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8451)
2019-03-12FIPS 186-4 RSA Generation & ValidationShane Lontis6-1/+788
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6652)
2019-03-11Add provider testsRichard Levitte6-0/+317
Two tests are added, one that tests the internal API, the other tests the public API. Those two tests both test the same provider, which acts both as a built-in provider and as a loadable provider module. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8287)
2019-03-11fix truncation of integers on 32bit AIXShane Lontis3-8/+8
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8417)
2019-03-11openssl app for macs that uses the new EVP_MAC interface (the code inside ↵Shane Lontis1-0/+176
dgst uses EVP_PKEY) Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7661)
2019-03-07Add a simple test for RSA_SSLV23_PADDINGBernd Edlinger1-1/+32
Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/8365)
2019-03-07Add a test for underflow in ecp_nistp521.cMatt Caswell1-0/+69
The previous commit fixed an underflow that may occur in ecp_nistp521.c. This commit adds a test for that condition. It is heavily based on an original test harness by Billy Brumley. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8405)
2019-03-07FIPS AES_GCM IV gen changesShane Lontis3-1/+140
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8393)
2019-03-06constify *_dup() and *i2d_*() and related functions as far as possible, ↵David von Oheimb1-1/+1
introducing DECLARE_ASN1_DUP_FUNCTION Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8029)
2019-03-06Test an overlong ChaCha20-Poly1305 nonceMatt Caswell1-0/+9
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8406)
2019-03-06Make the sparse array code use ossl_uintmax_t as its index rather than size_t.Pauli1-8/+8
This should never reduce the range covered and might increase it on some platforms. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8415)
2019-03-05Configure: make C++ build tests optional and configurableRichard Levitte3-1/+7
Disabled by default Fixes #8360 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8370)