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;