summaryrefslogtreecommitdiffstats
path: root/crypto/dso/dso_dl.c
AgeCommit message (Collapse)Author
2016-11-02Partial revert of 3d8b2ec42 to add back DSO_pathbyaddrMatt Caswell
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> (cherry picked from commit cb6ea61c161e88aa0268c77f308469a67b2ec063)
2016-05-23Use strerror_r()/strerror_s() instead of strerror() where possibleMatt Caswell
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>
2016-05-17Copyright consolidation 07/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-23Remove several unused undocumented functions.Rich Salz
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>
2016-03-22Have only one DSO_METHOD_opensslRich Salz
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>
2016-03-22Make DSO opaque.Rich Salz
This was really easy. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-19Let Configure figure out the diverse shared library and DSO extensionsRichard Levitte
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>
2016-02-04Fix potential buffer overrunDmitry-Me
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-03GH614: Use memcpy()/strdup() when possibleDmitry-Me
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-18Remove the "eay" c-file-style indicatorsRichard Levitte
Since we don't use the eay style any more, there's no point tryint to tell emacs to use it. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-09Continue standardising malloc style for libcryptoMatt Caswell
Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-01free null cleanup finaleRich Salz
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-30Dead code removal: #if 0 conf, dso, pqueue, threadsRich Salz
Mostly, but not completely, debugging print statements. Some old logic kept for internal documentation reasons, perhaps. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2013-09-05misspellings fixes by https://github.com/vlajos/misspell_fixerVeres Lajos
2006-01-02"Relax" prototype and rename DSO_global_lookup_func to DSO_global_lookup.Andy Polyakov
2005-12-30Add DSO_global_lookup_func implementation. See commentary in dso_lib.cAndy Polyakov
for further details.
2005-06-09Eliminate gcc -pedantic warnings.Andy Polyakov
2005-06-09Allow for dso load by explicit path on HP-UX.Andy Polyakov
2005-06-05New function, DSO_pathbyaddr, to find pathname for loaded shared objectAndy Polyakov
by an address within it. Tested on Linux, Solaris, IRIX, Tru64, Darwin, HP-UX, Win32, few BSD flavors...
2003-01-08Third argument to shl_load() is "long address", not a pointer.Lutz Jänicke
(Didn't influence functionality, as on HP-UX 32bit the NULL pointer is a 32bit 0-value and thus is identical to the required 0L.) PR: 443
2002-07-15There's an ongoing project to bring some kind of path selectionRichard Levitte
mechanism to the ENGINE framework. This means there there are going to be new functionality for the DSO part, and ultimately some way of merging two file specifications together. This commit places the merging code into the repository. It's currently not used anywhere, and hasn't been tested at all. It may be full of errors, including syntactical ones. Those will be fixed as promptly as possible.
2001-11-15At least for the two common Unixly DSO loading methods, include theRichard Levitte
system error in the error text.
2001-07-05Use one address consistently.Richard Levitte
2001-04-25This change to the "dl", "dlfcn", and "win32" DSO_METHODs adds the filenameGeoff Thorpe
or symbol name to the error stack in the event a load or bind operation failed.
2000-11-07shl_load() also needs to load along a path given through anRichard Levitte
environment variable, SHLIB_PATH. This change makes that possible.
2000-10-26On HP-UX, at least when shl_* are used, the libraries have theRichard Levitte
extension .sl instead of .so.
2000-10-26For the operating systems where it matters, it is sometimes good toRichard Levitte
translate library names by only adding ".so" to them without prepending them with "lib". Add the flag DSO_FLAG_NAME_TRANSLATION_EXT_ONLY for that purpose.
2000-10-26This changes the behaviour of the DSO mechanism for determining anGeoff Thorpe
appropriate filename translation on the host system. Apart from this point, users should also note that there's a slight change in the API functions too. The DSO now contains its own to-be-converted filename ("dso->filename"), and at the time the DSO loads the "dso->loaded_filename" value is set to the translated form. As such, this also provides an impicit way of determining if the DSO is currently loaded or not. Except, perhaps, VMS .... :-) The various DSO_METHODs have been updated for this mechanism except VMS which is deliberately broken for now, Richard is going to look at how to fit it in (the source comments in there explain "the issue"). Basically, the new callback scheme allows the filename conversion to (a) be turned off altogether through the use of the DSO_FLAG_NO_NAME_TRANSLATION flag, (b) be handled in the default way using the default DSO_METHOD's converter (c) overriden per-DSO by setting the override callback (d) a mix of (b) and (c) - eg. implement an override callback that; (i) checks if we're win32 "if(strstr(dso->meth->name, "win32"))..." and if so, convert "blah" into "blah32.dll" (the default is otherwise to make it "blah.dll"). (ii) default to the normal behaviour - eg. we're not on win32, so finish with (return dso->meth->dso_name_converter(dso,NULL)). (e) be retried a number of times by writing a new DSO_METHOD where the "dso_load()" handler will call the converter repeatedly. Then the custom converter could use state information in the DSO to suggest different conversions or paths each time it is invoked.
2000-10-22Pointer error correctedRichard Levitte
2000-10-08None of the DSO_METHOD's were handling anything except generic messages.Geoff Thorpe
These are now processed inside DSO_ctrl() itself.
2000-06-16Currently the DSO_METHOD interface has one entry point to bind allGeoff Thorpe
"symbols" including functions (of all prototypes( and variables. Whilst casting any function type to another violates ANSI C (I believe), it is a necessary evil in shared-library APIs. However, it is quite conceivable that functions in general and data symbols could very well be represented differently to each other on some systems, as Bodo said; > Since the function/object distinction is a lot more likely to be > important on real-life platforms supporting DSO *and* it can be quite > easily done *and* it will silence compilers that don't like > assignments from void pointers to function pointer variables, why > not do it? I agree. So this change splits the "dso_bind" handler in DSO_METHOD into "dso_bind_var" and "dso_bind_func". Similarly the exported function DSO_bind() has been split in two. I've also put together changes for the various DSO_METHOD implementations, but so far only DSO_dlfcn() has been tested. BTW: The prototype for dso_bind had been a bit strange so I've taken the opportunity to change its shape (in both variations). Also, the README has been updated - particularly with a note about using customised native name-translation for shared libraries (and that you can't do it yet).
2000-04-25This case in the "dso_unload" handlers should not be reported as an error -Geoff Thorpe
if a DSO_load(NULL,...) operation fails, it will have to call DSO_free() on the DSO structure it created and that will filter through to this "unload" call. If the stack size is "< 1", then the library never actually loaded. To keep things clean higher up, I'll treat this as a vacuous case without an error. It makes the error stack easier to follow real world cases, and the error this ignores was only useful for catching bugs in internal code, not mismatched calls from applications (which should be handled in the generic DSO layer).
2000-04-19This change facilitates name translation for shared libraries. TheGeoff Thorpe
technique used is far from perfect and alternatives are welcome. Basically if the translation flag is set, the string is not too long, and there appears to be no path information in the string, then it is converted to whatever the standard should be for the DSO_METHOD in question, eg; blah --> libblah.so on *nix, and blah --> blah.dll on win32. This change also introduces the DSO_ctrl() function that is used by the name translation stuff.
2000-04-06Constification, and a silly mistake in the comments.Geoff Thorpe
2000-04-04This is a set of startup code for the DSO support, it's not yet linked intoGeoff Thorpe
the build process (an upcoming commit no doubt), and is very much *new* code - what that means is that it compiles ok - usually. It certainly doesn't mean it runs well or even properly yet. Please don't muck round with this unless you're looking to help out and hunt bugs. :-) Currently this code doesn't have any support for controlling the "load" behaviour (eg. paths, filename translations, etc). That'll be handled using DSO_ctrl() and various flags, once we work out a sensible set of flags.