diff options
-rw-r--r-- | crypto/engine/eng_int.h | 4 | ||||
-rw-r--r-- | crypto/lock.c | 6 | ||||
-rw-r--r-- | demos/engines/cluster_labs/hw_cluster_labs_err.h | 2 | ||||
-rw-r--r-- | demos/engines/ibmca/hw_ibmca_err.h | 2 | ||||
-rw-r--r-- | demos/engines/rsaref/rsaref_err.h | 2 | ||||
-rw-r--r-- | demos/engines/zencod/hw_zencod_err.h | 2 | ||||
-rw-r--r-- | doc/crypto/threads.pod | 10 | ||||
-rw-r--r-- | engines/e_capi_err.h | 2 | ||||
-rw-r--r-- | engines/e_chil_err.h | 2 | ||||
-rw-r--r-- | engines/e_ossltest_err.h | 2 | ||||
-rw-r--r-- | engines/e_ubsec_err.h | 2 | ||||
-rw-r--r-- | include/openssl/crypto.h | 14 | ||||
-rw-r--r-- | include/openssl/err.h | 70 | ||||
-rw-r--r-- | include/openssl/opensslconf.h.in | 10 | ||||
-rw-r--r-- | ssl/record/ssl3_record.c | 4 | ||||
-rw-r--r-- | ssl/statem/statem_dtls.c | 2 | ||||
-rw-r--r-- | util/mkerr.pl | 4 |
17 files changed, 74 insertions, 66 deletions
diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h index 8122922717..0eee21163a 100644 --- a/crypto/engine/eng_int.h +++ b/crypto/engine/eng_int.h @@ -86,7 +86,7 @@ extern "C" { (unsigned int)(e), (isfunct ? "funct" : "struct"), \ ((isfunct) ? ((e)->funct_ref - (diff)) : ((e)->struct_ref - (diff))), \ ((isfunct) ? (e)->funct_ref : (e)->struct_ref), \ - (__FILE__), (__LINE__)) + (OPENSSL_FILE), (OPENSSL_LINE)) # else @@ -134,7 +134,7 @@ ENGINE *engine_table_select(ENGINE_TABLE **table, int nid); # else ENGINE *engine_table_select_tmp(ENGINE_TABLE **table, int nid, const char *f, int l); -# define engine_table_select(t,n) engine_table_select_tmp(t,n,__FILE__,__LINE__) +# define engine_table_select(t,n) engine_table_select_tmp(t,n,OPENSSL_FILE,OPENSSL_LINE) # endif typedef void (engine_table_doall_cb) (int nid, STACK_OF(ENGINE) *sk, ENGINE *def, void *arg); diff --git a/crypto/lock.c b/crypto/lock.c index 9be78c4ed8..5a42dc9094 100644 --- a/crypto/lock.c +++ b/crypto/lock.c @@ -255,7 +255,7 @@ int CRYPTO_get_new_dynlockid(void) return (0); } pointer->references = 1; - pointer->data = dynlock_create_callback(__FILE__, __LINE__); + pointer->data = dynlock_create_callback(OPENSSL_FILE, OPENSSL_LINE); if (pointer->data == NULL) { OPENSSL_free(pointer); CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE); @@ -281,7 +281,7 @@ int CRYPTO_get_new_dynlockid(void) CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); if (i == -1) { - dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); + dynlock_destroy_callback(pointer->data, OPENSSL_FILE, OPENSSL_LINE); OPENSSL_free(pointer); } else i += 1; /* to avoid 0 */ @@ -319,7 +319,7 @@ void CRYPTO_destroy_dynlockid(int i) CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); if (pointer) { - dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); + dynlock_destroy_callback(pointer->data, OPENSSL_FILE, OPENSSL_LINE); OPENSSL_free(pointer); } } diff --git a/demos/engines/cluster_labs/hw_cluster_labs_err.h b/demos/engines/cluster_labs/hw_cluster_labs_err.h index 3300e11d89..e9e58d5e31 100644 --- a/demos/engines/cluster_labs/hw_cluster_labs_err.h +++ b/demos/engines/cluster_labs/hw_cluster_labs_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_CL_strings(void); static void ERR_unload_CL_strings(void); static void ERR_CL_error(int function, int reason, char *file, int line); -# define CLerr(f,r) ERR_CL_error((f),(r),__FILE__,__LINE__) +# define CLerr(f,r) ERR_CL_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the CL functions. */ diff --git a/demos/engines/ibmca/hw_ibmca_err.h b/demos/engines/ibmca/hw_ibmca_err.h index c17e0c93bd..10d02125ba 100644 --- a/demos/engines/ibmca/hw_ibmca_err.h +++ b/demos/engines/ibmca/hw_ibmca_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_IBMCA_strings(void); static void ERR_unload_IBMCA_strings(void); static void ERR_IBMCA_error(int function, int reason, char *file, int line); -# define IBMCAerr(f,r) ERR_IBMCA_error((f),(r),__FILE__,__LINE__) +# define IBMCAerr(f,r) ERR_IBMCA_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the IBMCA functions. */ diff --git a/demos/engines/rsaref/rsaref_err.h b/demos/engines/rsaref/rsaref_err.h index 0804e08d0a..d230503e97 100644 --- a/demos/engines/rsaref/rsaref_err.h +++ b/demos/engines/rsaref/rsaref_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_RSAREF_strings(void); static void ERR_unload_RSAREF_strings(void); static void ERR_RSAREF_error(int function, int reason, char *file, int line); -# define RSAREFerr(f,r) ERR_RSAREF_error((f),(r),__FILE__,__LINE__) +# define RSAREFerr(f,r) ERR_RSAREF_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the RSAREF functions. */ /* Function codes. */ diff --git a/demos/engines/zencod/hw_zencod_err.h b/demos/engines/zencod/hw_zencod_err.h index f4a8358814..94d3293d59 100644 --- a/demos/engines/zencod/hw_zencod_err.h +++ b/demos/engines/zencod/hw_zencod_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_ZENCOD_strings(void); static void ERR_unload_ZENCOD_strings(void); static void ERR_ZENCOD_error(int function, int reason, char *file, int line); -# define ZENCODerr(f,r) ERR_ZENCOD_error((f),(r),__FILE__,__LINE__) +# define ZENCODerr(f,r) ERR_ZENCOD_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the ZENCOD functions. */ diff --git a/doc/crypto/threads.pod b/doc/crypto/threads.pod index daeaf64df2..9ee75b3843 100644 --- a/doc/crypto/threads.pod +++ b/doc/crypto/threads.pod @@ -51,15 +51,15 @@ CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support void CRYPTO_lock(int mode, int n, const char *file, int line); #define CRYPTO_w_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,OPENSSL_FILE,OPENSSL_LINE) #define CRYPTO_w_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,OPENSSL_FILE,OPENSSL_LINE) #define CRYPTO_r_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,OPENSSL_FILE,OPENSSL_LINE) #define CRYPTO_r_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,OPENSSL_FILE,OPENSSL_LINE) #define CRYPTO_add(addr,amount,type) \ - CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) + CRYPTO_add_lock(addr,amount,type,OPENSSL_FILE,OPENSSL_LINE) =head1 DESCRIPTION diff --git a/engines/e_capi_err.h b/engines/e_capi_err.h index 8a0e5c5f46..01ec2efaec 100644 --- a/engines/e_capi_err.h +++ b/engines/e_capi_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_CAPI_strings(void); static void ERR_unload_CAPI_strings(void); static void ERR_CAPI_error(int function, int reason, char *file, int line); -# define CAPIerr(f,r) ERR_CAPI_error((f),(r),__FILE__,__LINE__) +# define CAPIerr(f,r) ERR_CAPI_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the CAPI functions. */ diff --git a/engines/e_chil_err.h b/engines/e_chil_err.h index d86a4ce9ae..3d961b9340 100644 --- a/engines/e_chil_err.h +++ b/engines/e_chil_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_HWCRHK_strings(void); static void ERR_unload_HWCRHK_strings(void); static void ERR_HWCRHK_error(int function, int reason, char *file, int line); -# define HWCRHKerr(f,r) ERR_HWCRHK_error((f),(r),__FILE__,__LINE__) +# define HWCRHKerr(f,r) ERR_HWCRHK_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the HWCRHK functions. */ diff --git a/engines/e_ossltest_err.h b/engines/e_ossltest_err.h index b46eb05c1c..b30509dc40 100644 --- a/engines/e_ossltest_err.h +++ b/engines/e_ossltest_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_OSSLTEST_strings(void); static void ERR_unload_OSSLTEST_strings(void); static void ERR_OSSLTEST_error(int function, int reason, char *file, int line); -# define OSSLTESTerr(f,r) ERR_OSSLTEST_error((f),(r),__FILE__,__LINE__) +# define OSSLTESTerr(f,r) ERR_OSSLTEST_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the OSSLTEST functions. */ diff --git a/engines/e_ubsec_err.h b/engines/e_ubsec_err.h index c8aec7c323..67110edc57 100644 --- a/engines/e_ubsec_err.h +++ b/engines/e_ubsec_err.h @@ -67,7 +67,7 @@ extern "C" { static void ERR_load_UBSEC_strings(void); static void ERR_unload_UBSEC_strings(void); static void ERR_UBSEC_error(int function, int reason, char *file, int line); -# define UBSECerr(f,r) ERR_UBSEC_error((f),(r),__FILE__,__LINE__) +# define UBSECerr(f,r) ERR_UBSEC_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) /* Error codes for the UBSEC functions. */ diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 0a88b66d8b..64a431e0ed 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -216,15 +216,15 @@ extern "C" { # ifndef OPENSSL_NO_LOCKING # ifndef CRYPTO_w_lock # define CRYPTO_w_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,OPENSSL_FILE,OPENSSL_LINE) # define CRYPTO_w_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,OPENSSL_FILE,OPENSSL_LINE) # define CRYPTO_r_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,OPENSSL_FILE,OPENSSL_LINE) # define CRYPTO_r_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,OPENSSL_FILE,OPENSSL_LINE) # define CRYPTO_add(addr,amount,type) \ - CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) + CRYPTO_add_lock(addr,amount,type,OPENSSL_FILE,OPENSSL_LINE) # endif # else # define CRYPTO_w_lock(a) @@ -465,7 +465,7 @@ void OPENSSL_cleanse(void *ptr, size_t len); # ifndef OPENSSL_NO_CRYPTO_MDEBUG # define OPENSSL_mem_debug_push(info) \ - CRYPTO_mem_debug_push(info, __FILE__, __LINE__) + CRYPTO_mem_debug_push(info, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_mem_debug_pop() \ CRYPTO_mem_debug_pop() int CRYPTO_mem_debug_push(const char *info, const char *file, int line); @@ -492,7 +492,7 @@ int CRYPTO_mem_leaks(struct bio_st *bio); /* die if we have to */ void OpenSSLDie(const char *file, int line, const char *assertion); -# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) +# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(OPENSSL_FILE, OPENSSL_LINE, #e),1)) unsigned int *OPENSSL_ia32cap_loc(void); # define OPENSSL_ia32cap ((OPENSSL_ia32cap_loc())[0]) diff --git a/include/openssl/err.h b/include/openssl/err.h index 390ee74f88..8c3b1aa3e4 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -197,41 +197,41 @@ typedef struct err_state_st { # define ERR_LIB_USER 128 -# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) -# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) -# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) -# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) -# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) -# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) -# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) -# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) -# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) -# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) -# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) -# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) -# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) -# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) -# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) -# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) -# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) -# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) -# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) -# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) -# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) -# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) -# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) -# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) -# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) -# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) -# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) -# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) -# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) -# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) -# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__) -# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) -# define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),__FILE__,__LINE__) -# define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),__FILE__,__LINE__) +# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) /* * Borland C seems too stupid to be able to shift and do longs in the diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in index d9f64292ca..e5f3ccdc43 100644 --- a/include/openssl/opensslconf.h.in +++ b/include/openssl/opensslconf.h.in @@ -91,6 +91,16 @@ EOF # define DECLARE_DEPRECATED(f) f; #endif +#ifndef OPENSSL_FILE +#ifdef OPENSSL_NO_FILENAMES +#define OPENSSL_FILE "" +#define OPENSSL_LINE 0 +#else +#define OPENSSL_FILE __FILE__ +#define OPENSSL_LINE __LINE__ +#endif +#endif + #ifndef OPENSSL_MIN_API # define OPENSSL_MIN_API 0 #endif diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c index 919202a46e..d7e821d49e 100644 --- a/ssl/record/ssl3_record.c +++ b/ssl/record/ssl3_record.c @@ -678,9 +678,7 @@ int tls1_enc(SSL *s, int send) * we can't write into the input stream: Can this ever * happen?? (steve) */ - fprintf(stderr, - "%s:%d: rec->data != rec->input\n", - __FILE__, __LINE__); + fprintf(stderr, "tls1_enc(): rec->data != rec->input\n"); else if (RAND_bytes(rec->input, ivlen) <= 0) return -1; } diff --git a/ssl/statem/statem_dtls.c b/ssl/statem/statem_dtls.c index 765c8e1efc..09f5df1ec7 100644 --- a/ssl/statem/statem_dtls.c +++ b/ssl/statem/statem_dtls.c @@ -1022,7 +1022,7 @@ WORK_STATE dtls_wait_for_dry(SSL *s) int dtls1_read_failed(SSL *s, int code) { if (code > 0) { - fprintf(stderr, "invalid state reached %s:%d", __FILE__, __LINE__); + fprintf(stderr, "dtls1_read_failed(); invalid state reached\n"); return 1; } diff --git a/util/mkerr.pl b/util/mkerr.pl index 939a87c07c..4fd5520d87 100644 --- a/util/mkerr.pl +++ b/util/mkerr.pl @@ -94,7 +94,7 @@ Options: void ERR_load_<LIB>_strings(void); void ERR_unload_<LIB>_strings(void); void ERR_<LIB>_error(int f, int r, char *fn, int ln); - #define <LIB>err(f,r) ERR_<LIB>_error(f,r,__FILE__,__LINE__) + #define <LIB>err(f,r) ERR_<LIB>_error(f,r,OPENSSL_FILE,OPENSSL_LINE) while the code facilitates the use of these in an environment where the error support routines are dynamically loaded at runtime. @@ -493,7 +493,7 @@ EOF ${staticloader}void ERR_load_${lib}_strings(void); ${staticloader}void ERR_unload_${lib}_strings(void); ${staticloader}void ERR_${lib}_error(int function, int reason, char *file, int line); -# define ${lib}err(f,r) ERR_${lib}_error((f),(r),__FILE__,__LINE__) +# define ${lib}err(f,r) ERR_${lib}_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) EOF } |