Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
tls: pass in isolate with define string constant + style nits
Per the commit feedback, fix up style nits and pass in the
isolate with the NODE_DEFINE_STRING_CONSTANT macro.
  • Loading branch information
jasnell committed Apr 6, 2015
commit 09160f572153327ee5cf9372e42312e3a11ac484
3 changes: 1 addition & 2 deletions src/node.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alignment issues on the ending /. Check that all the DEFAULT_CIPHER_LIST_* are aligned at the end the same.


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