aboutsummaryrefslogtreecommitdiffstats
path: root/test/shlibloadtest.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a no-pinshared optionMatt Caswell2019-01-041-21/+25
| | | | | | | | | | | This option prevents OpenSSL from pinning itself in memory. Fixes #7598 [extended tests] Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7647)
* Test atexit handlersMatt Caswell2019-01-041-7/+51
| | | | | | | | Test that atexit handlers get called properly at process exit, unless we have explicitly asked for them not to be. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7647)
* Don't link shlibloadtest against libcryptoMatt Caswell2019-01-041-49/+90
| | | | | | | | | The whole point of shlibloadtest is to test dynamically loading and unloading the library. If we link shlibloadtest against libcrypto then that might mask potential issues. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7647)
* Fix shlibloadtest to properly execute the dso_ref testMatt Caswell2019-01-041-9/+3
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7647)
* 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)
* Switch to MAJOR.MINOR.PATCH versioning and version 3.0.0-devRichard Levitte2018-12-061-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're strictly use version numbers of the form MAJOR.MINOR.PATCH. Letter releases are things of days past. The most central change is that we now express the version number with three macros, one for each part of the version number: OPENSSL_VERSION_MAJOR OPENSSL_VERSION_MINOR OPENSSL_VERSION_PATCH We also provide two additional macros to express pre-release and build metadata information (also specified in semantic versioning): OPENSSL_VERSION_PRE_RELEASE OPENSSL_VERSION_BUILD_METADATA To get the library's idea of all those values, we introduce the following functions: unsigned int OPENSSL_version_major(void); unsigned int OPENSSL_version_minor(void); unsigned int OPENSSL_version_patch(void); const char *OPENSSL_version_pre_release(void); const char *OPENSSL_version_build_metadata(void); Additionally, for shared library versioning (which is out of scope in semantic versioning, but that we still need): OPENSSL_SHLIB_VERSION We also provide a macro that contains the release date. This is not part of the version number, but is extra information that we want to be able to display: OPENSSL_RELEASE_DATE Finally, also provide the following convenience functions: const char *OPENSSL_version_text(void); const char *OPENSSL_version_text_full(void); The following macros and functions are deprecated, and while currently existing for backward compatibility, they are expected to disappear: OPENSSL_VERSION_NUMBER OPENSSL_VERSION_TEXT OPENSSL_VERSION OpenSSL_version_num() OpenSSL_version() Also, this function is introduced to replace OpenSSL_version() for all indexes except for OPENSSL_VERSION: OPENSSL_info() For configuration, the option 'newversion-only' is added to disable all the macros and functions that are mentioned as deprecated above. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7724)
* Extend dladdr() for AIX, consequence from changes for openssl#6368.Matthias Kraft2018-08-221-1/+6
| | | | | | | | | | | | | The shared libraries are now stored as members of archives, as it is usual on AIX. To correctly address this the custom dladdr()-implementation as well as the dlfcn_load() routine need to be able to cope with such a construct: libname.a(libname.so). Signed-off-by: Matthias Kraft <Matthias.Kraft@softwareag.com> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6872)
* Fix a gcc-8 warning -Wcast-function-typeBernd Edlinger2018-03-311-2/+2
| | | | | | | | | Casting to the generic function type "void (*)(void)" prevents the warning. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/5816)
* test/shlibloadtest.c: make some variables block localRichard Levitte2018-03-231-2/+3
| | | | | | | | | myDSO_dsobyaddr and myDSO_free are only used in a narrow block of code, and can therefore be made local to that block. Otherwise, some compilers may warn that they are unused. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5733)
* test/shlibloadtest.c: fix various errorsRichard Levitte2018-03-231-4/+4
| | | | | | | | | These errors were hidden because compiling this file didn't get the macros derived from the dso_scheme attribute, and therefore, some code never got compiled. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5733)
* Include "internal/dso_conf.h" where needed and appropriateRichard Levitte2018-03-231-0/+1
| | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5733)
* Add dladdr() for AIXMatthias Kraft2018-03-201-2/+47
| | | | | | | | | | | | | | | | | | | | | | | Although it deviates from the actual prototype of DSO_dsobyaddr(), this is now ISO C compliant and gcc -Wpedantic accepts the code. Added DATA segment checking to catch ptrgl virtual addresses. Avoid memleaks with every AIX/dladdr() call. Removed debug-fprintf()s. Added test case for DSO_dsobyaddr(), which will eventually call dladdr(). Removed unecessary AIX ifdefs again. The implementation can only lookup function symbols, no data symbols. Added PIC-flag to aix*-cc build targets. As AIX is missing a dladdr() implementation it is currently uncertain our exit()-handlers can still be called when the application exits. After dlclose() the whole library might have been unloaded already. Signed-off-by: Matthias Kraft <makr@gmx.eu> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5668)
* Update copyright yearMatt Caswell2018-03-201-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5689)
* Stop test/shlibloadtest.c from failing in a regression testRichard Levitte2018-03-191-1/+13
| | | | | | | | | When doing a regression test, it's obvious that the version test/shlibloadtest is built for will not be the same as the library version. So we change the test to check for assumed compatibility. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5619)
* Remove OPENSSL_USE_NODELETE guards in shlibloadtestMatt Caswell2018-03-071-6/+0
| | | | | | | | | | | | | | | | | | | | | | | PR #3399 converted shlibloadtest to the new test framework. It also seemed to add some `OPENSSL_USE_NODELETE` guards to the library unloading part of the test. This part was added in a commit with this description: Review feedback; use single main, #ifdef ADD_TEST Suppose OPENSSL_USE_NODELETE (via Nick Reilly) Strangely though there doesn't seem to be any relevant review feedback in that PR that could justify the addition of those guards. The guards do not appear in 1.1.0. Having the guards changes the nature of the test, so that we only test library unloading on platforms where OPENSSL_USE_NODELETE is set (Linux and Windows). I can't think of any good reason for this and as it doesn't seem to be necessary in 1.1.0 so I think we should remove them. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5530)
* Update the test framework so that the need for test_main is removed. EverythingPauli2017-07-271-12/+10
| | | | | | | | | | | | | | | | | | | | 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)
* Add a missing break in test/shlibloadtest.cBernd Edlinger2017-06-161-1/+3
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3661)
* Review feedback; use single main, #ifdef ADD_TESTRich Salz2017-05-121-20/+25
| | | | | | Suppose OPENSSL_USE_NODELETE (via Nick Reilly) Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3399)
* Convert shlibloadtest to new frameworkRich Salz2017-05-121-144/+108
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3399)
* Fix no-dso (shlibloadtest)Richard Levitte2016-11-101-4/+3
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Don't assume to know the shared library extensionRichard Levitte2016-11-041-16/+3
| | | | | | | | | | test/shlibloadtest.c assumes all Unix style platforms use .so as shared library extension. This is not the case for Mac OS X, which uses .dylib. Instead of this, have the test recipe find out the extension from configuration data. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1844)
* test/shlibloadtest: small fixesRichard Levitte2016-11-031-6/+8
| | | | | | | - Make sure to initialise SHLIB variables - Make sure to make local variables static Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1838)
* Add a test to dynamically load and unload the librariesMatt Caswell2016-11-021-0/+243
This should demonstrate that the atexit() handling is working properly (or at least not crashing) on process exit. Reviewed-by: Tim Hudson <tjh@openssl.org>