Hi,
I understand that by no way this is a solution, but I got so frustrated in the past by the _fp issue that I wrote a function that tranfers the file content to RAM (without OpenSSL functions) and then from RAM to a memory BIO, so it's easily to manage. The side advantage is that the code is more portable when you need to compile it on a different Win platform / with a different compiler without dealing with the Applink issue again... I've practically purged my OpenSSL code from _fp functions usage under Windows.

On 06/10/2014 01:05 AM, open...@comaxis.com wrote:
An update to my question below:  I am trying to do something - anything -
to get d2i_PKCS12_fp() to work.  I am now calling it from a new dll that
is compiled with /MD.  There is no change.  Here is my code:

#include <openssl\applink.c>

    CRYPTO_malloc_init();
    OpenSSL_add_all_algorithms();
    fptr = fopen(p12_file, "rb");
    if (fptr == NULL) return(FALSE);
    d2i_PKCS12_fp(fptr, &p12_cert);
    fclose(fptr);

The call to d2i_PKCS12_fp() always produces the no OPENSSL_Applink runtime
error. If anybody can shed some light on this I would appreciate it.

--- original question ----

I am attempting to use the d2i_PKCS12_fp() API call in a Windows DLL
compiled with the multi-threaded (/MT) runtime library.  On this call I
get the runtime error "OPENSSL_Uplink(03CE1000,08): no OPENSSL_Applink".
>From discussions I have seen about this error, I thought I could fix it by
adding "applink.c" to my project, and calling CRYPTO_malloc_init().
However this has no effect.  Is use of /MT causing this?  It will be
difficult to change that, due to other components of the project.  I have
used the HMAC and SHA256 APIs in this project with no problem.  If it is
just file I/O causing the problem, is there a way that I can
read in the .p12 file myself, and just pass a buffer to OpenSSL in order
to initialize the PKCS12 structure?

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to