Skip to content

Commit

Permalink
[rust] Revert "[Sanitizers] intercept md5 and sha* apis on FreeBSD."
Browse files Browse the repository at this point in the history
This reverts commit 18a7ebd.

Not supported on FreeBSD 11.
  • Loading branch information
nikic committed Feb 13, 2022
1 parent adef757 commit 4b7c1b4
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,10 @@
#define SANITIZER_INTERCEPT_SHA1 SI_NETBSD
#define SANITIZER_INTERCEPT_MD4 SI_NETBSD
#define SANITIZER_INTERCEPT_RMD160 SI_NETBSD
#define SANITIZER_INTERCEPT_MD5 (SI_NETBSD || SI_FREEBSD)
#define SANITIZER_INTERCEPT_MD5 SI_NETBSD
#define SANITIZER_INTERCEPT_FSEEK (SI_NETBSD || SI_FREEBSD)
#define SANITIZER_INTERCEPT_MD2 SI_NETBSD
#define SANITIZER_INTERCEPT_SHA2 (SI_NETBSD || SI_FREEBSD)
#define SANITIZER_INTERCEPT_SHA2 SI_NETBSD
#define SANITIZER_INTERCEPT_CDB SI_NETBSD
#define SANITIZER_INTERCEPT_VIS (SI_NETBSD || SI_FREEBSD)
#define SANITIZER_INTERCEPT_POPEN SI_POSIX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@
#include <semaphore.h>
#include <signal.h>
#include <stddef.h>
#include <md5.h>
#include <sha224.h>
#include <sha256.h>
#include <sha384.h>
#include <sha512.h>
#include <stdio.h>
#include <stringlist.h>
#include <term.h>
Expand Down Expand Up @@ -366,22 +361,6 @@ const int si_SEGV_MAPERR = SEGV_MAPERR;
const int si_SEGV_ACCERR = SEGV_ACCERR;
const int unvis_valid = UNVIS_VALID;
const int unvis_validpush = UNVIS_VALIDPUSH;

const unsigned MD5_CTX_sz = sizeof(MD5_CTX);
const unsigned MD5_return_length = MD5_DIGEST_STRING_LENGTH;

#define SHA2_CONST(LEN) \
const unsigned SHA##LEN##_CTX_sz = sizeof(SHA##LEN##_CTX); \
const unsigned SHA##LEN##_return_length = SHA##LEN##_DIGEST_STRING_LENGTH; \
const unsigned SHA##LEN##_block_length = SHA##LEN##_BLOCK_LENGTH; \
const unsigned SHA##LEN##_digest_length = SHA##LEN##_DIGEST_LENGTH

SHA2_CONST(224);
SHA2_CONST(256);
SHA2_CONST(384);
SHA2_CONST(512);

#undef SHA2_CONST
} // namespace __sanitizer

using namespace __sanitizer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,22 +647,6 @@ extern unsigned IOCTL_KDSKBMODE;
extern const int si_SEGV_MAPERR;
extern const int si_SEGV_ACCERR;

extern const unsigned MD5_CTX_sz;
extern const unsigned MD5_return_length;

#define SHA2_EXTERN(LEN) \
extern const unsigned SHA##LEN##_CTX_sz; \
extern const unsigned SHA##LEN##_return_length; \
extern const unsigned SHA##LEN##_block_length; \
extern const unsigned SHA##LEN##_digest_length

SHA2_EXTERN(224);
SHA2_EXTERN(256);
SHA2_EXTERN(384);
SHA2_EXTERN(512);

#undef SHA2_EXTERN

struct __sanitizer_cap_rights {
u64 cr_rights[2];
};
Expand Down
119 changes: 0 additions & 119 deletions compiler-rt/test/sanitizer_common/TestCases/FreeBSD/md5.cpp

This file was deleted.

Loading

0 comments on commit 4b7c1b4

Please sign in to comment.