From 6cdfe4f632cd65dec1ca21c5d8f9be6f31e67da2 Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Tue, 13 Jun 2023 07:38:25 -0700 Subject: [PATCH] Cleaning up Starboardizations from BoringSSL Removes a few direct Starbordization calls, that go through a macro already. b/270864119 --- third_party/boringssl/src/ssl/ssl_buffer.cc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/third_party/boringssl/src/ssl/ssl_buffer.cc b/third_party/boringssl/src/ssl/ssl_buffer.cc index e51ee92f198d..5df810b34702 100644 --- a/third_party/boringssl/src/ssl/ssl_buffer.cc +++ b/third_party/boringssl/src/ssl/ssl_buffer.cc @@ -38,13 +38,7 @@ static_assert((SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) == 0, void SSLBuffer::Clear() { -// TODO(b/270864119): clean up direct references to Starboard APIs and use -// OPENSSL_port_* shims everywhere instead. -#ifdef STARBOARD - SbMemoryDeallocate(buf_); // Allocated with malloc(). -#else OPENSSL_port_free(buf_); // Allocated with malloc(). -#endif buf_ = nullptr; offset_ = 0; size_ = 0; @@ -66,14 +60,8 @@ bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) { // Since this buffer gets allocated quite frequently and doesn't contain any // sensitive data, we allocate with malloc rather than |OPENSSL_malloc| and // avoid zeroing on free. - // - // We need to use SbMemoryAllocate in starboard. uint8_t *new_buf = -#ifdef STARBOARD - (uint8_t *)SbMemoryAllocate(new_cap + SSL3_ALIGN_PAYLOAD - 1); -#else (uint8_t *)OPENSSL_port_malloc(new_cap + SSL3_ALIGN_PAYLOAD - 1); -#endif if (new_buf == NULL) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return false; @@ -85,11 +73,7 @@ bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) { if (buf_ != NULL) { OPENSSL_memcpy(new_buf + new_offset, buf_ + offset_, size_); -#ifdef STARBOARD - SbMemoryDeallocate(buf_); // Allocated with malloc(). -#else OPENSSL_port_free(buf_); // Allocated with malloc(). -#endif } buf_ = new_buf;