|
|
@ -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); |
|
|
|
} |
|
|
|