-
Notifications
You must be signed in to change notification settings - Fork 857
Cleaning up TLS server verify options #4414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,10 +35,9 @@ Reenable the SSL connection :arg:`svc`. If a plugin hook is called, ATS | |
| processing on that connnection will not resume until this is invoked for that | ||
| connection. | ||
|
|
||
| If the server is running OpenSSL 1.0.1 with the appropraite patch installed or | ||
| it is running OpenSSL 1.0.2, the plugin writer can pause SSL handshake | ||
| processing by not reenabling the connection. Without the OpenSSL patch or | ||
| running an OpenSSL versions older than 1.0.2, the handshake processing in | ||
| If the server is running OpenSSL 1.0.2, the plugin writer can pause SSL handshake | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "The server"? Traffic Server, or the upstream? |
||
| processing at the certificate callback by not reenabling the connection. | ||
| Running an OpenSSL versions older than 1.0.2, the handshake processing in | ||
| ``SSL_accept`` will not be stopped even if the SNI callback does not reenable | ||
| the connection. | ||
|
|
||
|
|
@@ -49,3 +48,4 @@ Traffic Server. | |
|
|
||
| This call does appropriate locking and scheduling, so it is safe to call from | ||
| another thread. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,8 @@ typedef enum { | |
| SSL_HOOK_OP_LAST = SSL_HOOK_OP_TERMINATE ///< End marker value. | ||
| } SslVConnOp; | ||
|
|
||
| enum SSLHandshakeStatus { SSL_HANDSHAKE_ONGOING, SSL_HANDSHAKE_DONE, SSL_HANDSHAKE_ERROR }; | ||
|
|
||
| ////////////////////////////////////////////////////////////////// | ||
| // | ||
| // class NetVConnection | ||
|
|
@@ -113,13 +115,13 @@ class SSLNetVConnection : public UnixNetVConnection | |
| bool | ||
| getSSLHandShakeComplete() const override | ||
| { | ||
| return sslHandShakeComplete; | ||
| return sslHandshakeStatus != SSL_HANDSHAKE_ONGOING; | ||
| } | ||
|
|
||
| virtual void | ||
| setSSLHandShakeComplete(bool state) | ||
| setSSLHandShakeComplete(enum SSLHandshakeStatus state) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're going to change this, might as well rename it to |
||
| { | ||
| sslHandShakeComplete = state; | ||
| sslHandshakeStatus = state; | ||
| } | ||
|
|
||
| void | ||
|
|
@@ -192,7 +194,7 @@ class SSLNetVConnection : public UnixNetVConnection | |
| using super::reenable; | ||
|
|
||
| /// Reenable the VC after a pre-accept or SNI hook is called. | ||
| virtual void reenable(NetHandler *nh); | ||
| virtual void reenable(NetHandler *nh, int event = TS_EVENT_CONTINUE); | ||
|
|
||
| /// Set the SSL context. | ||
| /// @note This must be called after the SSL endpoint has been created. | ||
|
|
@@ -280,6 +282,10 @@ class SSLNetVConnection : public UnixNetVConnection | |
| } | ||
| break; | ||
|
|
||
| case HANDSHAKE_HOOKS_VERIFY_SERVER: | ||
| retval = (eventId == TS_EVENT_SSL_VERIFY_SERVER); | ||
| break; | ||
|
|
||
| case HANDSHAKE_HOOKS_DONE: | ||
| retval = true; | ||
| break; | ||
|
|
@@ -340,13 +346,13 @@ class SSLNetVConnection : public UnixNetVConnection | |
| std::string_view map_tls_protocol_to_tag(const char *proto_string) const; | ||
| bool update_rbio(bool move_to_socket); | ||
|
|
||
| bool sslHandShakeComplete = false; | ||
| bool sslClientRenegotiationAbort = false; | ||
| bool sslSessionCacheHit = false; | ||
| MIOBuffer *handShakeBuffer = nullptr; | ||
| IOBufferReader *handShakeHolder = nullptr; | ||
| IOBufferReader *handShakeReader = nullptr; | ||
| int handShakeBioStored = 0; | ||
| enum SSLHandshakeStatus sslHandshakeStatus = SSL_HANDSHAKE_ONGOING; | ||
| bool sslClientRenegotiationAbort = false; | ||
| bool sslSessionCacheHit = false; | ||
| MIOBuffer *handShakeBuffer = nullptr; | ||
| IOBufferReader *handShakeHolder = nullptr; | ||
| IOBufferReader *handShakeReader = nullptr; | ||
| int handShakeBioStored = 0; | ||
|
|
||
| bool transparentPassThrough = false; | ||
|
|
||
|
|
@@ -364,6 +370,7 @@ class SSLNetVConnection : public UnixNetVConnection | |
| HANDSHAKE_HOOKS_CLIENT_CERT_INVOKE, | ||
| HANDSHAKE_HOOKS_OUTBOUND_PRE, | ||
| HANDSHAKE_HOOKS_OUTBOUND_PRE_INVOKE, | ||
| HANDSHAKE_HOOKS_VERIFY_SERVER, | ||
| HANDSHAKE_HOOKS_DONE | ||
| } sslHandshakeHookState = HANDSHAKE_HOOKS_PRE; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how the other enumerations should be formatted. See my previous comments.