@@ -8823,83 +8823,6 @@ INTERCEPTOR(char *, RMD160Data, u8 *data, SIZE_T len, char *buf) {
88238823#define INIT_RMD160
88248824#endif
88258825
8826- #if SANITIZER_INTERCEPT_MD5
8827- INTERCEPTOR (void , MD5Init, void *context) {
8828- void *ctx;
8829- COMMON_INTERCEPTOR_ENTER (ctx, MD5Init, context);
8830- REAL (MD5Init)(context);
8831- if (context)
8832- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, MD5_CTX_sz);
8833- }
8834-
8835- INTERCEPTOR (void , MD5Update, void *context, const unsigned char *data,
8836- unsigned int len) {
8837- void *ctx;
8838- COMMON_INTERCEPTOR_ENTER (ctx, MD5Update, context, data, len);
8839- if (data && len > 0 )
8840- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len);
8841- if (context)
8842- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, MD5_CTX_sz);
8843- REAL (MD5Update)(context, data, len);
8844- if (context)
8845- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, MD5_CTX_sz);
8846- }
8847-
8848- INTERCEPTOR (void , MD5Final, unsigned char digest[16 ], void *context) {
8849- void *ctx;
8850- COMMON_INTERCEPTOR_ENTER (ctx, MD5Final, digest, context);
8851- if (context)
8852- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, MD5_CTX_sz);
8853- REAL (MD5Final)(digest, context);
8854- if (digest)
8855- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, digest, sizeof (unsigned char ) * 16 );
8856- }
8857-
8858- INTERCEPTOR (char *, MD5End, void *context, char *buf) {
8859- void *ctx;
8860- COMMON_INTERCEPTOR_ENTER (ctx, MD5End, context, buf);
8861- if (context)
8862- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, MD5_CTX_sz);
8863- char *ret = REAL (MD5End)(context, buf);
8864- if (ret)
8865- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, MD5_return_length);
8866- return ret;
8867- }
8868-
8869- INTERCEPTOR (char *, MD5File, const char *filename, char *buf) {
8870- void *ctx;
8871- COMMON_INTERCEPTOR_ENTER (ctx, MD5File, filename, buf);
8872- if (filename)
8873- COMMON_INTERCEPTOR_READ_RANGE (ctx, filename, internal_strlen (filename) + 1 );
8874- char *ret = REAL (MD5File)(filename, buf);
8875- if (ret)
8876- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, MD5_return_length);
8877- return ret;
8878- }
8879-
8880- INTERCEPTOR (char *, MD5Data, const unsigned char *data, unsigned int len,
8881- char *buf) {
8882- void *ctx;
8883- COMMON_INTERCEPTOR_ENTER (ctx, MD5Data, data, len, buf);
8884- if (data && len > 0 )
8885- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len);
8886- char *ret = REAL (MD5Data)(data, len, buf);
8887- if (ret)
8888- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, MD5_return_length);
8889- return ret;
8890- }
8891-
8892- #define INIT_MD5 \
8893- COMMON_INTERCEPT_FUNCTION (MD5Init); \
8894- COMMON_INTERCEPT_FUNCTION (MD5Update); \
8895- COMMON_INTERCEPT_FUNCTION (MD5Final); \
8896- COMMON_INTERCEPT_FUNCTION (MD5End); \
8897- COMMON_INTERCEPT_FUNCTION (MD5File); \
8898- COMMON_INTERCEPT_FUNCTION (MD5Data)
8899- #else
8900- #define INIT_MD5
8901- #endif
8902-
89038826#if SANITIZER_INTERCEPT_FSEEK
89048827INTERCEPTOR (int , fseek, __sanitizer_FILE *stream, long int offset, int whence) {
89058828 void *ctx;
@@ -9030,107 +8953,6 @@ INTERCEPTOR(char *, MD2Data, const unsigned char *data, unsigned int len,
90308953#define INIT_MD2
90318954#endif
90328955
9033- #if SANITIZER_INTERCEPT_SHA2
9034- #define SHA2_INTERCEPTORS (LEN, SHA2_STATE_T ) \
9035- INTERCEPTOR (void , SHA##LEN##_Init, void *context) { \
9036- void *ctx; \
9037- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Init, context); \
9038- REAL (SHA##LEN##_Init)(context); \
9039- if (context) \
9040- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9041- } \
9042- INTERCEPTOR (void , SHA##LEN##_Update, void *context, \
9043- const u8 *data, SIZE_T len) { \
9044- void *ctx; \
9045- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Update, context, data, len); \
9046- if (data && len > 0 ) \
9047- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len); \
9048- if (context) \
9049- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9050- REAL (SHA##LEN##_Update)(context, data, len); \
9051- if (context) \
9052- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9053- } \
9054- INTERCEPTOR (void , SHA##LEN##_Final, u8 digest[LEN/8 ], \
9055- void *context) { \
9056- void *ctx; \
9057- CHECK_EQ (SHA##LEN##_digest_length, LEN/8 ); \
9058- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Final, digest, context); \
9059- if (context) \
9060- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9061- REAL (SHA##LEN##_Final)(digest, context); \
9062- if (digest) \
9063- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, digest, \
9064- sizeof (digest[0 ]) * \
9065- SHA##LEN##_digest_length); \
9066- } \
9067- INTERCEPTOR (char *, SHA##LEN##_End, void *context, char *buf) { \
9068- void *ctx; \
9069- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_End, context, buf); \
9070- if (context) \
9071- COMMON_INTERCEPTOR_READ_RANGE (ctx, context, SHA##LEN##_CTX_sz); \
9072- char *ret = REAL (SHA##LEN##_End)(context, buf); \
9073- if (ret) \
9074- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9075- return ret; \
9076- } \
9077- INTERCEPTOR (char *, SHA##LEN##_File, const char *filename, char *buf) { \
9078- void *ctx; \
9079- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_File, filename, buf); \
9080- if (filename) \
9081- COMMON_INTERCEPTOR_READ_RANGE (ctx, filename, internal_strlen (filename) + 1 );\
9082- char *ret = REAL (SHA##LEN##_File)(filename, buf); \
9083- if (ret) \
9084- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9085- return ret; \
9086- } \
9087- INTERCEPTOR (char *, SHA##LEN##_FileChunk, const char *filename, char *buf, \
9088- OFF_T offset, OFF_T length) { \
9089- void *ctx; \
9090- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_FileChunk, filename, buf, offset, \
9091- length); \
9092- if (filename) \
9093- COMMON_INTERCEPTOR_READ_RANGE (ctx, filename, internal_strlen (filename) + 1 );\
9094- char *ret = REAL (SHA##LEN##_FileChunk)(filename, buf, offset, length); \
9095- if (ret) \
9096- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9097- return ret; \
9098- } \
9099- INTERCEPTOR (char *, SHA##LEN##_Data, u8 *data, SIZE_T len, char *buf) { \
9100- void *ctx; \
9101- COMMON_INTERCEPTOR_ENTER (ctx, SHA##LEN##_Data, data, len, buf); \
9102- if (data && len > 0 ) \
9103- COMMON_INTERCEPTOR_READ_RANGE (ctx, data, len); \
9104- char *ret = REAL (SHA##LEN##_Data)(data, len, buf); \
9105- if (ret) \
9106- COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ret, SHA##LEN##_return_length); \
9107- return ret; \
9108- }
9109-
9110- SHA2_INTERCEPTORS (224 , u32 )
9111- SHA2_INTERCEPTORS (256 , u32 )
9112- SHA2_INTERCEPTORS (384 , u64 )
9113- SHA2_INTERCEPTORS (512 , u64 )
9114-
9115- #define INIT_SHA2_INTECEPTORS (LEN ) \
9116- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Init); \
9117- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Update); \
9118- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Final); \
9119- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_End); \
9120- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_File); \
9121- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_FileChunk); \
9122- COMMON_INTERCEPT_FUNCTION (SHA##LEN##_Data)
9123-
9124- #define INIT_SHA2 \
9125- INIT_SHA2_INTECEPTORS (224 ); \
9126- INIT_SHA2_INTECEPTORS (256 ); \
9127- INIT_SHA2_INTECEPTORS (384 ); \
9128- INIT_SHA2_INTECEPTORS (512 )
9129- #undef SHA2_INTERCEPTORS
9130- #else
9131- #define INIT_SHA2
9132- #endif
9133-
91348956#if SANITIZER_INTERCEPT_VIS
91358957INTERCEPTOR (char *, vis, char *dst, int c, int flag, int nextc) {
91368958 void *ctx;
@@ -10588,10 +10410,8 @@ static void InitializeCommonInterceptors() {
1058810410 INIT_SHA1;
1058910411 INIT_MD4;
1059010412 INIT_RMD160;
10591- INIT_MD5;
1059210413 INIT_FSEEK;
1059310414 INIT_MD2;
10594- INIT_SHA2;
1059510415 INIT_VIS;
1059610416 INIT_CDB;
1059710417 INIT_GETFSENT;
0 commit comments