ERR_error_string() is not able to get the error text even when ERR_load_crypto_strings() is called again. The problem occurs when ERR_load_crypto_strings() is called followed by ERR_free_strings(), followed once again by the ERR_load_crypto_strings() call. The reason is a static flag been set while loading the error strings and they were not UNSET while freeing the error-stack.

Here is an updated patch to fix this issue in OpenSSL 0.9.8b. This patch affects *56* source files.

=====================================================================
diff -Nur org/crypto/asn1/asn1_err.c ERR_str_load_fix/crypto/asn1/asn1_err.c
--- org/crypto/asn1/asn1_err.c 2006-01-09 03:22:41.000000000 +0530
+++ ERR_str_load_fix/crypto/asn1/asn1_err.c 2006-07-06 12:23:32.000000000 +0530
@@ -285,13 +285,12 @@

#endif

+static int ERR_ASN1_init=1;
void ERR_load_ASN1_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_ASN1_init)
  {
-  init=0;
+  ERR_ASN1_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,ASN1_str_functs);
  ERR_load_strings(0,ASN1_str_reasons);
@@ -299,3 +298,7 @@

  }
 }
+void ERR_unload_ASN1_strings(void)
+ {
+ ERR_ASN1_init=1;
+ }
diff -Nur org/crypto/asn1/asn1.h ERR_str_load_fix/crypto/asn1/asn1.h
--- org/crypto/asn1/asn1.h 2006-02-19 19:15:22.000000000 +0530
+++ ERR_str_load_fix/crypto/asn1/asn1.h 2006-07-06 12:24:47.000000000 +0530
@@ -1015,6 +1015,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_ASN1_strings(void);
+void ERR_unload_ASN1_strings(void);

/* Error codes for the ASN1 functions. */

diff -Nur org/crypto/bio/bio_err.c ERR_str_load_fix/crypto/bio/bio_err.c
--- org/crypto/bio/bio_err.c 2005-04-27 00:23:11.000000000 +0530
+++ ERR_str_load_fix/crypto/bio/bio_err.c 2006-07-06 12:27:22.000000000 +0530
@@ -141,13 +141,12 @@

#endif

+static int ERR_BIO_init=1;
void ERR_load_BIO_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_BIO_init)
  {
-  init=0;
+  ERR_BIO_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,BIO_str_functs);
  ERR_load_strings(0,BIO_str_reasons);
@@ -155,3 +154,7 @@

  }
 }
+void ERR_unload_BIO_strings(void)
+ {
+ ERR_BIO_init=1;
+ }
diff -Nur org/crypto/bio/bio.h ERR_str_load_fix/crypto/bio/bio.h
--- org/crypto/bio/bio.h 2005-12-17 02:54:59.000000000 +0530
+++ ERR_str_load_fix/crypto/bio/bio.h 2006-07-06 12:28:20.000000000 +0530
@@ -696,6 +696,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_BIO_strings(void);
+void ERR_unload_BIO_strings(void);

/* Error codes for the BIO functions. */

diff -Nur org/crypto/bn/bn_err.c ERR_str_load_fix/crypto/bn/bn_err.c
--- org/crypto/bn/bn_err.c 2005-05-16 07:13:29.000000000 +0530
+++ ERR_str_load_fix/crypto/bn/bn_err.c 2006-07-06 12:29:43.000000000 +0530
@@ -135,13 +135,12 @@

#endif

+static int ERR_BN_init=1;
void ERR_load_BN_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_BN_init)
  {
-  init=0;
+  ERR_BN_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,BN_str_functs);
  ERR_load_strings(0,BN_str_reasons);
@@ -149,3 +148,7 @@

  }
 }
+void ERR_unload_BN_strings(void)
+ {
+ ERR_BN_init=1;
+ }
diff -Nur org/crypto/bn/bn.h ERR_str_load_fix/crypto/bn/bn.h
--- org/crypto/bn/bn.h 2006-01-14 05:22:17.000000000 +0530
+++ ERR_str_load_fix/crypto/bn/bn.h 2006-07-06 12:30:51.000000000 +0530
@@ -759,6 +759,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_BN_strings(void);
+void ERR_unload_BN_strings(void);

/* Error codes for the BN functions. */

diff -Nur org/crypto/buffer/buf_err.c ERR_str_load_fix/crypto/buffer/buf_err.c
--- org/crypto/buffer/buf_err.c 2005-04-27 00:23:14.000000000 +0530
+++ ERR_str_load_fix/crypto/buffer/buf_err.c 2006-07-06 12:31:39.000000000 +0530
@@ -86,13 +86,12 @@

#endif

+static int ERR_BUF_init=1;
void ERR_load_BUF_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_BUF_init)
  {
-  init=0;
+  ERR_BUF_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,BUF_str_functs);
  ERR_load_strings(0,BUF_str_reasons);
@@ -100,3 +99,7 @@

  }
 }
+void ERR_unload_BUF_strings(void)
+ {
+ ERR_BUF_init=1;
+ }
diff -Nur org/crypto/buffer/buffer.h ERR_str_load_fix/crypto/buffer/buffer.h
--- org/crypto/buffer/buffer.h 2005-04-27 00:23:14.000000000 +0530
+++ ERR_str_load_fix/crypto/buffer/buffer.h 2006-07-06 12:32:10.000000000 +0530
@@ -99,6 +99,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_BUF_strings(void);
+void ERR_unload_BUF_strings(void);

/* Error codes for the BUF functions. */

diff -Nur org/crypto/comp/comp_err.c ERR_str_load_fix/crypto/comp/comp_err.c
--- org/crypto/comp/comp_err.c 2005-04-12 21:45:10.000000000 +0530
+++ ERR_str_load_fix/crypto/comp/comp_err.c 2006-07-06 12:42:04.000000000 +0530
@@ -80,13 +80,12 @@

#endif

+static int ERR_COMP_init=1;
void ERR_load_COMP_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_COMP_init)
  {
-  init=0;
+  ERR_COMP_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,COMP_str_functs);
  ERR_load_strings(0,COMP_str_reasons);
@@ -94,3 +93,7 @@

  }
 }
+void ERR_unload_COMP_strings(void)
+ {
+ ERR_COMP_init=1;
+ }
diff -Nur org/crypto/comp/comp.h ERR_str_load_fix/crypto/comp/comp.h
--- org/crypto/comp/comp.h 2003-03-21 05:35:14.000000000 +0530
+++ ERR_str_load_fix/crypto/comp/comp.h 2006-07-06 12:42:20.000000000 +0530
@@ -53,6 +53,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_COMP_strings(void);
+void ERR_unload_COMP_strings(void);

/* Error codes for the COMP functions. */

diff -Nur org/crypto/conf/conf_err.c ERR_str_load_fix/crypto/conf/conf_err.c
--- org/crypto/conf/conf_err.c 2005-05-11 09:15:25.000000000 +0530
+++ ERR_str_load_fix/crypto/conf/conf_err.c 2006-07-06 12:44:01.000000000 +0530
@@ -116,13 +116,12 @@

#endif

+static int ERR_CONF_init=1;
void ERR_load_CONF_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_CONF_init)
  {
-  init=0;
+  ERR_CONF_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,CONF_str_functs);
  ERR_load_strings(0,CONF_str_reasons);
@@ -130,3 +129,7 @@

  }
 }
+void ERR_unload_CONF_strings(void)
+ {
+ ERR_CONF_init=1;
+ }
diff -Nur org/crypto/conf/conf.h ERR_str_load_fix/crypto/conf/conf.h
--- org/crypto/conf/conf.h 2005-05-11 09:15:25.000000000 +0530
+++ ERR_str_load_fix/crypto/conf/conf.h 2006-07-06 12:44:34.000000000 +0530
@@ -204,6 +204,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_CONF_strings(void);
+void ERR_unload_CONF_strings(void);

/* Error codes for the CONF functions. */

diff -Nur org/crypto/cpt_err.c ERR_str_load_fix/crypto/cpt_err.c
--- org/crypto/cpt_err.c 2005-04-12 21:45:06.000000000 +0530
+++ ERR_str_load_fix/crypto/cpt_err.c 2006-07-06 12:46:42.000000000 +0530
@@ -90,13 +90,12 @@

#endif

+static int ERR_CRYPTO_init=1;
void ERR_load_CRYPTO_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_CRYPTO_init)
  {
-  init=0;
+  ERR_CRYPTO_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,CRYPTO_str_functs);
  ERR_load_strings(0,CRYPTO_str_reasons);
@@ -104,3 +103,7 @@

  }
 }
+void ERR_unload_CRYPTO_strings(void)
+ {
+ ERR_CRYPTO_init=1;
+ }
diff -Nur org/crypto/crypto.h ERR_str_load_fix/crypto/crypto.h
--- org/crypto/crypto.h 2005-05-09 01:24:33.000000000 +0530
+++ ERR_str_load_fix/crypto/crypto.h 2006-07-06 12:47:30.000000000 +0530
@@ -527,6 +527,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_CRYPTO_strings(void);
+void ERR_unload_CRYPTO_strings(void);

/* Error codes for the CRYPTO functions. */

diff -Nur org/crypto/dh/dh_err.c ERR_str_load_fix/crypto/dh/dh_err.c
--- org/crypto/dh/dh_err.c 2006-01-09 21:35:22.000000000 +0530
+++ ERR_str_load_fix/crypto/dh/dh_err.c 2006-07-06 12:50:31.000000000 +0530
@@ -90,13 +90,12 @@

#endif

+static int ERR_DH_init=1;
void ERR_load_DH_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_DH_init)
  {
-  init=0;
+  ERR_DH_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,DH_str_functs);
  ERR_load_strings(0,DH_str_reasons);
@@ -104,3 +103,7 @@

  }
 }
+void ERR_unload_DH_strings(void)
+ {
+ ERR_DH_init=1;
+ }
diff -Nur org/crypto/dh/dh.h ERR_str_load_fix/crypto/dh/dh.h
--- org/crypto/dh/dh.h 2006-01-09 21:35:22.000000000 +0530
+++ ERR_str_load_fix/crypto/dh/dh.h 2006-07-06 12:51:10.000000000 +0530
@@ -206,6 +206,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_DH_strings(void);
+void ERR_unload_DH_strings(void);

/* Error codes for the DH functions. */

diff -Nur org/crypto/dsa/dsa_err.c ERR_str_load_fix/crypto/dsa/dsa_err.c
--- org/crypto/dsa/dsa_err.c 2005-04-12 21:45:12.000000000 +0530
+++ ERR_str_load_fix/crypto/dsa/dsa_err.c 2006-07-06 12:53:39.000000000 +0530
@@ -96,13 +96,12 @@

#endif

+static int ERR_DSA_init=1;
void ERR_load_DSA_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_DSA_init)
  {
-  init=0;
+  ERR_DSA_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,DSA_str_functs);
  ERR_load_strings(0,DSA_str_reasons);
@@ -110,3 +109,7 @@

  }
 }
+void ERR_unload_DSA_strings(void)
+ {
+ ERR_DSA_init=1;
+ }
diff -Nur org/crypto/dsa/dsa.h ERR_str_load_fix/crypto/dsa/dsa.h
--- org/crypto/dsa/dsa.h 2005-05-16 07:13:30.000000000 +0530
+++ ERR_str_load_fix/crypto/dsa/dsa.h 2006-07-06 12:55:29.000000000 +0530
@@ -250,6 +250,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_DSA_strings(void);
+void ERR_unload_DSA_strings(void);

/* Error codes for the DSA functions. */

diff -Nur org/crypto/dso/dso_err.c ERR_str_load_fix/crypto/dso/dso_err.c
--- org/crypto/dso/dso_err.c 2005-05-11 09:15:26.000000000 +0530
+++ ERR_str_load_fix/crypto/dso/dso_err.c 2006-07-06 12:56:20.000000000 +0530
@@ -134,13 +134,12 @@

#endif

+static int ERR_DSO_init=1;
void ERR_load_DSO_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_DSO_init)
  {
-  init=0;
+  ERR_DSO_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,DSO_str_functs);
  ERR_load_strings(0,DSO_str_reasons);
@@ -148,3 +147,7 @@

  }
 }
+void ERR_unload_DSO_strings(void)
+ {
+ ERR_DSO_init=1;
+ }
diff -Nur org/crypto/dso/dso.h ERR_str_load_fix/crypto/dso/dso.h
--- org/crypto/dso/dso.h 2005-11-01 10:26:29.000000000 +0530
+++ ERR_str_load_fix/crypto/dso/dso.h 2006-07-06 12:57:03.000000000 +0530
@@ -301,6 +301,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_DSO_strings(void);
+void ERR_unload_DSO_strings(void);

/* Error codes for the DSO functions. */

diff -Nur org/crypto/ec/ec_err.c ERR_str_load_fix/crypto/ec/ec_err.c
--- org/crypto/ec/ec_err.c 2006-01-09 21:35:20.000000000 +0530
+++ ERR_str_load_fix/crypto/ec/ec_err.c 2006-07-06 12:58:56.000000000 +0530
@@ -222,13 +222,12 @@

#endif

+static int ERR_EC_init=1;
void ERR_load_EC_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_EC_init)
  {
-  init=0;
+  ERR_EC_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,EC_str_functs);
  ERR_load_strings(0,EC_str_reasons);
@@ -236,3 +235,7 @@

  }
 }
+void ERR_unload_EC_strings(void)
+ {
+ ERR_EC_init=1;
+ }
diff -Nur org/crypto/ec/ec.h ERR_str_load_fix/crypto/ec/ec.h
--- org/crypto/ec/ec.h 2006-01-09 03:22:43.000000000 +0530
+++ ERR_str_load_fix/crypto/ec/ec.h 2006-07-06 12:59:40.000000000 +0530
@@ -363,6 +363,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_EC_strings(void);
+void ERR_unload_EC_strings(void);

/* Error codes for the EC functions. */

diff -Nur org/crypto/ecdh/ecdh.h ERR_str_load_fix/crypto/ecdh/ecdh.h
--- org/crypto/ecdh/ecdh.h 2005-05-16 15:41:00.000000000 +0530
+++ ERR_str_load_fix/crypto/ecdh/ecdh.h 2006-07-06 15:13:29.000000000 +0530
@@ -105,6 +105,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_ECDH_strings(void);
+void ERR_unload_ECDH_strings(void);

/* Error codes for the ECDH functions. */

diff -Nur org/crypto/ecdh/ech_err.c ERR_str_load_fix/crypto/ecdh/ech_err.c
--- org/crypto/ecdh/ech_err.c 2005-04-27 00:23:19.000000000 +0530
+++ ERR_str_load_fix/crypto/ecdh/ech_err.c 2006-07-06 15:20:59.000000000 +0530
@@ -85,13 +85,12 @@

#endif

+static int ERR_ECDH_init=1;
void ERR_load_ECDH_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_ECDH_init)
  {
-  init=0;
+  ERR_ECDH_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,ECDH_str_functs);
  ERR_load_strings(0,ECDH_str_reasons);
@@ -99,3 +98,7 @@

  }
 }
+void ERR_unload_ECDH_strings(void)
+ {
+ ERR_ECDH_init=1;
+ }
diff -Nur org/crypto/ecdsa/ecdsa.h ERR_str_load_fix/crypto/ecdsa/ecdsa.h
--- org/crypto/ecdsa/ecdsa.h 2005-05-16 15:41:01.000000000 +0530
+++ ERR_str_load_fix/crypto/ecdsa/ecdsa.h 2006-07-06 15:16:55.000000000 +0530
@@ -247,6 +247,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_ECDSA_strings(void);
+void ERR_unload_ECDSA_strings(void);

/* Error codes for the ECDSA functions. */

diff -Nur org/crypto/ecdsa/ecs_err.c ERR_str_load_fix/crypto/ecdsa/ecs_err.c
--- org/crypto/ecdsa/ecs_err.c 2005-04-27 00:23:20.000000000 +0530
+++ ERR_str_load_fix/crypto/ecdsa/ecs_err.c 2006-07-06 15:20:37.000000000 +0530
@@ -90,13 +90,12 @@

#endif

+static int ERR_ECDSA_init=1;
void ERR_load_ECDSA_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_ECDSA_init)
  {
-  init=0;
+  ERR_ECDSA_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,ECDSA_str_functs);
  ERR_load_strings(0,ECDSA_str_reasons);
@@ -104,3 +103,7 @@

  }
 }
+void ERR_unload_ECDSA_strings(void)
+ {
+ ERR_ECDSA_init=1;
+ }
diff -Nur org/crypto/engine/eng_err.c ERR_str_load_fix/crypto/engine/eng_err.c
--- org/crypto/engine/eng_err.c 2005-05-11 09:15:27.000000000 +0530
+++ ERR_str_load_fix/crypto/engine/eng_err.c 2006-07-06 13:01:35.000000000 +0530
@@ -155,6 +155,7 @@

#endif

+static int ERR_ENGINE_init=1;
void ERR_load_ENGINE_strings(void)
 {
 static int init=1;
@@ -169,3 +170,7 @@

  }
 }
+void ERR_unload_ENGINE_strings(void)
+ {
+ ERR_ENGINE_init=1;
+ }
diff -Nur org/crypto/engine/engine.h ERR_str_load_fix/crypto/engine/engine.h
--- org/crypto/engine/engine.h 2005-11-06 23:18:59.000000000 +0530
+++ ERR_str_load_fix/crypto/engine/engine.h 2006-07-06 13:02:21.000000000 +0530
@@ -697,6 +697,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_ENGINE_strings(void);
+void ERR_unload_ENGINE_strings(void);

/* Error codes for the ENGINE functions. */

diff -Nur org/crypto/err/err_all.c ERR_str_load_fix/crypto/err/err_all.c
--- org/crypto/err/err_all.c 2004-04-19 23:15:59.000000000 +0530
+++ ERR_str_load_fix/crypto/err/err_all.c 2006-07-07 09:08:27.000000000 +0530
@@ -95,12 +95,11 @@
#include <openssl/ocsp.h>
#include <openssl/err.h>

+static int ERR_crypto_done=0;
void ERR_load_crypto_strings(void)
 {
- static int done=0;
-
- if (done) return;
- done=1;
+ if (ERR_crypto_done) return;
+ ERR_crypto_done=1;
#ifndef OPENSSL_NO_ERR
 ERR_load_ERR_strings(); /* include error strings for SYSerr */
 ERR_load_BN_strings();
@@ -144,3 +143,48 @@
 ERR_load_UI_strings();
#endif
 }
+
+void ERR_unload_crypto_strings(void)
+ {
+ ERR_crypto_done=0;
+#ifndef OPENSSL_NO_ERR
+ ERR_unload_BN_strings();
+#ifndef OPENSSL_NO_RSA
+ ERR_unload_RSA_strings();
+#endif
+#ifndef OPENSSL_NO_DH
+ ERR_unload_DH_strings();
+#endif
+ ERR_unload_EVP_strings();
+ ERR_unload_BUF_strings();
+ ERR_unload_OBJ_strings();
+ ERR_unload_PEM_strings();
+#ifndef OPENSSL_NO_DSA
+ ERR_unload_DSA_strings();
+#endif
+ ERR_unload_X509_strings();
+ ERR_unload_ASN1_strings();
+ ERR_unload_CONF_strings();
+ ERR_unload_CRYPTO_strings();
+#ifndef OPENSSL_NO_EC
+ ERR_unload_EC_strings();
+#endif
+#ifndef OPENSSL_NO_ECDSA
+ ERR_unload_ECDSA_strings();
+#endif
+#ifndef OPENSSL_NO_ECDH
+ ERR_unload_ECDH_strings();
+#endif
+ ERR_unload_BIO_strings();
+ ERR_unload_PKCS7_strings();
+ ERR_unload_X509V3_strings();
+ ERR_unload_PKCS12_strings();
+ ERR_unload_RAND_strings();
+ ERR_unload_DSO_strings();
+#ifndef OPENSSL_NO_ENGINE
+ ERR_unload_ENGINE_strings();
+#endif
+ ERR_unload_OCSP_strings();
+ ERR_unload_UI_strings();
+#endif
+ }
diff -Nur org/crypto/err/err.c ERR_str_load_fix/crypto/err/err.c
--- org/crypto/err/err.c 2006-02-09 00:46:16.000000000 +0530
+++ ERR_str_load_fix/crypto/err/err.c 2006-07-07 14:10:41.000000000 +0530
@@ -657,6 +657,8 @@

void ERR_free_strings(void)
 {
+ ERR_unload_crypto_strings();
+ ERR_unload_SSL_strings(0);
 err_fns_check();
 ERRFN(err_del)();
 }
@@ -1115,3 +1117,16 @@
 es->err_flags[es->top]&=~ERR_FLAG_MARK;
 return 1;
 }
+int ERR_unload_SSL_strings(int i)
+ {
+ static int init=1;
+ switch(i)
+  {
+  case 0:
+   init=1; return 0;
+  case 1:
+   if(!init) return 0;
+   init=0; return 1;
+  default : return 0;
+  }
+ }
diff -Nur org/crypto/err/err.h ERR_str_load_fix/crypto/err/err.h
--- org/crypto/err/err.h 2004-04-19 23:15:59.000000000 +0530
+++ ERR_str_load_fix/crypto/err/err.h 2006-07-07 13:05:40.000000000 +0530
@@ -285,7 +285,10 @@
void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
void ERR_unload_strings(int lib,ERR_STRING_DATA str[]);
void ERR_load_ERR_strings(void);
+void ERR_unload_ERR_strings(void);
void ERR_load_crypto_strings(void);
+void ERR_unload_crypto_strings(void);
+int ERR_unload_SSL_strings(int);
void ERR_free_strings(void);

void ERR_remove_state(unsigned long pid); /* if zero we look it up */
diff -Nur org/crypto/evp/evp_err.c ERR_str_load_fix/crypto/evp/evp_err.c
--- org/crypto/evp/evp_err.c 2005-05-11 09:15:29.000000000 +0530
+++ ERR_str_load_fix/crypto/evp/evp_err.c 2006-07-06 13:08:54.000000000 +0530
@@ -159,13 +159,12 @@

#endif

+static int ERR_EVP_init=1;
void ERR_load_EVP_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_EVP_init)
  {
-  init=0;
+  ERR_EVP_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,EVP_str_functs);
  ERR_load_strings(0,EVP_str_reasons);
@@ -173,3 +172,7 @@

  }
 }
+void ERR_unload_EVP_strings(void)
+ {
+ ERR_EVP_init=1;
+ }
diff -Nur org/crypto/evp/evp.h ERR_str_load_fix/crypto/evp/evp.h
--- org/crypto/evp/evp.h 2005-12-02 19:17:02.000000000 +0530
+++ ERR_str_load_fix/crypto/evp/evp.h 2006-07-06 13:09:35.000000000 +0530
@@ -849,6 +849,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_EVP_strings(void);
+void ERR_unload_EVP_strings(void);

/* Error codes for the EVP functions. */

diff -Nur org/crypto/objects/objects.h ERR_str_load_fix/crypto/objects/objects.h
--- org/crypto/objects/objects.h 2004-12-05 06:33:09.000000000 +0530
+++ ERR_str_load_fix/crypto/objects/objects.h 2006-07-06 14:04:48.000000000 +0530
@@ -1027,6 +1027,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_OBJ_strings(void);
+void ERR_unload_OBJ_strings(void);

/* Error codes for the OBJ functions. */

diff -Nur org/crypto/objects/obj_err.c ERR_str_load_fix/crypto/objects/obj_err.c
--- org/crypto/objects/obj_err.c 2005-04-12 21:45:16.000000000 +0530
+++ ERR_str_load_fix/crypto/objects/obj_err.c 2006-07-06 14:06:30.000000000 +0530
@@ -89,13 +89,12 @@

#endif

+static int ERR_OBJ_init=1;
void ERR_load_OBJ_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_OBJ_init)
  {
-  init=0;
+  ERR_OBJ_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,OBJ_str_functs);
  ERR_load_strings(0,OBJ_str_reasons);
@@ -103,3 +102,7 @@

  }
 }
+void ERR_unload_OBJ_strings(void)
+ {
+ ERR_OBJ_init=1;
+ }
diff -Nur org/crypto/ocsp/ocsp_err.c ERR_str_load_fix/crypto/ocsp/ocsp_err.c
--- org/crypto/ocsp/ocsp_err.c 2005-05-11 09:15:30.000000000 +0530
+++ ERR_str_load_fix/crypto/ocsp/ocsp_err.c 2006-07-06 14:08:46.000000000 +0530
@@ -127,13 +127,12 @@

#endif

+static int ERR_OCSP_init=1;
void ERR_load_OCSP_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_OCSP_init)
  {
-  init=0;
+  ERR_OCSP_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,OCSP_str_functs);
  ERR_load_strings(0,OCSP_str_reasons);
@@ -141,3 +140,7 @@

  }
 }
+void ERR_unload_OCSP_strings(void)
+ {
+ ERR_OCSP_init=1;
+ }
diff -Nur org/crypto/ocsp/ocsp.h ERR_str_load_fix/crypto/ocsp/ocsp.h
--- org/crypto/ocsp/ocsp.h 2005-05-13 04:31:43.000000000 +0530
+++ ERR_str_load_fix/crypto/ocsp/ocsp.h 2006-07-06 14:09:54.000000000 +0530
@@ -554,6 +554,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_OCSP_strings(void);
+void ERR_unload_OCSP_strings(void);

/* Error codes for the OCSP functions. */

diff -Nur org/crypto/pem/pem_err.c ERR_str_load_fix/crypto/pem/pem_err.c
--- org/crypto/pem/pem_err.c 2005-05-11 09:15:30.000000000 +0530
+++ ERR_str_load_fix/crypto/pem/pem_err.c 2006-07-06 14:11:18.000000000 +0530
@@ -122,13 +122,12 @@

#endif

+static ERR_PEM_init=1;
void ERR_load_PEM_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_PEM_init)
  {
-  init=0;
+  ERR_PEM_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,PEM_str_functs);
  ERR_load_strings(0,PEM_str_reasons);
@@ -136,3 +135,7 @@

  }
 }
+void ERR_unload_PEM_strings(void)
+ {
+ ERR_PEM_init=1;
+ }
diff -Nur org/crypto/pem/pem.h ERR_str_load_fix/crypto/pem/pem.h
--- org/crypto/pem/pem.h 2005-05-19 03:59:17.000000000 +0530
+++ ERR_str_load_fix/crypto/pem/pem.h 2006-07-06 14:11:57.000000000 +0530
@@ -682,6 +682,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_PEM_strings(void);
+void ERR_unload_PEM_strings(void);

/* Error codes for the PEM functions. */

diff -Nur org/crypto/pkcs12/pk12err.c ERR_str_load_fix/crypto/pkcs12/pk12err.c
--- org/crypto/pkcs12/pk12err.c 2005-06-30 17:04:27.000000000 +0530
+++ ERR_str_load_fix/crypto/pkcs12/pk12err.c 2006-07-06 14:16:23.000000000 +0530
@@ -131,13 +131,12 @@

#endif

+static int ERR_PKCS12_init=1;
void ERR_load_PKCS12_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_PKCS12_init)
  {
-  init=0;
+  ERR_PKCS12_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,PKCS12_str_functs);
  ERR_load_strings(0,PKCS12_str_reasons);
@@ -145,3 +144,7 @@

  }
 }
+void ERR_unload_PKCS12_strings(void)
+ {
+ ERR_PKCS12_init=1;
+ }
diff -Nur org/crypto/pkcs12/pkcs12.h ERR_str_load_fix/crypto/pkcs12/pkcs12.h
--- org/crypto/pkcs12/pkcs12.h 2005-06-30 17:04:27.000000000 +0530
+++ ERR_str_load_fix/crypto/pkcs12/pkcs12.h 2006-07-06 14:18:01.000000000 +0530
@@ -269,6 +269,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_PKCS12_strings(void);
+void ERR_unload_PKCS12_strings(void);

/* Error codes for the PKCS12 functions. */

diff -Nur org/crypto/pkcs7/pkcs7err.c ERR_str_load_fix/crypto/pkcs7/pkcs7err.c
--- org/crypto/pkcs7/pkcs7err.c 2005-08-05 03:40:05.000000000 +0530
+++ ERR_str_load_fix/crypto/pkcs7/pkcs7err.c 2006-07-06 14:41:58.000000000 +0530
@@ -154,13 +154,12 @@

#endif

+static int ERR_PKCS7_init=1;
void ERR_load_PKCS7_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_PKCS7_init)
  {
-  init=0;
+  ERR_PKCS7_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,PKCS7_str_functs);
  ERR_load_strings(0,PKCS7_str_reasons);
@@ -168,3 +167,7 @@

  }
 }
+void ERR_unload_PKCS7_strings(void)
+ {
+ ERR_PKCS7_init=1;
+ }
diff -Nur org/crypto/pkcs7/pkcs7.h ERR_str_load_fix/crypto/pkcs7/pkcs7.h
--- org/crypto/pkcs7/pkcs7.h 2005-08-05 03:40:05.000000000 +0530
+++ ERR_str_load_fix/crypto/pkcs7/pkcs7.h 2006-07-06 14:42:37.000000000 +0530
@@ -377,6 +377,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_PKCS7_strings(void);
+void ERR_unload_PKCS7_strings(void);

/* Error codes for the PKCS7 functions. */

diff -Nur org/crypto/rand/rand_err.c ERR_str_load_fix/crypto/rand/rand_err.c
--- org/crypto/rand/rand_err.c 2005-04-12 21:45:19.000000000 +0530
+++ ERR_str_load_fix/crypto/rand/rand_err.c 2006-07-06 14:45:03.000000000 +0530
@@ -83,13 +83,12 @@

#endif

+static int ERR_RAND_init=1;
void ERR_load_RAND_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_RAND_init)
  {
-  init=0;
+  ERR_RAND_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,RAND_str_functs);
  ERR_load_strings(0,RAND_str_reasons);
@@ -97,3 +96,7 @@

  }
 }
+void ERR_unload_RAND_strings(void)
+ {
+ ERR_RAND_init=1;
+ }
diff -Nur org/crypto/rand/rand.h ERR_str_load_fix/crypto/rand/rand.h
--- org/crypto/rand/rand.h 2004-05-17 21:19:12.000000000 +0530
+++ ERR_str_load_fix/crypto/rand/rand.h 2006-07-06 14:46:16.000000000 +0530
@@ -124,6 +124,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_RAND_strings(void);
+void ERR_unload_RAND_strings(void);

/* Error codes for the RAND functions. */

diff -Nur org/crypto/rsa/rsa_err.c ERR_str_load_fix/crypto/rsa/rsa_err.c
--- org/crypto/rsa/rsa_err.c 2006-01-09 21:35:18.000000000 +0530
+++ ERR_str_load_fix/crypto/rsa/rsa_err.c 2006-07-06 14:47:51.000000000 +0530
@@ -157,13 +157,12 @@

#endif

+static int ERR_RSA_init=1;
void ERR_load_RSA_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_RSA_init)
  {
-  init=0;
+  ERR_RSA_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,RSA_str_functs);
  ERR_load_strings(0,RSA_str_reasons);
@@ -171,3 +170,7 @@

  }
 }
+void ERR_unload_RSA_strings(void)
+ {
+ ERR_RSA_init=1;
+ }
diff -Nur org/crypto/rsa/rsa.h ERR_str_load_fix/crypto/rsa/rsa.h
--- org/crypto/rsa/rsa.h 2006-01-09 21:35:18.000000000 +0530
+++ ERR_str_load_fix/crypto/rsa/rsa.h 2006-07-06 14:48:36.000000000 +0530
@@ -339,6 +339,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_RSA_strings(void);
+void ERR_unload_RSA_strings(void);

/* Error codes for the RSA functions. */

diff -Nur org/crypto/store/store.h ERR_str_load_fix/crypto/store/store.h
--- org/crypto/store/store.h 2005-05-11 09:15:34.000000000 +0530
+++ ERR_str_load_fix/crypto/store/store.h 2006-07-06 15:18:37.000000000 +0530
@@ -423,6 +423,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_STORE_strings(void);
+void ERR_unload_STORE_strings(void);

/* Error codes for the STORE functions. */

diff -Nur org/crypto/store/str_err.c ERR_str_load_fix/crypto/store/str_err.c
--- org/crypto/store/str_err.c 2005-05-11 09:15:34.000000000 +0530
+++ ERR_str_load_fix/crypto/store/str_err.c 2006-07-06 15:22:33.000000000 +0530
@@ -198,13 +198,12 @@

#endif

+static int ERR_STORE_init=1;
void ERR_load_STORE_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_STORE_init)
  {
-  init=0;
+  ERR_STORE_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,STORE_str_functs);
  ERR_load_strings(0,STORE_str_reasons);
@@ -212,3 +211,7 @@

  }
 }
+void ERR_unload_STORE_strings(void)
+ {
+ ERR_STORE_init=1;
+ }
diff -Nur org/crypto/ui/ui_err.c ERR_str_load_fix/crypto/ui/ui_err.c
--- org/crypto/ui/ui_err.c 2005-04-12 21:45:20.000000000 +0530
+++ ERR_str_load_fix/crypto/ui/ui_err.c 2006-07-06 14:52:30.000000000 +0530
@@ -99,13 +99,12 @@

#endif

+static int ERR_UI_init=1;
void ERR_load_UI_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_UI_init)
  {
-  init=0;
+  ERR_UI_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,UI_str_functs);
  ERR_load_strings(0,UI_str_reasons);
@@ -113,3 +112,7 @@

  }
 }
+void ERR_unload_UI_strings(void)
+ {
+ ERR_UI_init=1;
+ }
diff -Nur org/crypto/ui/ui.h ERR_str_load_fix/crypto/ui/ui.h
--- org/crypto/ui/ui.h 2005-03-31 14:56:35.000000000 +0530
+++ ERR_str_load_fix/crypto/ui/ui.h 2006-07-06 14:53:39.000000000 +0530
@@ -349,6 +349,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_UI_strings(void);
+void ERR_unload_UI_strings(void);

/* Error codes for the UI functions. */

diff -Nur org/crypto/x509/x509_err.c ERR_str_load_fix/crypto/x509/x509_err.c
--- org/crypto/x509/x509_err.c 2005-05-11 09:15:35.000000000 +0530
+++ ERR_str_load_fix/crypto/x509/x509_err.c 2006-07-06 14:54:54.000000000 +0530
@@ -148,13 +148,12 @@

#endif

+static int ERR_X509_init=1;
void ERR_load_X509_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_X509_init)
  {
-  init=0;
+  ERR_X509_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,X509_str_functs);
  ERR_load_strings(0,X509_str_reasons);
@@ -162,3 +161,7 @@

  }
 }
+void ERR_unload_X509_strings(void)
+ {
+ ERR_X509_init=1;
+ }
diff -Nur org/crypto/x509/x509.h ERR_str_load_fix/crypto/x509/x509.h
--- org/crypto/x509/x509.h 2005-05-15 06:24:45.000000000 +0530
+++ ERR_str_load_fix/crypto/x509/x509.h 2006-07-06 14:55:33.000000000 +0530
@@ -1259,6 +1259,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_X509_strings(void);
+void ERR_unload_X509_strings(void);

/* Error codes for the X509 functions. */

diff -Nur org/crypto/x509v3/v3err.c ERR_str_load_fix/crypto/x509v3/v3err.c
--- org/crypto/x509v3/v3err.c 2006-01-09 03:22:44.000000000 +0530
+++ ERR_str_load_fix/crypto/x509v3/v3err.c 2006-07-06 14:57:21.000000000 +0530
@@ -196,13 +196,12 @@

#endif

+static int ERR_X509V3_init=1;
void ERR_load_X509V3_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_X509V3_init)
  {
-  init=0;
+  ERR_X509V3_init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,X509V3_str_functs);
  ERR_load_strings(0,X509V3_str_reasons);
@@ -210,3 +209,7 @@

  }
 }
+void ERR_unload_X509V3_strings(void)
+ {
+ ERR_X509V3_init=1;
+ }
diff -Nur org/crypto/x509v3/x509v3.h ERR_str_load_fix/crypto/x509v3/x509v3.h
--- org/crypto/x509v3/x509v3.h 2006-01-09 03:22:44.000000000 +0530
+++ ERR_str_load_fix/crypto/x509v3/x509v3.h 2006-07-06 14:58:16.000000000 +0530
@@ -630,6 +630,7 @@
 * made after this point may be overwritten when the script is next run.
 */
void ERR_load_X509V3_strings(void);
+void ERR_unload_X509V3_strings(void);

/* Error codes for the X509V3 functions. */

diff -Nur org/ssl/ssl_err.c ERR_str_load_fix/ssl/ssl_err.c
--- org/ssl/ssl_err.c 2006-01-09 03:22:46.000000000 +0530
+++ ERR_str_load_fix/ssl/ssl_err.c 2006-07-07 14:12:02.000000000 +0530
@@ -486,11 +486,8 @@

void ERR_load_SSL_strings(void)
 {
- static int init=1;
-
- if (init)
+ if (ERR_unload_SSL_strings(1))
  {
-  init=0;
#ifndef OPENSSL_NO_ERR
  ERR_load_strings(0,SSL_str_functs);
  ERR_load_strings(0,SSL_str_reasons);
=====================================================================

--Haridharan
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to