diff --git a/src/node_crypto.cc b/src/node_crypto.cc index c4fa6e90200f5b..8f80db52297e4a 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -144,6 +144,7 @@ template void SSLWrap::AddMethods(Environment* env, template void SSLWrap::ConfigureSecureContext(SecureContext* sc); template void SSLWrap::SetSNIContext(SecureContext* sc); template int SSLWrap::SetCACerts(SecureContext* sc); +template void SSLWrap::MemoryInfo(MemoryTracker* tracker) const; template SSL_SESSION* SSLWrap::GetSessionCallback( SSL* s, const unsigned char* key, @@ -3074,6 +3075,12 @@ int SSLWrap::SetCACerts(SecureContext* sc) { return 1; } +template +void SSLWrap::MemoryInfo(MemoryTracker* tracker) const { + tracker->TrackField("ocsp_response", ocsp_response_); + tracker->TrackField("sni_context", sni_context_); +} + int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx) { // From https://www.openssl.org/docs/man1.1.1/man3/SSL_verify_cb: // diff --git a/src/node_crypto.h b/src/node_crypto.h index 56a9ad3104dbeb..d2bdd40ed283ed 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -222,6 +222,8 @@ class SSLWrap { inline bool is_awaiting_new_session() const { return awaiting_new_session_; } inline bool is_waiting_cert_cb() const { return cert_cb_ != nullptr; } + void MemoryInfo(MemoryTracker* tracker) const; + protected: typedef void (*CertCb)(void* arg); diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 4ec6dda6df70d7..626662c9a5ef8e 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -1089,6 +1089,7 @@ void TLSWrap::GetWriteQueueSize(const FunctionCallbackInfo& info) { void TLSWrap::MemoryInfo(MemoryTracker* tracker) const { + SSLWrap::MemoryInfo(tracker); tracker->TrackField("error", error_); tracker->TrackFieldWithSize("pending_cleartext_input", pending_cleartext_input_.size(),