Skip to content

Commit

Permalink
src: don't use deprecated OpenSSL APIs
Browse files Browse the repository at this point in the history
The extra headers are needed when deprecated APIs are disabled as ssl.h
no longer includes them implicitly.

PR-URL: #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>
  • Loading branch information
neheb authored and addaleax committed Dec 7, 2019
1 parent d4e00ec commit 4e11920
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_crypto.cc
Expand Up @@ -2118,15 +2118,15 @@ 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,
NewStringType::kNormal,
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,
Expand Down
4 changes: 4 additions & 0 deletions src/node_crypto.h
Expand Up @@ -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 {
Expand Down

0 comments on commit 4e11920

Please sign in to comment.