mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-01-14 12:12:08 +01:00
135 lines
3.6 KiB
Diff
135 lines
3.6 KiB
Diff
--- src/node_constants.cc.orig 2015-07-10 06:41:19.000000000 +0800
|
|
+++ src/node_constants.cc 2015-08-02 16:28:48.000000000 +0800
|
|
@@ -33,11 +33,17 @@
|
|
#include <sys/stat.h>
|
|
|
|
#if HAVE_OPENSSL
|
|
-# include <openssl/ec.h>
|
|
-# include <openssl/ssl.h>
|
|
-# ifndef OPENSSL_NO_ENGINE
|
|
-# include <openssl/engine.h>
|
|
-# endif // !OPENSSL_NO_ENGINE
|
|
+
|
|
+#include <openssl/ssl.h>
|
|
+
|
|
+#ifndef OPENSSL_NO_EC
|
|
+#include <openssl/ec.h>
|
|
+#endif
|
|
+
|
|
+#ifndef OPENSSL_NO_ENGINE
|
|
+#include <openssl/engine.h>
|
|
+#endif // !OPENSSL_NO_ENGINE
|
|
+
|
|
#endif
|
|
|
|
namespace node {
|
|
@@ -976,7 +982,7 @@
|
|
NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PSS_PADDING);
|
|
#endif
|
|
|
|
-#if HAVE_OPENSSL
|
|
+#ifndef OPENSSL_NO_EC
|
|
// NOTE: These are not defines
|
|
NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_COMPRESSED);
|
|
|
|
--- src/node_crypto.cc.orig 2015-07-10 06:41:19.000000000 +0800
|
|
+++ src/node_crypto.cc 2015-08-02 16:30:39.000000000 +0800
|
|
@@ -275,7 +275,9 @@
|
|
NODE_SET_PROTOTYPE_METHOD(t, "addCRL", SecureContext::AddCRL);
|
|
NODE_SET_PROTOTYPE_METHOD(t, "addRootCerts", SecureContext::AddRootCerts);
|
|
NODE_SET_PROTOTYPE_METHOD(t, "setCiphers", SecureContext::SetCiphers);
|
|
+#ifndef OPENSSL_NO_EC
|
|
NODE_SET_PROTOTYPE_METHOD(t, "setECDHCurve", SecureContext::SetECDHCurve);
|
|
+#endif
|
|
NODE_SET_PROTOTYPE_METHOD(t, "setDHParam", SecureContext::SetDHParam);
|
|
NODE_SET_PROTOTYPE_METHOD(t, "setOptions", SecureContext::SetOptions);
|
|
NODE_SET_PROTOTYPE_METHOD(t, "setSessionIdContext",
|
|
@@ -741,7 +743,7 @@
|
|
SSL_CTX_set_cipher_list(sc->ctx_, *ciphers);
|
|
}
|
|
|
|
-
|
|
+#ifndef OPENSSL_NO_EC
|
|
void SecureContext::SetECDHCurve(const FunctionCallbackInfo<Value>& args) {
|
|
HandleScope scope(args.GetIsolate());
|
|
|
|
@@ -768,7 +770,7 @@
|
|
|
|
EC_KEY_free(ecdh);
|
|
}
|
|
-
|
|
+#endif
|
|
|
|
void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
|
|
HandleScope scope(args.GetIsolate());
|
|
@@ -4152,7 +4154,7 @@
|
|
return true;
|
|
}
|
|
|
|
-
|
|
+#ifndef OPENSSL_NO_EC
|
|
void ECDH::Initialize(Environment* env, Handle<Object> target) {
|
|
HandleScope scope(env->isolate());
|
|
|
|
@@ -4369,6 +4371,7 @@
|
|
if (!r)
|
|
return env->ThrowError("Failed to convert BN to a private key");
|
|
}
|
|
+#endif // OPENSSL_NO_EC
|
|
|
|
|
|
class PBKDF2Request : public AsyncWrap {
|
|
@@ -5142,7 +5145,9 @@
|
|
Connection::Initialize(env, target);
|
|
CipherBase::Initialize(env, target);
|
|
DiffieHellman::Initialize(env, target);
|
|
+#ifndef OPENSSL_NO_EC
|
|
ECDH::Initialize(env, target);
|
|
+#endif
|
|
Hmac::Initialize(env, target);
|
|
Hash::Initialize(env, target);
|
|
Sign::Initialize(env, target);
|
|
--- src/node_crypto.h.orig 2015-07-10 06:41:19.000000000 +0800
|
|
+++ src/node_crypto.h 2015-08-02 16:14:31.000000000 +0800
|
|
@@ -39,8 +39,15 @@
|
|
#include "v8.h"
|
|
|
|
#include <openssl/ssl.h>
|
|
+
|
|
+#ifndef OPENSSL_NO_EC
|
|
#include <openssl/ec.h>
|
|
+#endif
|
|
+
|
|
+#ifndef OPENSSL_NO_ECDH
|
|
#include <openssl/ecdh.h>
|
|
+#endif
|
|
+
|
|
#ifndef OPENSSL_NO_ENGINE
|
|
# include <openssl/engine.h>
|
|
#endif // !OPENSSL_NO_ENGINE
|
|
@@ -98,7 +105,9 @@
|
|
static void AddCRL(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
static void AddRootCerts(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
static void SetCiphers(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
+#ifndef OPENSSL_NO_EC
|
|
static void SetECDHCurve(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
+#endif
|
|
static void SetDHParam(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
static void SetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
static void SetSessionIdContext(
|
|
@@ -646,6 +655,7 @@
|
|
DH* dh;
|
|
};
|
|
|
|
+#ifndef OPENSSL_NO_EC
|
|
class ECDH : public BaseObject {
|
|
public:
|
|
~ECDH() {
|
|
@@ -681,6 +691,7 @@
|
|
EC_KEY* key_;
|
|
const EC_GROUP* group_;
|
|
};
|
|
+#endif
|
|
|
|
class Certificate : public AsyncWrap {
|
|
public:
|