From 0a8f0e384ce855595e2db9944758ec4a01172e9d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 5 Dec 2019 11:58:43 -0800 Subject: [PATCH] src: don't use deprecated OpenSSL APIs The extra headers are needed when deprecated APIs are disabled as ssl.h no longer includes them implicitly. --- src/node_crypto.cc | 4 ++-- src/node_crypto.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 3f771793e2c874..c53c5c4ccc4da8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2118,7 +2118,7 @@ static Local X509ToObject(Environment* env, X509* cert) { rsa.reset(); ec.reset(); - ASN1_TIME_print(bio.get(), X509_get_notBefore(cert)); + ASN1_TIME_print(bio.get(), X509_get0_notBefore(cert)); BIO_get_mem_ptr(bio.get(), &mem); info->Set(context, env->valid_from_string(), String::NewFromUtf8(env->isolate(), mem->data, @@ -2126,7 +2126,7 @@ static Local X509ToObject(Environment* env, X509* cert) { mem->length).ToLocalChecked()).Check(); USE(BIO_reset(bio.get())); - ASN1_TIME_print(bio.get(), X509_get_notAfter(cert)); + ASN1_TIME_print(bio.get(), X509_get0_notAfter(cert)); BIO_get_mem_ptr(bio.get(), &mem); info->Set(context, env->valid_to_string(), String::NewFromUtf8(env->isolate(), mem->data, diff --git a/src/node_crypto.h b/src/node_crypto.h index 3f14e155dafc49..b57dc29de29785 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -35,6 +35,10 @@ #include #include +#include +#include +#include +#include namespace node { namespace crypto {