Look at the BIO section of the library manpages. It provides the I/O
abstraction that openssl uses throughout.
-Kyle H
Sent from my iPhone
On Jan 24, 2008, at 13:58, OpenSSL <[EMAIL PROTECTED]> wrote:
>> Sure you can. At least you can if ...
Thanks, but I'm looking for a clean solution, and foremost that
means a portable solution. What you suggest is not portable.
Needless to say, there are numerous platforms which don't provide
usable implementations of fopen, and in fact there are often good
reasons to want to avoid using file system IO even on platforms that
have it. And there are numerous platforms that either don't use GCC
or use GCC but don't have all the functionality that GCC on Unix
does. Surely there are others who have needed to use OpenSSL on
platforms other than desktop platforms.
Is there no clean or portable way to override IO in OpenSSL?
Thanks.
Sure you can. At least you can if the loader of your tool-chain
you are using
supports partial linking (two or more *.o in -> one *.o out).
This "pre-link" run is done without any of your system libraries
visible to
the loader. Once the standard fopen, fread, etc symbols have been
resolved (suppressed) you should be good to go.
Just make an additional loader run with your custom wrapper and the
library(ies) for which you need to intercept the standard symbols.
If you where to actually name the tool chain components you are
using (name and version),
someone might in return be nice enough to give you specific
directions/options.
Otherwise, your stuck with RTFM for your tool-chain.
Mike
Is there no way to cleanly override IO in OpenSSL?
Thanks.
On Thu January 24 2008 13:03, OpenSSL wrote:
How might I make OpenSSL use my own 'file system' instead of
fopen, fread, etc.?
The usual way to do that is to write a small bit of wrapper code
that
resolves the fopen, fread, etc calls - and re-issues them as
whatever
your system requires.
Then just specify your wrapper *.o to the linker (or do a partial
link)
so it is found by the linker before your system libraries.
You will be able to use that pre-linked *.o for anything "C".
Mike
I need to make OpenSSL work on a system without implementations
of fopen, fread, etc. However, I have access to functionality
that is essentially the same as fopen, fread, etc. I see
BIO_FLAGS_UPLINK but am not finding any description of it that
might help me tell if it could be useful. I cannot simply
provide my own linkable versions of fopen, fread, etc. as that
would collide with other libraries I have to interoperate with.
Another possibility might be to somehow take advantage of
OPENSSL_NO_FP_API, but I can't easily tell how to accomplish
that. A final fallback would be to somehow hack OpenSSL, but I'd
rather avoid that.
Thanks.
__
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]