summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/asn1/tasn_utl.c2
-rw-r--r--crypto/dh/dh_lib.c2
-rw-r--r--crypto/dsa/dsa_lib.c2
-rw-r--r--crypto/dso/dso_lib.c2
-rw-r--r--crypto/ec/ec_key.c2
-rw-r--r--crypto/ec/ec_mult.c2
-rw-r--r--crypto/ec/ecp_nistz256.c2
-rw-r--r--crypto/evp/p_lib.c2
-rw-r--r--crypto/rsa/rsa_lib.c2
-rw-r--r--crypto/x509/x509_lu.c2
-rw-r--r--crypto/x509/x509_set.c2
-rw-r--r--crypto/x509/x509cset.c2
-rw-r--r--e_os.h20
-rw-r--r--include/internal/refcount.h22
-rw-r--r--ssl/ssl_cert.c2
-rw-r--r--ssl/ssl_lib.c2
-rw-r--r--ssl/ssl_sess.c2
17 files changed, 37 insertions, 35 deletions
diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c
index 5f7e4fbde2..cf434aa23c 100644
--- a/crypto/asn1/tasn_utl.c
+++ b/crypto/asn1/tasn_utl.c
@@ -10,7 +10,7 @@
#include <stddef.h>
#include <string.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index 9e8877e2d7..4530ce7345 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/bn.h>
#include "dh_locl.h"
#include <openssl/engine.h>
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c
index efd98c21cf..caaa65c1f5 100644
--- a/crypto/dsa/dsa_lib.c
+++ b/crypto/dsa/dsa_lib.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/bn.h>
#include "dsa_locl.h"
#include <openssl/asn1.h>
diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c
index 3645c8d603..3c83ab8e91 100644
--- a/crypto/dso/dso_lib.c
+++ b/crypto/dso/dso_lib.c
@@ -8,7 +8,7 @@
*/
#include "dso_locl.h"
-#include "e_os.h"
+#include "internal/refcount.h"
static DSO_METHOD *default_DSO_meth = NULL;
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index 882c882296..3874553179 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -11,7 +11,7 @@
#include "internal/cryptlib.h"
#include <string.h>
#include "ec_lcl.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/err.h>
#include <openssl/engine.h>
diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c
index 6f75416425..c7557882fa 100644
--- a/crypto/ec/ec_mult.c
+++ b/crypto/ec/ec_mult.c
@@ -14,7 +14,7 @@
#include "internal/cryptlib.h"
#include "internal/bn_int.h"
#include "ec_lcl.h"
-#include "e_os.h"
+#include "internal/refcount.h"
/*
* This file implements the wNAF-based interleaving multi-exponentiation method
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c
index edea1f8810..3863a61b02 100644
--- a/crypto/ec/ecp_nistz256.c
+++ b/crypto/ec/ecp_nistz256.c
@@ -21,7 +21,7 @@
#include "internal/cryptlib.h"
#include "internal/bn_int.h"
#include "ec_lcl.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#if BN_BITS2 != 64
# define TOBN(hi,lo) lo,hi
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 266d8ca47b..74539375be 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/objects.h>
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index 92d872886b..45ec813376 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/lhash.h>
#include "internal/bn_int.h"
#include <openssl/engine.h>
diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c
index 7d915aa762..f45b06112d 100644
--- a/crypto/x509/x509_lu.c
+++ b/crypto/x509/x509_lu.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/lhash.h>
#include <openssl/x509.h>
#include "internal/x509_int.h"
diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c
index 49f8651e9a..c634670fa6 100644
--- a/crypto/x509/x509_set.c
+++ b/crypto/x509/x509_set.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/asn1.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
diff --git a/crypto/x509/x509cset.c b/crypto/x509/x509cset.c
index 63ad319181..c870f39249 100644
--- a/crypto/x509/x509cset.c
+++ b/crypto/x509/x509cset.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
-#include "e_os.h"
+#include "internal/refcount.h"
#include <openssl/asn1.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
diff --git a/e_os.h b/e_os.h
index 2310e32c84..14089f5655 100644
--- a/e_os.h
+++ b/e_os.h
@@ -25,13 +25,6 @@
extern "C" {
#endif
-/* Used to checking reference counts, most while doing perl5 stuff :-) */
-# if defined(OPENSSL_NO_STDIO)
-# if defined(REF_PRINT)
-# error "REF_PRINT requires stdio"
-# endif
-# endif
-
/*
* Format specifier for printing size_t. Original conundrum was to
* get it working with -Wformat [-Werror], which can be considered
@@ -59,19 +52,6 @@ extern "C" {
* stand for in ILP32 and LP64 */
# endif
-# if !defined(NDEBUG) && !defined(OPENSSL_NO_STDIO)
-# define REF_ASSERT_ISNT(test) \
- (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
-# else
-# define REF_ASSERT_ISNT(i)
-# endif
-# ifdef REF_PRINT
-# define REF_PRINT_COUNT(a, b) \
- fprintf(stderr, "%p:%4d:%s\n", b, b->references, a)
-# else
-# define REF_PRINT_COUNT(a, b)
-# endif
-
# define OPENSSL_CONF "openssl.cnf"
# ifndef DEVRANDOM
diff --git a/include/internal/refcount.h b/include/internal/refcount.h
index 591561ffee..c1663a0f83 100644
--- a/include/internal/refcount.h
+++ b/include/internal/refcount.h
@@ -9,6 +9,13 @@
#ifndef HEADER_INTERNAL_REFCOUNT_H
# define HEADER_INTERNAL_REFCOUNT_H
+/* Used to checking reference counts, most while doing perl5 stuff :-) */
+# if defined(OPENSSL_NO_STDIO)
+# if defined(REF_PRINT)
+# error "REF_PRINT requires stdio"
+# endif
+# endif
+
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
&& !defined(__STDC_NO_ATOMICS__)
# include <stdatomic.h>
@@ -64,4 +71,19 @@ typedef int CRYPTO_REF_COUNT;
# define CRYPTO_DOWN_REF(val, ret, lock) CRYPTO_atomic_add(val, -1, ret, lock)
# endif
+
+# if !defined(NDEBUG) && !defined(OPENSSL_NO_STDIO)
+# define REF_ASSERT_ISNT(test) \
+ (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
+# else
+# define REF_ASSERT_ISNT(i)
+# endif
+
+# ifdef REF_PRINT
+# define REF_PRINT_COUNT(a, b) \
+ fprintf(stderr, "%p:%4d:%s\n", b, b->references, a)
+# else
+# define REF_PRINT_COUNT(a, b)
+# endif
+
#endif
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index ad78545f8c..bbffce0f93 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -24,7 +24,7 @@
#include <openssl/dh.h>
#include <openssl/bn.h>
#include <openssl/crypto.h>
-#include "e_os.h"
+#include "internal/refcount.h"
#include "ssl_locl.h"
#include "ssl_cert_table.h"
#include "internal/thread_once.h"
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index eb8603da1e..cac8820013 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -10,7 +10,6 @@
*/
#include <stdio.h>
-#include "e_os.h"
#include "ssl_locl.h"
#include <openssl/objects.h>
#include <openssl/lhash.h>
@@ -23,6 +22,7 @@
#include <openssl/ct.h>
#include "internal/cryptlib.h"
#include "internal/rand.h"
+#include "internal/refcount.h"
const char SSL_version_str[] = OPENSSL_VERSION_TEXT;
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index ea5309e819..575cd70ef0 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -12,7 +12,7 @@
#include <openssl/lhash.h>
#include <openssl/rand.h>
#include <openssl/engine.h>
-#include "e_os.h"
+#include "internal/refcount.h"
#include "ssl_locl.h"
#include "statem/statem_locl.h"