@@ -8877,83 +8877,6 @@ INTERCEPTOR(char *, RMD160Data, u8 *data, SIZE_T len, char *buf) {
88778877#define INIT_RMD160
88788878#endif
88798879
8880- #if SANITIZER_INTERCEPT_MD5
8881- INTERCEPTOR (void , MD5Init, void *context) {
8882- void *ctx;
8883- COMMON_INTERCEPTOR_ENTER (ctx, MD5Init, context);
8884- REAL (MD5Init)(context);
8885- if (context)
8886- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, MD5_CTX_sz);
8887- }
8888-
8889- INTERCEPTOR (void , MD5Update, void *context, const unsigned char *data,
8890- unsigned int len) {
8891- void *ctx;
8892- COMMON_INTERCEPTOR_ENTER (ctx, MD5Update, context, data, len);
8893- if (data && len > 0 )
8894- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len);
8895- if (context)
8896- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, MD5_CTX_sz);
8897- REAL (MD5Update)(context, data, len);
8898- if (context)
8899- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, MD5_CTX_sz);
8900- }
8901-
8902- INTERCEPTOR (void , MD5Final, unsigned char digest[16 ], void *context) {
8903- void *ctx;
8904- COMMON_INTERCEPTOR_ENTER (ctx, MD5Final, digest, context);
8905- if (context)
8906- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, MD5_CTX_sz);
8907- REAL (MD5Final)(digest, context);
8908- if (digest)
8909- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, digest, sizeof (unsigned char ) * 16 );
8910- }
8911-
8912- INTERCEPTOR (char *, MD5End, void *context, char *buf) {
8913- void *ctx;
8914- COMMON_INTERCEPTOR_ENTER (ctx, MD5End, context, buf);
8915- if (context)
8916- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, MD5_CTX_sz);
8917- char *ret = REAL (MD5End)(context, buf);
8918- if (ret)
8919- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, MD5_return_length);
8920- return ret;
8921- }
8922-
8923- INTERCEPTOR (char *, MD5File, const char *filename, char *buf) {
8924- void *ctx;
8925- COMMON_INTERCEPTOR_ENTER (ctx, MD5File, filename, buf);
8926- if (filename)
8927- COMMON_INTERCEPTOR_READ_RANGE (ctx, filename, internal_strlen (filename) + 1 );
8928- char *ret = REAL (MD5File)(filename, buf);
8929- if (ret)
8930- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, MD5_return_length);
8931- return ret;
8932- }
8933-
8934- INTERCEPTOR (char *, MD5Data, const unsigned char *data, unsigned int len,
8935- char *buf) {
8936- void *ctx;
8937- COMMON_INTERCEPTOR_ENTER (ctx, MD5Data, data, len, buf);
8938- if (data && len > 0 )
8939- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len);
8940- char *ret = REAL (MD5Data)(data, len, buf);
8941- if (ret)
8942- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, MD5_return_length);
8943- return ret;
8944- }
8945-
8946- #define INIT_MD5 \
8947- COMMON_INTERCEPT_FUNCTION (MD5Init); \
8948- COMMON_INTERCEPT_FUNCTION (MD5Update); \
8949- COMMON_INTERCEPT_FUNCTION (MD5Final); \
8950- COMMON_INTERCEPT_FUNCTION (MD5End); \
8951- COMMON_INTERCEPT_FUNCTION (MD5File); \
8952- COMMON_INTERCEPT_FUNCTION (MD5Data)
8953- #else
8954- #define INIT_MD5
8955- #endif
8956-
89578880#if SANITIZER_INTERCEPT_FSEEK
89588881INTERCEPTOR (int , fseek, __sanitizer_FILE *stream, long int offset, int whence) {
89598882 void *ctx;
@@ -9084,107 +9007,6 @@ INTERCEPTOR(char *, MD2Data, const unsigned char *data, unsigned int len,
90849007#define INIT_MD2
90859008#endif
90869009
9087- #if SANITIZER_INTERCEPT_SHA2
9088- #define SHA2_INTERCEPTORS (LEN, SHA2_STATE_T ) \
9089- INTERCEPTOR (void , SHA##LEN##_Init, void *context) { \
9090- void *ctx; \
9091- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Init, context); \
9092- REAL (SHA##LEN##_Init)(context); \
9093- if (context) \
9094- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9095- } \
9096- INTERCEPTOR (void , SHA##LEN##_Update, void *context, \
9097- const u8 *data, SIZE_T len) { \
9098- void *ctx; \
9099- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Update, context, data, len); \
9100- if (data && len > 0 ) \
9101- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len); \
9102- if (context) \
9103- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9104- REAL (SHA##LEN##_Update)(context, data, len); \
9105- if (context) \
9106- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9107- } \
9108- INTERCEPTOR (void , SHA##LEN##_Final, u8 digest[LEN/8 ], \
9109- void *context) { \
9110- void *ctx; \
9111- CHECK_EQ (SHA##LEN##_digest_length, LEN/8 ); \
9112- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Final, digest, context); \
9113- if (context) \
9114- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9115- REAL (SHA##LEN##_Final)(digest, context); \
9116- if (digest) \
9117- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, digest, \
9118- sizeof (digest[0 ]) * \
9119- SHA##LEN##_digest_length); \
9120- } \
9121- INTERCEPTOR (char *, SHA##LEN##_End, void *context, char *buf) { \
9122- void *ctx; \
9123- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_End, context, buf); \
9124- if (context) \
9125- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9126- char *ret = REAL (SHA##LEN##_End)(context, buf); \
9127- if (ret) \
9128- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9129- return ret; \
9130- } \
9131- INTERCEPTOR (char *, SHA##LEN##_File, const char *filename, char *buf) { \
9132- void *ctx; \
9133- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_File, filename, buf); \
9134- if (filename) \
9135- COMMON_INTERCEPTOR_READ_RANGE (ctx, filename, internal_strlen (filename) + 1 );\
9136- char *ret = REAL (SHA##LEN##_File)(filename, buf); \
9137- if (ret) \
9138- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9139- return ret; \
9140- } \
9141- INTERCEPTOR (char *, SHA##LEN##_FileChunk, const char *filename, char *buf, \
9142- OFF_T offset, OFF_T length) { \
9143- void *ctx; \
9144- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_FileChunk, filename, buf, offset, \
9145- length); \
9146- if (filename) \
9147- COMMON_INTERCEPTOR_READ_RANGE (ctx, filename, internal_strlen (filename) + 1 );\
9148- char *ret = REAL (SHA##LEN##_FileChunk)(filename, buf, offset, length); \
9149- if (ret) \
9150- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9151- return ret; \
9152- } \
9153- INTERCEPTOR (char *, SHA##LEN##_Data, u8 *data, SIZE_T len, char *buf) { \
9154- void *ctx; \
9155- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Data, data, len, buf); \
9156- if (data && len > 0 ) \
9157- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len); \
9158- char *ret = REAL (SHA##LEN##_Data)(data, len, buf); \
9159- if (ret) \
9160- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9161- return ret; \
9162- }
9163-
9164- SHA2_INTERCEPTORS (224 , u32 )
9165- SHA2_INTERCEPTORS (256 , u32 )
9166- SHA2_INTERCEPTORS (384 , u64 )
9167- SHA2_INTERCEPTORS (512 , u64 )
9168-
9169- #define INIT_SHA2_INTECEPTORS (LEN ) \
9170- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Init); \
9171- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Update); \
9172- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Final); \
9173- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_End); \
9174- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_File); \
9175- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_FileChunk); \
9176- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Data)
9177-
9178- #define INIT_SHA2 \
9179- INIT_SHA2_INTECEPTORS (224 ); \
9180- INIT_SHA2_INTECEPTORS (256 ); \
9181- INIT_SHA2_INTECEPTORS (384 ); \
9182- INIT_SHA2_INTECEPTORS (512 )
9183- #undef SHA2_INTERCEPTORS
9184- #else
9185- #define INIT_SHA2
9186- #endif
9187-
91889010#if SANITIZER_INTERCEPT_VIS
91899011INTERCEPTOR (char *, vis, char *dst, int c, int flag, int nextc) {
91909012 void *ctx;
@@ -10659,10 +10481,8 @@ static void InitializeCommonInterceptors() {
1065910481 INIT_SHA1;
1066010482 INIT_MD4;
1066110483 INIT_RMD160;
10662- INIT_MD5;
1066310484 INIT_FSEEK;
1066410485 INIT_MD2;
10665- INIT_SHA2;
1066610486 INIT_VIS;
1066710487 INIT_CDB;
1066810488 INIT_GETFSENT;
0 commit comments