summaryrefslogtreecommitdiff
path: root/crypto/dso
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize local header filesDr. Matthias St. Pierre2019-09-287-6/+6
| | | | | | | | | | | | | Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* 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)
* util/mkerr.pl: make it not depend on the function codeRichard Levitte2019-09-121-1/+1
| | | | | | | | | | | | | | | | The output C code was made to use ERR_func_error_string() to see if a string table was already loaded or not. Since this function returns NULL always, this check became useless. Change it to use ERR_reason_error_string() instead, as there's no reason to believe we will get rid of reason strings, ever. To top it off, we rebuild all affected C sources. Fixes #9756 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9756)
* Cygwin: enable the use of Dl_info and dladdr()Richard Levitte2019-07-211-2/+1
| | | | | | | | | | These weren't available in Cygwin at the time our DSO code was written, but things have changed since. Fixes #9385 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9402)
* Regenerate mkerr filesRich Salz2019-07-161-46/+2
| | | | | | Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9058)
* Rework DSO API conditions and configuration optionRichard Levitte2019-04-011-1/+1
| | | | | | | | | | 'no-dso' is meaningless, as it doesn't get any macro defined. Therefore, we remove all checks of OPENSSL_NO_DSO. However, there may be some odd platforms with no DSO scheme. For those, we generate the internal macro DSO_NONE aand use it. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/#8622)
* For the lack of GetModuleHandleEx(), we use DSO route for WinCE.Soujyu Tanaka2019-03-291-1/+107
| | | | | | | | Revert win32_pathbyaddr() which is used in DSO_dsobyaddr(). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8596)
* Fix compilation with `-DREF_PRINT`Anna Henningsen2019-01-131-1/+1
| | | | | | | | CLA: trivial 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/8016)
* Preserve errno on dlopenMatt Caswell2018-12-101-0/+7
| | | | | | | | | | | For the same reasons as in the previous commit we must preserve errno across dlopen calls. Some implementations (e.g. solaris) do not preserve errno even on a successful dlopen call. Fixes #6953 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7680)
* Following the license change, modify the boilerplates in crypto/dso/Richard Levitte2018-12-068-8/+8
| | | | | | | [skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7790)
* Extend dladdr() for AIX, consequence from changes for openssl#6368.Matthias Kraft2018-08-221-10/+29
| | | | | | | | | | | | | 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)
* openssl#5668: corrections after compiling with -qinfo=all:als.Matthias Kraft2018-04-141-9/+12
| | | | | | | | | | | The ongoing discussion about casting or not in PR #5626 had me compiling again with above mentioned flags. Indeed the compiler had to say something about it and I did these changes to silence it again. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5943)
* Add dladdr() for AIXMatthias Kraft2018-03-201-3/+77
| | | | | | | | | | | | | | | | | | | | | | | 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)
* Remove parentheses of return.KaoruToda2017-10-185-84/+84
| | | | | | | | | Since return is inconsistent, I removed unnecessary parentheses and unified them. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4541)
* Since return is inconsistent, I removed unnecessary parentheses andKaoruToda2017-10-095-14/+14
| | | | | | | | | | | unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
* Replace malloc+strcpy with strdupRich Salz2017-09-143-12/+6
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4371)
* Revert "GH614: Use memcpy()/strdup() when possible"Pauli2017-09-142-4/+8
| | | | | | | | This reverts commit a89c9a0d855bce735116acfe147b24e386f566ba. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4357)
* Move the REF_PRINT support from e_os.h to internal/refcount.h.Pauli2017-08-301-1/+1
| | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
* e_os.h removal from other headers and source files.Pauli2017-08-302-2/+4
| | | | | | | | | | | | | Removed e_os.h from all bar three headers (apps/apps.h crypto/bio/bio_lcl.h and ssl/ssl_locl.h). Added e_os.h into the files that need it now. Directly reference internal/nelem.h when required. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4188)
* Put message strings in state filesRich Salz2017-06-121-1/+1
| | | | | | | | | | | | Add "*" as indicator meaning the function/reason is removed, so put an empty string in the function/reason string table; this preserves backward compatibility by keeping the #define's. In state files, trailing backslash means text is on the next line. Add copyright to state files Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3640)
* make error tables const and separate header fileRich Salz2017-06-071-64/+71
| | | | | | | | | | | | | | | | | | | Run perltidy on util/mkerr Change some mkerr flags, write some doc comments Make generated tables "const" when genearting lib-internal ones. Add "state" file for mkerr Renerate error tables and headers Rationalize declaration of ERR_load_XXX_strings Fix out-of-tree build Add -static; sort flags/vars for options. Also tweak code output Moved engines/afalg to engines (from master) Use -static flag Standard engine #include's of errors Don't linewrap err string tables unless necessary Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3392)
* Remove some commented out code in libcryptoMatt Caswell2017-02-281-6/+0
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2774)
* Avoid the call to OPENSSL_malloc with a negative value (then casted to unsigned)Davide Galassi2016-12-101-0/+3
| | | | | | | | CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2021)
* Add support for reference counting using C11 atomicsKurt Roeckx2016-11-172-3/+4
| | | | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1500
* Add a DSO_dsobyaddr() functionMatt Caswell2016-11-021-3/+20
| | | | | | | This works the same way as DSO_pathbyaddr() but instead returns a ptr to the DSO that contains the provided symbol. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Partial revert of 3d8b2ec42 to add back DSO_pathbyaddrMatt Caswell2016-11-027-1/+88
| | | | | | | | | Commit 3d8b2ec42 removed various unused functions. However now we need to use one of them! This commit resurrects DSO_pathbyaddr(). We're not going to resurrect the Windows version though because what we need to achieve can be done a different way on Windows. Reviewed-by: Tim Hudson <tjh@openssl.org>
* VMS: be less picky when loading DSOsRichard Levitte2016-09-111-9/+7
| | | | | | | | | | | The DSO API was picky about casing of symbol names on VMS. There's really no reason to be that picky, it's mostly just annoying. Therefore, we take away the possibility to flag for a choice, and will instead first try to find a symbol with exact case, and failing that, we try to find it in upper case. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Check for errors allocating the error strings.Kurt Roeckx2016-07-201-1/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1330
* Remove/rename some old files.Rich Salz2016-06-011-22/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Raise an Err when CRYPTO_THREAD_lock_new failsFdaSilvaYY2016-06-011-0/+1
| | | | | | | | Add missing error raise call, as it is done everywhere else. and as CRYPTO_THREAD_lock_new don't do it internally. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Use strerror_r()/strerror_s() instead of strerror() where possibleMatt Caswell2016-05-231-2/+6
| | | | | | | | | The function strerror() is not thread safe. We should use strerror_r() where possible, or strerror_s() on Windows. RT#2267 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove unused error/function codes.Rich Salz2016-05-231-7/+1
| | | | | | | | Add script to find unused err/reason codes Remove unused reason codes. Remove entries for unused functions Reviewed-by: Matt Caswell <matt@openssl.org>
* Manual fixes after copyright consolidationRich Salz2016-05-171-51/+7
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation 07/10Rich Salz2016-05-177-329/+35
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* fix tab-space mixed indentationFdaSilvaYY2016-05-091-1/+1
| | | | | | | No code change Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove --classic build entirelyRichard Levitte2016-04-201-45/+0
| | | | | | | | The Unix build was the last to retain the classic build scheme. The new unified scheme has matured enough, even though some details may need polishing. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Copyright consolidation: perl filesRich Salz2016-04-201-1/+2
| | | | | | | | | Add copyright to most .pl files This does NOT cover any .pl file that has other copyright in it. Most of those are Andy's but some are public domain. Fix typo's in some existing files. Reviewed-by: Richard Levitte <levitte@openssl.org>
* VMS: update the properties of symbol searchRichard Levitte2016-03-231-4/+4
| | | | | | | | In this OpenSSL version, we deliver engines with lower case symbol names. The DSO symbol finder must be updated to allow for mixed case symbols or it won't fine them. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Move dso.h to internalRich Salz2016-03-232-6/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove several unused undocumented functions.Rich Salz2016-03-237-378/+7
| | | | | | | | | | Removed the following: DSO_bind_var, DSO_bind_var, DSO_get_default_method, DSO_get_loaded_filename, DSO_get_loaded_filename, DSO_get_method, DSO_new_method, DSO_pathbyaddr, DSO_set_default_method, DSO_set_method, DSO_set_name_converter, DSO_set_name_converter Reviewed-by: Richard Levitte <levitte@openssl.org>
* Small fixups in DSORichard Levitte2016-03-231-1/+1
| | | | | | | - VMS configs had no dso_scheme - Incorrect return of NULL method. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Have only one DSO_METHOD_opensslRich Salz2016-03-229-134/+22
| | | | | | | Instead of have every DSO_METHOD_xxx in all platforms, ensure that only one DSO_METHOD_openssl is available on all platforms. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Make DSO opaque.Rich Salz2016-03-229-31/+118
| | | | | | This was really easy. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte2016-03-211-3/+0
| | | | | | | This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Convert CRYPTO_LOCK_DSO to new multi-threading APIAlessandro Ghedini2016-03-081-10/+27
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH762: Reuse strdup()Dmitry-Me2016-02-291-4/+2
| | | | | Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Always build library object files with shared library cflagsRichard Levitte2016-02-201-1/+1
| | | | | | | | | | | | | | | | This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Let Configure figure out the diverse shared library and DSO extensionsRichard Levitte2016-02-192-19/+8
| | | | | | | | | Then it can pass around the information where it belongs. The Makefile templates pick it up along with other target data, the DSO module gets to pick up the information through crypto/include/internal/dso_conf.h Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte2016-02-181-1/+1
| | | | | | | | | | All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Move to REF_DEBUG, for consistency.Rich Salz2016-02-111-9/+2
| | | | | | | Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT This is also RT 4181 Reviewed-by: Richard Levitte <levitte@openssl.org>