Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OPENSSL_Uplink: no OPENSSL_Applink

1,452 views
Skip to first unread message

Perrow, Graeme

unread,
Aug 12, 2013, 10:51:01 AM8/12/13
to

On 32-bit Windows, I am seeing this error when trying to determine why the FIPS_mode_set(1) call is failing. I am building the OpenSSL FIPS module (OpenSSL 1.0.1e, OpenSSL FIPS 2.0.5), and I want to load it from another DLL which is itself loaded from an application. The application knows nothing about OpenSSL, only the DLL does.

 

I have seen the page http://www.openssl.org/support/faq.html#PROG2 describing what needs to be done. I have tried linking applink.c into my DLL, and I’ve tried #include’ing it from an existing source file in the DLL. In both cases, I get the “no OPENSSL_Applink” message. The code I’m executing looks like:

 

if( !FIPS_mode_set(1) ) {

   ERR_load_crypto_strings();

   FILE *f = fopen( "D:\\openssl.txt", "w" );

   ERR_print_errors_fp( f );

   fclose( f );

}

 

I get the “no OPENSSL_Applink” message in the ERR_print_errors_fp() call. Adding a call to CRYPTO_malloc_init above this changes nothing. I am not seeing this problem on 64-bit Windows, possibly because the FIPS_mode_set(1) call succeeds there.

 

What am I missing? I need to solve this problem so I can solve the original problem of why the FIPS_mode_set(1) call fails. Alternatively, if you can help me solve that problem, I may not need to solve this one. :-)

 

Graeme Perrow

 

Dave Thompson

unread,
Aug 12, 2013, 3:05:09 PM8/12/13
to
>From: owner-ope...@openssl.org On Behalf Of Perrow, Graeme
>Sent: Monday, 12 August, 2013 10:51
>To: openss...@openssl.org
>Subject: OPENSSL_Uplink: no OPENSSL_Applink

>On 32-bit Windows, I am seeing this error [investigating an error].
>I am building ... (OpenSSL 1.0.1e, OpenSSL FIPS 2.0.5), and I want
>to load it from another DLL which is itself loaded from an application.
>The application knows nothing about OpenSSL, only the DLL does.

>I have seen the page http://www.openssl.org/support/faq.html#PROG2
>describing what needs to be done. I have tried linking applink.c into
>my DLL, and I've tried #include'ing it from an existing source file
>in the DLL. In both cases, I get the "no OPENSSL_Applink" message.

The FAQ isn't totally clear that the "uplink" search looks only
in the .exe, so the applink code must be in the .exe not any .dll.
And if your .dll uses a different CRT setting than the .exe
(or vice versa) the applink won't actually work.

>The code I'm executing looks like: <snip>

>I get the "no OPENSSL_Applink" message in the ERR_print_errors_fp()
>call. Adding a call to CRYPTO_malloc_init above this changes nothing.

applink redirects I/O calls, CRYPTO_malloc redirects memmgt calls.
They may both be useful on Windows, but are not interchangeable.

You should be able to get the error messages by creating a memBIO,
or a fileBIO using file*name* not fp, and calling ERR_print_errors.
Or alternatively call ERR_get_error, ERR_error_string, etc., to
do the formatting and printing yourself, but that's more tedious.

In general many applink uses (and errors) can be avoided by using
only memory and file-name interfaces not fp interfaces.

>I am not seeing this problem on 64-bit Windows, possibly because the
>FIPS_mode_set(1) call succeeds there.

>What am I missing? I need to solve this problem so I can solve the
>original problem of why the FIPS_mode_set(1) call fails. Alternatively,
>if you can help me solve that problem, I may not need to solve this one.
:-)


______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openss...@openssl.org
Automated List Manager majo...@openssl.org

0 new messages