Get rid of hazardous EVP_DigestInit_dbg/EVP_DigestInit case

distinction (which does not work well because if CRYPTO_MDEBUG is
defined at library compile time, it is not necessarily defined at
application compile time; and memory debugging now can be reconfigured
at run-time anyway).  To get the intended semantics, we could just use
the EVP_DigestInit_dbg unconditionally (which uses the caller's
__FILE__ and __LINE__ for memory leak debugging), but this would make
memory debugging inconsistent.  Instead, callers can use
CRYPTO_push_info() to track down memory leaks.
This commit is contained in:
Bodo Möller 2001-09-10 15:00:30 +00:00
parent 5ba372b17c
commit 5e54b4f364

View File

@ -455,13 +455,7 @@ EVP_MD_CTX *EVP_MD_CTX_create(void);
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in); int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in);
#define EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) #define EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
#ifdef CRYPTO_MDEBUG
int EVP_DigestInit_dbg(EVP_MD_CTX *ctx, const EVP_MD *type,
const char *file,int line);
#define EVP_DigestInit(ctx,type) EVP_DigestInit_dbg(ctx,type,__FILE__,__LINE__)
#else
int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
#endif
int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d,
unsigned int cnt); unsigned int cnt);
int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);