diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-11-28 23:20:59 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-11-28 23:20:59 -0800 |
commit | bf89872306bc0157c1a1751f7ba5c4123fa2e7b0 (patch) | |
tree | bc4f40b807ce143b88d9aa12f5afeb422b1c7355 /src | |
parent | be2457aaca6a5bae912a76a892952b4bd8f7b1e5 (diff) | |
download | node-new-bf89872306bc0157c1a1751f7ba5c4123fa2e7b0.tar.gz |
style
Diffstat (limited to 'src')
-rw-r--r-- | src/node_crypto.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 90219281b8..26c091fcba 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); |