From 7f41ffd44529b5a42d8af7b8f0529f74c4cd7f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caleb=20=E3=83=84=20Everett?= Date: Mon, 11 Jan 2021 14:03:13 -0800 Subject: [PATCH] build: fix compiling against openssl with no-psk fixes #36464 Node 15 prior to this commit will not compile if openssl is built with no-psk. Compiling emits an error like this: ``` crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)' ``` Blame on crypto_tls.cc shows the file was created in a refactor. Before that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef https://github.com/nodejs/node/blob/6751b6dc3da102f259b74b7453032edadc7a37ca/src/crypto/crypto_ssl.cc#L839 --- src/crypto/crypto_tls.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/crypto_tls.cc b/src/crypto/crypto_tls.cc index f4850e425f46b3..52e57ab9862021 100644 --- a/src/crypto/crypto_tls.cc +++ b/src/crypto/crypto_tls.cc @@ -1339,8 +1339,6 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) { return SSL_TLSEXT_ERR_OK; } -#ifndef OPENSSL_NO_PSK - int TLSWrap::SetCACerts(SecureContext* sc) { int err = SSL_set1_verify_cert_store( ssl_.get(), SSL_CTX_get_cert_store(sc->ctx_.get())); @@ -1355,6 +1353,8 @@ int TLSWrap::SetCACerts(SecureContext* sc) { return 1; } +#ifndef OPENSSL_NO_PSK + void TLSWrap::SetPskIdentityHint(const FunctionCallbackInfo& args) { TLSWrap* p; ASSIGN_OR_RETURN_UNWRAP(&p, args.Holder());