Fukuba, Yoshiki wrote:
Hi,
After multiple calls to ERR_load_crypto_string(),
we cannot get error message using ERR_error_string().

A short sample is as follows:

=====
#include <openssl/err.h>

int main()
{
    ERR_load_crypto_strings();
    printf("%s\n",ERR_error_string(101163138,NULL));
    ERR_free_strings();

    ERR_load_crypto_strings();
    printf("%s\n",ERR_error_string(101163138,NULL));

    return 0;
}
=====

This is a bug, isn't it?

multiple calls to ERR_load_crypto_strings() are harmless
(well the function is not reentrant but that's not important
here) the problem is that you call ERR_free_strings() between
these two calls. ERR_load_crypto_strings() sets a static
status variable once it has been called so that every further
call to ERR_load_crypto_strings() does nothing and as
ERR_free_strings() doesn't clear this variable again further
calls to ERR_load_crypto_strings() do nothing ...

Cheers,
Nils
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to