> From: owner-openssl-us...@openssl.org On Behalf Of open...@comaxis.com
> Sent: Saturday, June 07, 2014 09:35

> 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

applink.c (and OpenSSL_Applink) only works in an EXE, not a DLL.

> 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?
> 
Yes, uplink is for file access (and malloc_init is for memory allocation).

You can:

- read the file contents into memory and call d2i_PKCS12 to parse from memory
(pass a temporary *copy* pointer because it gets changed, which isn't possible 
for an array and is wrong for a malloc/etc pointer that you need to free later)

- call BIO_new_file to open the file *in OpenSSL NOT your code* and use 
d2i_PKCS12_bio.



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

Reply via email to