Skip to content

Commit

Permalink
Use memcmp() instead of CRYPTO_memcmp() when fuzzing
Browse files Browse the repository at this point in the history
Reviewed-by: Andy Polyakov <appro@openssl.org>
GH: #2633
  • Loading branch information
kroeckx committed Mar 19, 2017
1 parent 4979108 commit 43c5641
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions crypto/cryptlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ void OPENSSL_die(const char *message, const char *file, int line)
*
* There are also assembler versions of this function.
*/
# undef CRYPTO_memcmp
int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len)
{
size_t i;
Expand Down
4 changes: 4 additions & 0 deletions e_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ struct servent *getservbyname(const char *name, const char *proto);

#define OSSL_NELEM(x) (sizeof(x)/sizeof(x[0]))

#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# define CRYPTO_memcmp memcmp
#endif

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 43c5641

Please sign in to comment.