Parcourir la source

Move OPENSSL_ASAN to base.h.

Saves having it in several places.

Change-Id: I329e1bf4dd4a7f51396e36e2604280fcca32b58c
Reviewed-on: https://boringssl-review.googlesource.com/16026
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
kris/onging/CECPQ3_patch15
Adam Langley il y a 7 ans
committed by CQ bot account: commit-bot@chromium.org
Parent
révision
208e239371
4 fichiers modifiés avec 12 ajouts et 18 suppressions
  1. +4
    -10
      crypto/fipsmodule/bcm.c
  2. +0
    -6
      crypto/fipsmodule/is_fips.c
  3. +2
    -2
      crypto/test/malloc.cc
  4. +6
    -0
      include/openssl/base.h

+ 4
- 10
crypto/fipsmodule/bcm.c Voir le fichier

@@ -95,14 +95,6 @@

#if defined(BORINGSSL_FIPS)

#if defined(__has_feature)
#if __has_feature(address_sanitizer)
/* Integrity tests cannot run under ASAN because it involves reading the full
* .text section, which triggers the global-buffer overflow detection. */
#define OPENSSL_ASAN
#endif
#endif

static void hexdump(const uint8_t *in, size_t len) {
for (size_t i = 0; i < len; i++) {
printf("%02x", in[i]);
@@ -296,7 +288,7 @@ static EC_KEY *self_test_ecdsa_key(void) {
return ec_key;
}

#ifndef OPENSSL_ASAN
#if !defined(OPENSSL_ASAN)
/* These symbols are filled in by delocate.go. They point to the start and end
* of the module, and the location of the integrity hash, respectively. */
extern const uint8_t BORINGSSL_bcm_text_start[];
@@ -309,7 +301,9 @@ static void BORINGSSL_bcm_power_on_self_test(void) __attribute__((constructor));
static void BORINGSSL_bcm_power_on_self_test(void) {
CRYPTO_library_init();

#ifndef OPENSSL_ASAN
#if !defined(OPENSSL_ASAN)
/* Integrity tests cannot run under ASAN because it involves reading the full
* .text section, which triggers the global-buffer overflow detection. */
const uint8_t *const start = BORINGSSL_bcm_text_start;
const uint8_t *const end = BORINGSSL_bcm_text_end;



+ 0
- 6
crypto/fipsmodule/is_fips.c Voir le fichier

@@ -18,12 +18,6 @@
/* This file exists in order to give the fipsmodule target, in non-FIPS mode,
* something to compile. */

#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define OPENSSL_ASAN
#endif
#endif

int FIPS_mode(void) {
#if defined(BORINGSSL_FIPS) && !defined(OPENSSL_ASAN)
return 1;


+ 2
- 2
crypto/test/malloc.cc Voir le fichier

@@ -16,7 +16,7 @@

#if defined(__has_feature)
#if __has_feature(address_sanitizer) || __has_feature(memory_sanitizer)
#define OPENSSL_ASAN
#define OPENSSL_ASAN_OR_MSAN
#endif
#endif

@@ -32,7 +32,7 @@
// TODO(davidben): See if this and ASan's and MSan's interceptors can be made to
// coexist.
#if defined(__linux__) && defined(OPENSSL_GLIBC) && !defined(OPENSSL_ARM) && \
!defined(OPENSSL_AARCH64) && !defined(OPENSSL_ASAN)
!defined(OPENSSL_AARCH64) && !defined(OPENSSL_ASAN_OR_MSAN)

#include <errno.h>
#include <signal.h>


+ 6
- 0
include/openssl/base.h Voir le fichier

@@ -202,6 +202,12 @@ extern "C" {
#define BORINGSSL_UNSAFE_DETERMINISTIC_MODE
#endif

#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define OPENSSL_ASAN
#endif
#endif

/* CRYPTO_THREADID is a dummy value. */
typedef int CRYPTO_THREADID;



Chargement…
Annuler
Enregistrer