Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/crypto/crypto_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,10 @@ void InitCryptoOnce() {

// Turn off compression. Saves memory and protects against CRIME attacks.
// No-op with OPENSSL_NO_COMP builds of OpenSSL.
sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
STACK_OF(SSL_COMP)* comp_methods = SSL_COMP_get_compression_methods();
while (sk_SSL_COMP_num(comp_methods) > 0) {
OPENSSL_free(sk_SSL_COMP_pop(comp_methods));
}

#ifndef OPENSSL_NO_ENGINE
EnginePointer::initEnginesOnce();
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-tls-certificate-compression.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ const fixtureCert = fixtures.readKey('agent1-cert.pem');
// Test: certificate compression must not enable record-level compression.
//
// RFC 8879 certificate compression is unrelated to TLS record compression
// (the CRIME attack vector). The latter is disabled by Node at startup via
// sk_SSL_COMP_zero, and by modern OpenSSL defaults as well. To confirm, we
// (the CRIME attack vector). The latter is disabled by Node at startup in
// InitCryptoOnce(), and by modern OpenSSL defaults as well. To confirm, we
// Verify a ClientHello sent by Node only advertises null record compression.
(async () => {
const { promise: clientHelloReceived, resolve: onClientHello } =
Expand Down
Loading