MCPcopy Create free account
hub / github.com/apache/httpd / ssl_callback_Info

Function ssl_callback_Info

modules/ssl/ssl_engine_kernel.c:2097–2143  ·  view source on GitHub ↗

* This callback function is executed while OpenSSL processes the SSL * handshake and does SSL record layer stuff. It's used to trap * client-initiated renegotiations (where SSL_OP_NO_RENEGOTIATION is * not available), and for dumping everything to the log. */

Source from the content-addressed store, hash-verified

2095 * not available), and for dumping everything to the log.
2096 */
2097void ssl_callback_Info(const SSL *ssl, int where, int rc)
2098{
2099 conn_rec *c;
2100 server_rec *s;
2101
2102 /* Retrieve the conn_rec and the associated SSLConnRec. */
2103 if ((c = (conn_rec *)SSL_get_app_data((SSL *)ssl)) == NULL) {
2104 return;
2105 }
2106
2107#ifndef SSL_OP_NO_RENEGOTIATION
2108 /* With OpenSSL < 1.1.1 (implying TLS v1.2 or earlier), this
2109 * callback is used to block client-initiated renegotiation. With
2110 * TLSv1.3 it is unnecessary since renegotiation is forbidden at
2111 * protocol level. Otherwise (TLSv1.2 with OpenSSL >=1.1.1),
2112 * SSL_OP_NO_RENEGOTIATION is used to block renegotiation. */
2113 {
2114 SSLConnRec *sslconn;
2115
2116 if ((sslconn = myConnConfig(c)) == NULL) {
2117 return;
2118 }
2119
2120 /* If the reneg state is to reject renegotiations, check the SSL
2121 * state machine and move to ABORT if a Client Hello is being
2122 * read. */
2123 if (!c->outgoing &&
2124 (where & SSL_CB_HANDSHAKE_START) &&
2125 sslconn->reneg_state == RENEG_REJECT) {
2126 sslconn->reneg_state = RENEG_ABORT;
2127 ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02042)
2128 "rejecting client initiated renegotiation");
2129 }
2130 /* If the first handshake is complete, change state to reject any
2131 * subsequent client-initiated renegotiation. */
2132 else if ((where & SSL_CB_HANDSHAKE_DONE)
2133 && sslconn->reneg_state == RENEG_INIT) {
2134 sslconn->reneg_state = RENEG_REJECT;
2135 }
2136 }
2137#endif
2138
2139 s = mySrvFromConn(c);
2140 if (s && APLOGdebug(s)) {
2141 log_tracing_state(ssl, c, s, where, rc);
2142 }
2143}
2144
2145#ifdef HAVE_TLSEXT
2146

Callers

nothing calls this directly

Calls 1

log_tracing_stateFunction · 0.85

Tested by

no test coverage detected