| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b42013c commit 8da4983
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -572,19 +572,12 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) { | |||
| 572 | 572 | ||
| 573 | 573 | ||
| 574 | 574 | int SSL_CTX_get_issuer(SSL_CTX* ctx, X509* cert, X509** issuer) { | |
| 575 | - int ret; | ||
| 576 | - | ||
| 577 | 575 | 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); | ||
| 588 | 581 | return ret; | |
| 589 | 582 | } | |
| 590 | 583 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments