https://bz.apache.org/bugzilla/show_bug.cgi?id=69773

            Bug ID: 69773
           Summary: mod_ssl: typo in ssl_hook_process_connection() skips
                    handshake-error handling
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: All
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_ssl
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

### Overview
In `modules/ssl/mod_ssl.c` the return value of `ap_get_brigade()` is never
checked because of a likely typo:

```c
rv = ap_get_brigade(c->input_filters, temp,
                    AP_MODE_INIT, APR_BLOCK_READ, 0);
/* line 712 */
if (APR_SUCCESS != APR_SUCCESS) {   /* <-- always false */
    ...intended error path...
}
```

As a result the code that logs "SSL handshake was not completed" and moves the
connection state to `CONN_STATE_LINGER` is never reached after an unsuccessful
TLS handshake.

### Proposed patch
```diff
--- a/modules/ssl/mod_ssl.c
+++ b/modules/ssl/mod_ssl.c
@@
-        if (APR_SUCCESS != APR_SUCCESS) {
+        if (rv != APR_SUCCESS) {
             if (c->cs) {
                 c->cs->state = CONN_STATE_LINGER;
             }
```

### Notes
- No real security impact (one-time handshake failure already aborts the
  connection).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to