summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2019-12-05 11:58:43 -0800
committerAnna Henningsen <anna@addaleax.net>2019-12-07 22:47:43 +0100
commit4e119202512c16abdc9e97b87bae73cc6353b575 (patch)
treed36dc2c93e050a58a7dadf3bc4d2050531d4ac96
parentd4e00ec0aefd8d83ca48e75082c0f3ec2b260ba9 (diff)
downloadandroid-node-v8-4e119202512c16abdc9e97b87bae73cc6353b575.tar.gz
android-node-v8-4e119202512c16abdc9e97b87bae73cc6353b575.tar.bz2
android-node-v8-4e119202512c16abdc9e97b87bae73cc6353b575.zip
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. PR-URL: https://github.com/nodejs/node/pull/30812 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
-rw-r--r--src/node_crypto.cc4
-rw-r--r--src/node_crypto.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 3f771793e2..c53c5c4ccc 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2118,7 +2118,7 @@ static Local<Object> 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<Object> 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 3f14e155da..b57dc29de2 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -35,6 +35,10 @@
#include <openssl/err.h>
#include <openssl/ssl.h>
+#include <openssl/bn.h>
+#include <openssl/dh.h>
+#include <openssl/ec.h>
+#include <openssl/rsa.h>
namespace node {
namespace crypto {