GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: use X509_STORE_CTX_new · nodejs/node@8da4983

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_crypto.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+5-12Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -572,19 +572,12 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
572572

573573

574574
int SSL_CTX_get_issuer(SSL_CTX* ctx, X509* cert, X509** issuer) {
575-
int ret;
576-
577575
X509_STORE* store = SSL_CTX_get_cert_store(ctx);
578-
X509_STORE_CTX store_ctx;
579-
580-
ret = X509_STORE_CTX_init(&store_ctx, store, nullptr, nullptr);
581-
if (!ret)
582-
goto end;
583-
584-
ret = X509_STORE_CTX_get1_issuer(issuer, &store_ctx, cert);
585-
X509_STORE_CTX_cleanup(&store_ctx);
586-
587-
end:
576+
X509_STORE_CTX* store_ctx = X509_STORE_CTX_new();
577+
int ret = store_ctx != nullptr &&
578+
X509_STORE_CTX_init(store_ctx, store, nullptr, nullptr) == 1 &&
579+
X509_STORE_CTX_get1_issuer(issuer, store_ctx, cert) == 1;
580+
X509_STORE_CTX_free(store_ctx);
588581
return ret;
589582
}
590583

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.