Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: Update to 8.14.1 #7660

Merged
merged 2 commits into from
Dec 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lang/node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=node
PKG_VERSION:=v8.12.0
PKG_VERSION:=v8.14.1
PKG_RELEASE:=1
PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://nodejs.org/dist/${PKG_VERSION}
PKG_HASH:=5a9dff58016c18fb4bf902d963b124ff058a550ebcd9840c677757387bce419a
PKG_HASH:=b1df87803ddffb76fc6739f025f69f6b8288514fcd2f278f0d675ac3d52a6b9b

HOST_BUILD_DEPENDS:=python/host
PKG_BUILD_DEPENDS:=python/host
Expand All @@ -37,7 +37,7 @@ define Package/node
SUBMENU:=Node.js
TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
URL:=https://nodejs.org/
DEPENDS:=@(HAS_FPU||KERNEL_MIPS_FPU_EMULATOR) +libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt +NODEJS_ICU:icu
DEPENDS:=@(HAS_FPU||KERNEL_MIPS_FPU_EMULATOR) +libstdcpp +libopenssl +zlib +libnghttp2 +libuv +libhttp-parser +USE_UCLIBC:libpthread +USE_UCLIBC:librt +NODEJS_ICU:icu
endef

define Package/node/description
Expand Down Expand Up @@ -86,6 +86,9 @@ CONFIGURE_ARGS:= \
--without-snapshot \
--shared-zlib \
--shared-openssl \
--shared-nghttp2 \
--shared-libuv \
--shared-http-parser \
--with-intl=$(if $(CONFIG_NODEJS_ICU),system-icu,none) \
$(if $(findstring mips,$(NODEJS_CPU)), \
$(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft)) \
Expand Down
96 changes: 96 additions & 0 deletions lang/node/patches/004-openssl-deprecated.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index c3779c0..611fb43 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -43,6 +43,11 @@
#include <string.h>
#include <vector>

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#define X509_get0_notBefore X509_get_notBefore
+#define X509_get0_notAfter X509_get_notAfter
+#endif
+
#define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \
do { \
if (!Buffer::HasInstance(val) && !val->IsString()) { \
@@ -536,6 +541,7 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
method = SSLv23_server_method();
} else if (strcmp(*sslmethod, "SSLv23_client_method") == 0) {
method = SSLv23_client_method();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
} else if (strcmp(*sslmethod, "TLSv1_method") == 0) {
method = TLSv1_method();
} else if (strcmp(*sslmethod, "TLSv1_server_method") == 0) {
@@ -554,6 +560,14 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
method = TLSv1_2_server_method();
} else if (strcmp(*sslmethod, "TLSv1_2_client_method") == 0) {
method = TLSv1_2_client_method();
+#else
+ } else if (strcmp(*sslmethod, "TLS_method") == 0) {
+ method = TLS_method();
+ } else if (strcmp(*sslmethod, "TLS_server_method") == 0) {
+ method = TLS_server_method();
+ } else if (strcmp(*sslmethod, "TLS_client_method") == 0) {
+ method = TLS_client_method();
+#endif
} else {
return env->ThrowError("Unknown method");
}
@@ -1799,7 +1813,7 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
rsa = nullptr;
}

- ASN1_TIME_print(bio, X509_get_notBefore(cert));
+ ASN1_TIME_print(bio, X509_get0_notBefore(cert));
BIO_get_mem_ptr(bio, &mem);
info->Set(context, env->valid_from_string(),
String::NewFromUtf8(env->isolate(), mem->data,
@@ -1807,7 +1821,7 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
mem->length)).FromJust();
(void) BIO_reset(bio);

- ASN1_TIME_print(bio, X509_get_notAfter(cert));
+ ASN1_TIME_print(bio, X509_get0_notAfter(cert));
BIO_get_mem_ptr(bio, &mem);
info->Set(context, env->valid_to_string(),
String::NewFromUtf8(env->isolate(), mem->data,
@@ -6194,8 +6208,12 @@ void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) {
}

void InitCryptoOnce() {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_load_error_strings();
OPENSSL_no_config();
+#else
+ OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL);
+#endif

// --openssl-config=...
if (!openssl_config.empty()) {
@@ -6217,10 +6235,10 @@ void InitCryptoOnce() {
}
}

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init();
OpenSSL_add_all_algorithms();

-#if OPENSSL_VERSION_NUMBER < 0x10100000L
crypto_lock_init();
CRYPTO_set_locking_callback(crypto_lock_cb);
CRYPTO_THREADID_set_callback(crypto_threadid_cb);
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 58f5b72..875a787 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -37,6 +37,9 @@
#include "v8.h"

#include <openssl/ssl.h>
+#include <openssl/bn.h>
+#include <openssl/rsa.h>
+#include <openssl/dh.h>
#include <openssl/ec.h>
#include <openssl/ecdh.h>
#ifndef OPENSSL_NO_ENGINE