Skip to content

Commit a5a09ac

Browse files
nehebtargos
authored andcommitted
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: #30812 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 39d770c commit a5a09ac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/node_crypto.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2118,15 +2118,15 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
21182118
rsa.reset();
21192119
ec.reset();
21202120

2121-
ASN1_TIME_print(bio.get(), X509_get_notBefore(cert));
2121+
ASN1_TIME_print(bio.get(), X509_get0_notBefore(cert));
21222122
BIO_get_mem_ptr(bio.get(), &mem);
21232123
info->Set(context, env->valid_from_string(),
21242124
String::NewFromUtf8(env->isolate(), mem->data,
21252125
NewStringType::kNormal,
21262126
mem->length).ToLocalChecked()).Check();
21272127
USE(BIO_reset(bio.get()));
21282128

2129-
ASN1_TIME_print(bio.get(), X509_get_notAfter(cert));
2129+
ASN1_TIME_print(bio.get(), X509_get0_notAfter(cert));
21302130
BIO_get_mem_ptr(bio.get(), &mem);
21312131
info->Set(context, env->valid_to_string(),
21322132
String::NewFromUtf8(env->isolate(), mem->data,

src/node_crypto.h

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535

3636
#include <openssl/err.h>
3737
#include <openssl/ssl.h>
38+
#include <openssl/bn.h>
39+
#include <openssl/dh.h>
40+
#include <openssl/ec.h>
41+
#include <openssl/rsa.h>
3842

3943
namespace node {
4044
namespace crypto {

0 commit comments

Comments
 (0)