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 — Clear certificate chain in setKeyMaterial (#985). · netty/netty-tcnative@0ce2e0a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • openssl-dynamic/src/main/c
    • ssl.c
    • ssl_private.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎openssl-dynamic/src/main/c/ssl.c‎

Copy file name to clipboardExpand all lines: openssl-dynamic/src/main/c/ssl.c
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,19 @@ TCN_IMPLEMENT_CALL(void, SSL, setKeyMaterial)(TCN_STDARGS, jlong ssl, jlong chai
23162316
}
23172317
}
23182318

2319+
// Clear the chain; the loop below appends certificates to the
2320+
// chain, and in TLS 1.3, this can be called again after the
2321+
// server sends a HelloRetryRequest. Without clearing the
2322+
// certificate chain that results in duplicate entries.
2323+
if (tcn_SSL_clear_chain_certs(ssl_) != 1) {
2324+
ERR_error_string(ERR_get_error(), err, ERR_LEN);
2325+
ERR_clear_error();
2326+
2327+
tcn_Throw(e, "Could not clear certificate chain (%s)", err);
2328+
return;
2329+
}
2330+
2331+
23192332
// The first cert was loaded via SSL_use_certificate so skip it.
23202333
for (i = 1; i < numCerts; ++i) {
23212334

Collapse file

‎openssl-dynamic/src/main/c/ssl_private.h‎

Copy file name to clipboardExpand all lines: openssl-dynamic/src/main/c/ssl_private.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ enum ssl_verify_result_t tcn_SSL_cert_custom_verify(SSL* ssl, uint8_t *out_alert
473473
#if !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC)
474474
#define tcn_SSL_add1_chain_cert(ssl, x509) SSL_add1_chain_cert(ssl, x509)
475475
#define tcn_SSL_add0_chain_cert(ssl, x509) SSL_add0_chain_cert(ssl, x509)
476+
#define tcn_SSL_clear_chain_certs(ssl) SSL_clear_chain_certs(ssl)
476477
#endif // !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC)
477478

478479
#define tcn_SSL_get0_certificate_types(ssl, clist) SSL_get0_certificate_types(ssl, clist)

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.