Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix style issues with ext_key_usage patch

Closes GH-586.
  • Loading branch information...
commit 1a5e5130843b5eca79fce60a6c032f3d7ac61017 1 parent 4ea6916
@ghughes ghughes authored ry committed
Showing with 9 additions and 8 deletions.
  1. +5 −4 src/node_crypto.cc
  2. +4 −4 test/simple/test-tls-ext-key-usage.js
View
9 src/node_crypto.cc
@@ -696,17 +696,18 @@ Handle<Value> Connection::GetPeerCertificate(const Arguments& args) {
info->Set(fingerprint_symbol, String::New(fingerprint));
}
-
- STACK_OF(ASN1_OBJECT) *eku = (STACK_OF(ASN1_OBJECT) *)X509_get_ext_d2i(peer_cert, NID_ext_key_usage, NULL, NULL);
+
+ STACK_OF(ASN1_OBJECT) *eku = (STACK_OF(ASN1_OBJECT) *)X509_get_ext_d2i(
+ peer_cert, NID_ext_key_usage, NULL, NULL);
if (eku != NULL) {
Local<Array> ext_key_usage = Array::New();
-
+
for (int i = 0; i < sk_ASN1_OBJECT_num(eku); i++) {
memset(buf, 0, sizeof(buf));
OBJ_obj2txt(buf, sizeof(buf) - 1, sk_ASN1_OBJECT_value(eku, i), 1);
ext_key_usage->Set(Integer::New(i), String::New(buf));
}
-
+
sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free);
info->Set(ext_key_usage_symbol, ext_key_usage);
}
View
8 test/simple/test-tls-ext-key-usage.js
@@ -110,11 +110,11 @@ function startClient() {
console.log('client: connected+secure!');
console.log('client pair.cleartext.getPeerCertificate(): %j',
pair.cleartext.getPeerCertificate());
-
+
// "TLS Web Client Authentication"
- assert.equal(pair.cleartext.getPeerCertificate().ext_key_usage.length, 1)
- assert.equal(pair.cleartext.getPeerCertificate().ext_key_usage[0], '1.3.6.1.5.5.7.3.2')
-
+ assert.equal(pair.cleartext.getPeerCertificate().ext_key_usage.length, 1);
+ assert.equal(pair.cleartext.getPeerCertificate().ext_key_usage[0], '1.3.6.1.5.5.7.3.2');
+
console.log('client pair.cleartext.getCipher(): %j',
pair.cleartext.getCipher());
setTimeout(function() {
Please sign in to comment.
Something went wrong with that request. Please try again.