summaryrefslogtreecommitdiff
path: root/test/asn1_internal_test.c
Commit message (Collapse)AuthorAgeFilesLines
* OBJ_nid2obj(): Return UNDEF object instead of NULL for NID_undefTomas Mraz2023-03-231-0/+11
| | | | | | | | | | | Fixes a regression from 3.0 from the obj creation refactoring. Fixes #20555 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20556)
* Allow OBJ_create() to create an OBJ and NID with a NULL OIDRichard Levitte2022-12-131-0/+65
| | | | | | | | | We already permit this in crypto/objects/objects.txt, but not programatically, although being able to do so programatically would be beneficial. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19876)
* TEST: Check that i2d refuses to encode non-optional items with no contentRichard Levitte2021-07-101-0/+44
| | | | | | | | The test case creates an RSA public key and tries to pass it through i2d_PrivateKey(). This SHOULD fail, since the private bits are missing. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16036)
* Update copyright yearMatt Caswell2021-04-081-1/+1
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14801)
* Add tests for the limited Unicode code point rangeBeat Bolli2021-03-181-0/+41
| | | | | | | | Signed-off-by: Beat Bolli <dev@drbeat.li> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14185)
* Reorganize private crypto header filesDr. Matthias St. Pierre2019-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there are two different directories which contain internal header files of libcrypto which are meant to be shared internally: While header files in 'include/internal' are intended to be shared between libcrypto and libssl, the files in 'crypto/include/internal' are intended to be shared inside libcrypto only. To make things complicated, the include search path is set up in such a way that the directive #include "internal/file.h" could refer to a file in either of these two directoroes. This makes it necessary in some cases to add a '_int.h' suffix to some files to resolve this ambiguity: #include "internal/file.h" # located in 'include/internal' #include "internal/file_int.h" # located in 'crypto/include/internal' This commit moves the private crypto headers from 'crypto/include/internal' to 'include/crypto' As a result, the include directives become unambiguous #include "internal/file.h" # located in 'include/internal' #include "crypto/file.h" # located in 'include/crypto' hence the superfluous '_int.h' suffixes can be stripped. The files 'store_int.h' and 'store.h' need to be treated specially; they are joined into a single file. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* Following the license change, modify the boilerplates in test/Richard Levitte2018-12-061-1/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7767)
* Update copyright yearMatt Caswell2018-09-111-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7176)
* test/asn1_internal_test.c: silence the new check for the ASN1 method tableDr. Matthias St. Pierre2018-08-071-4/+2
| | | | | | | | | | | In 38eca7fed09a a new check for the pem_str member of the entries of the ASN1 method table was introduced. Because the test condition was split into two TEST_true(...) conditions, the test outputs error diagnostics for all entries which have pem_str != NULL. This commit joins the two test conditions into a single condition. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6888)
* Make EVP_PKEY_asn1_new() stricter with its inputRichard Levitte2018-08-071-1/+19
| | | | | | Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6880)
* Fix AppVeyor/VC build failureFdaSilvaYY2017-11-161-2/+2
| | | | | | | | | ..\test\asn1_internal_test.c(96): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int (__cdecl *)(void)' Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4744)
* Use "" not <> for internal/ includesRich Salz2017-08-221-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4217)
* Remove tests dependence on e_os.hPauli2017-08-181-1/+1
| | | | | | | | | | | | Apart from ssltest_old.c, the test suite relied on e_os.h for the OSSL_NELEM macro and nothing else. The ssltest_old.c also requires EXIT and some socket macros. Create a new header to define the OSSL_NELEM macro and use that instead. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4186)
* Update the test framework so that the need for test_main is removed. EverythingPauli2017-07-271-1/+2
| | | | | | | | | | | | | | | | | | | | that needed test_main now works using the same infrastructure as tests that used register_tests. This meant: * renaming register_tests to setup_tests and giving it a success/failure return. * renaming the init_test function to setup_test_framework. * renaming the finish_test function to pulldown_test_framework. * adding a user provided global_init function that runs before the test frame work is initialised. It returns a failure indication that stops the stest. * adding helper functions that permit tests to access their command line args. * spliting the BIO initialisation and finalisation out from the test setup and teardown. * hiding some of the now test internal functions. * fix the comments in testutil.h Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3953)
* Address double error and OSSLzu comments.Pauli2017-06-191-6/+5
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3710)
* Update tests to avoid printf to stdout/stderr when running as test cases.Pauli2017-06-191-11/+12
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3710)
* Adapt all test programsRichard Levitte2017-04-241-1/+0
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3243)
* VMS: remove name mangling guards around inclusion of internalsRichard Levitte2017-04-201-10/+0
| | | | | | | Note that these guards are still needed around local header files that declare linkable symbols. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3259)
* VMS: Fix internals test programsRichard Levitte2017-04-181-0/+10
| | | | | | | | | | | The internals test programs access header files that aren't guarded by the public __DECC_INCLUDE_PROLOGUE.H and __DECC_INCLUDE_EPILOGUE.H files, and therefore have no idea what the naming convention is. Therefore, we need to specify that explicitely in the internals test programs, since they aren't built with the same naming convention as the library they belong with. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3247)
* Test infrastructure additions.Pauli2017-03-291-0/+1
| | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3011)
* Add main() test methods to reduce test boilerplate.Emilia Kasper2016-11-091-3/+2
| | | | | | | | | | | | | | | | | | Simple tests only need to implement register_tests(). Tests that need a custom main() should implement test_main(). This will be wrapped in a main() that performs common setup/teardown (currently crypto-mdebug). Note that for normal development, enable-asan is usually sufficient for detecting leaks, and more versatile. enable-crypto-mdebug is stricter as it will also insist that all static variables be freed. This is useful for debugging library init/deinit; however, it also means that test_main() must free everything it allocates. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Don't create fixtures for simple testsEmilia Kasper2016-11-041-62/+11
| | | | | | | | | | The test fixtures are (meant to be) useful for sharing common setup. Don't bother when we don't have any setup/teardown. This only addresses simple tests. Parameterized tests (ADD_ALL_TESTS) will be made more user-friendly in a follow-up. Reviewed-by: Rich Salz <rsalz@openssl.org>
* testutil: always print errors on failureEmilia Kasper2016-11-041-2/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Convert asn1 selftests (a_strnid and ameth_lib) into internal testRichard Levitte2016-11-031-0/+152
Reviewed-by: Emilia Käsper <emilia@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1789)