Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-11-29 10:20:59 +0300
committerRyan Dahl <ry@tinyclouds.org>2010-11-29 10:20:59 +0300
commitbf89872306bc0157c1a1751f7ba5c4123fa2e7b0 (patch)
treebc4f40b807ce143b88d9aa12f5afeb422b1c7355 /src
parentbe2457aaca6a5bae912a76a892952b4bd8f7b1e5 (diff)
style
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 90219281b8c..26c091fcba9 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -69,36 +69,36 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
OPENSSL_CONST SSL_METHOD *method = SSLv23_method();
- if (args.Length() == 1) {
- if (!args[0]->IsString())
- return ThrowException(Exception::TypeError(
- String::New("Bad parameter")));
-
+ if (args.Length() == 1 && args[0]->IsString()) {
String::Utf8Value sslmethod(args[0]->ToString());
- if (strcmp(*sslmethod, "SSLv2_method") == 0)
+
+ if (strcmp(*sslmethod, "SSLv2_method") == 0) {
method = SSLv2_method();
- if (strcmp(*sslmethod, "SSLv2_server_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv2_server_method") == 0) {
method = SSLv2_server_method();
- if (strcmp(*sslmethod, "SSLv2_client_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv2_client_method") == 0) {
method = SSLv2_client_method();
- if (strcmp(*sslmethod, "SSLv3_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv3_method") == 0) {
method = SSLv3_method();
- if (strcmp(*sslmethod, "SSLv3_server_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) {
method = SSLv3_server_method();
- if (strcmp(*sslmethod, "SSLv3_client_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) {
method = SSLv3_client_method();
- if (strcmp(*sslmethod, "SSLv23_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv23_method") == 0) {
method = SSLv23_method();
- if (strcmp(*sslmethod, "SSLv23_server_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) {
method = SSLv23_server_method();
- if (strcmp(*sslmethod, "SSLv23_client_method") == 0)
+ } else if (strcmp(*sslmethod, "SSLv23_client_method") == 0) {
method = SSLv23_client_method();
- if (strcmp(*sslmethod, "TLSv1_method") == 0)
+ } else if (strcmp(*sslmethod, "TLSv1_method") == 0) {
method = TLSv1_method();
- if (strcmp(*sslmethod, "TLSv1_server_method") == 0)
+ } else if (strcmp(*sslmethod, "TLSv1_server_method") == 0) {
method = TLSv1_server_method();
- if (strcmp(*sslmethod, "TLSv1_client_method") == 0)
+ } else if (strcmp(*sslmethod, "TLSv1_client_method") == 0) {
method = TLSv1_client_method();
+ } else {
+ return ThrowException(Exception::Error(String::New("Unknown method")));
+ }
}
sc->ctx_ = SSL_CTX_new(method);