Browse Source

silence unused variable warnings when using OPENSSL_clear_free

e.g. here: adbe3b837e/src/node_crypto.cc (L3439)

Change-Id: I2d43a3439d6a56c8eee3636b3c1f5ba615b233ba
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/35144
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Jeremy Apthorp 5 years ago
committed by CQ bot account: commit-bot@chromium.org
parent
commit
1fa5abc0b4
2 changed files with 5 additions and 1 deletions
  1. +4
    -0
      crypto/mem.c
  2. +1
    -1
      include/openssl/mem.h

+ 4
- 0
crypto/mem.c View File

@@ -153,6 +153,10 @@ void OPENSSL_cleanse(void *ptr, size_t len) {
#endif // !OPENSSL_NO_ASM
}

void OPENSSL_clear_free(void *ptr, size_t unused) {
OPENSSL_free(ptr);
}

int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) {
const uint8_t *a = in_a;
const uint8_t *b = in_b;


+ 1
- 1
include/openssl/mem.h View File

@@ -138,7 +138,7 @@ OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format,

// OPENSSL_clear_free calls |OPENSSL_free|. BoringSSL automatically clears all
// allocations on free, but we define |OPENSSL_clear_free| for compatibility.
#define OPENSSL_clear_free(ptr, len) OPENSSL_free(ptr)
OPENSSL_EXPORT void OPENSSL_clear_free(void *ptr, size_t len);


#if defined(__cplusplus)


Loading…
Cancel
Save