Skip to content

Commit d488340

Browse files
committed
fixup! tls: add allowPartialTrustChain flag
1 parent bb69f14 commit d488340

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/crypto/crypto_context.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ Local<FunctionTemplate> SecureContext::GetConstructorTemplate(
314314
SetProtoMethod(isolate, tmpl, "setKey", SetKey);
315315
SetProtoMethod(isolate, tmpl, "setCert", SetCert);
316316
SetProtoMethod(isolate, tmpl, "addCACert", AddCACert);
317-
SetProtoMethod(isolate, tmpl, "setAllowPartialTrustChain", SetAllowPartialTrustChain);
317+
SetProtoMethod(
318+
isolate, tmpl, "setAllowPartialTrustChain", SetAllowPartialTrustChain);
318319
SetProtoMethod(isolate, tmpl, "addCRL", AddCRL);
319320
SetProtoMethod(isolate, tmpl, "addRootCerts", AddRootCerts);
320321
SetProtoMethod(isolate, tmpl, "setCipherSuites", SetCipherSuites);
@@ -771,7 +772,8 @@ X509_STORE* SecureContext::GetCertStoreOwnedByThisSecureContext() {
771772
return owned_cert_store_cached_ = cert_store;
772773
}
773774

774-
void SecureContext::SetAllowPartialTrustChain(const FunctionCallbackInfo<Value>& args) {
775+
void SecureContext::SetAllowPartialTrustChain(
776+
const FunctionCallbackInfo<Value>& args) {
775777
SecureContext* sc;
776778
ASSIGN_OR_RETURN_UNWRAP(&sc, args.This());
777779
sc->SetX509StoreFlag(X509_V_FLAG_PARTIAL_CHAIN);
@@ -782,7 +784,9 @@ void SecureContext::SetCACert(const BIOPointer& bio) {
782784
if (!bio) return;
783785
while (X509Pointer x509 = X509Pointer(PEM_read_bio_X509_AUX(
784786
bio.get(), nullptr, NoPasswordCallback, nullptr))) {
785-
CHECK_EQ(1, X509_STORE_add_cert(GetCertStoreOwnedByThisSecureContext(), x509.get()));
787+
CHECK_EQ(1,
788+
X509_STORE_add_cert(GetCertStoreOwnedByThisSecureContext(),
789+
x509.get()));
786790
CHECK_EQ(1, SSL_CTX_add_client_CA(ctx_.get(), x509.get()));
787791
}
788792
}

src/crypto/crypto_context.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class SecureContext final : public BaseObject {
9393
#endif // !OPENSSL_NO_ENGINE
9494
static void SetCert(const v8::FunctionCallbackInfo<v8::Value>& args);
9595
static void AddCACert(const v8::FunctionCallbackInfo<v8::Value>& args);
96-
static void SetAllowPartialTrustChain(const v8::FunctionCallbackInfo<v8::Value>& args);
96+
static void SetAllowPartialTrustChain(
97+
const v8::FunctionCallbackInfo<v8::Value>& args);
9798
static void AddCRL(const v8::FunctionCallbackInfo<v8::Value>& args);
9899
static void AddRootCerts(const v8::FunctionCallbackInfo<v8::Value>& args);
99100
static void SetCipherSuites(const v8::FunctionCallbackInfo<v8::Value>& args);

0 commit comments

Comments
 (0)