Skip to content

Commit

Permalink
tls: pass in isolate with define string constant + style nits
Browse files Browse the repository at this point in the history
Per the commit feedback, fix up style nits and pass in the
isolate with the NODE_DEFINE_STRING_CONSTANT macro.

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#14383
  • Loading branch information
jasnell committed Apr 8, 2015
1 parent 3f58ce6 commit 3705736
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/node.h
Expand Up @@ -223,9 +223,8 @@ NODE_EXTERN void RunAtExit(Environment* env);
} \
while (0)

#define NODE_DEFINE_STRING_CONSTANT(target, constant) \
#define NODE_DEFINE_STRING_CONSTANT(isolate, target, constant) \
do { \
v8::Isolate* isolate = v8::Isolate::GetCurrent(); \
v8::Local<v8::String> constant_name = \
v8::String::NewFromUtf8(isolate, #constant); \
v8::Local<v8::String> constant_value = \
Expand Down
3 changes: 2 additions & 1 deletion src/node_crypto.cc
Expand Up @@ -5192,7 +5192,8 @@ void InitCrypto(Handle<Object> target,

NODE_DEFINE_CONSTANT(target, SSL3_ENABLE);
NODE_DEFINE_CONSTANT(target, SSL2_ENABLE);
NODE_DEFINE_STRING_CONSTANT(target, DEFAULT_CIPHER_LIST);

NODE_DEFINE_STRING_CONSTANT(env->isolate(), target, DEFAULT_CIPHER_LIST);
NODE_SET_METHOD(target, "getLegacyCiphers", DefaultCiphers);
}

Expand Down
14 changes: 7 additions & 7 deletions src/node_crypto.h
Expand Up @@ -74,13 +74,13 @@
"DHE-RSA-AES128-SHA256:AES128-GCM-SHA256:HIGH:"\
"!RC4:!MD5:!aNULL"

#define DEFAULT_CIPHER_LIST_HEAD "ECDHE-RSA-AES256-SHA384:" \
"DHE-RSA-AES256-SHA384:" \
"ECDHE-RSA-AES256-SHA256:" \
"DHE-RSA-AES256-SHA256:" \
"ECDHE-RSA-AES128-SHA256:" \
"DHE-RSA-AES128-SHA256:" \
"HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:" \
#define DEFAULT_CIPHER_LIST_HEAD "ECDHE-RSA-AES256-SHA384:" \
"DHE-RSA-AES256-SHA384:" \
"ECDHE-RSA-AES256-SHA256:" \
"DHE-RSA-AES256-SHA256:" \
"ECDHE-RSA-AES128-SHA256:" \
"DHE-RSA-AES128-SHA256:" \
"HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:" \
"!PSK:!SRP:!CAMELLIA"

static inline const char * legacy_cipher_list(const char * ver) {
Expand Down

0 comments on commit 3705736

Please sign in to comment.