瀏覽代碼

Use ssl3_is_version_enabled to skip offering sessions.

We do an ad-hoc upper-bound check, but if the version is too low, we also
shouldn't offer the session. This isn't fatal to the connection and doesn't
have issues (we'll check the version later regardless), but offering a session
we're never going to accept is pointless. The check should match what we do in
ServerHello.

Credit to Matt Caswell for noticing the equivalent issue in an OpenSSL pull
request.

Change-Id: I17a4efd37afa63b34fca53f4c9b7ac3ae2fa3336
Reviewed-on: https://boringssl-review.googlesource.com/7543
Reviewed-by: David Benjamin <davidben@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 8 年之前
父節點
當前提交
e29ea166a6
共有 1 個檔案被更改,包括 3 行新增4 行删除
  1. +3
    -4
      ssl/s3_clnt.c

+ 3
- 4
ssl/s3_clnt.c 查看文件

@@ -666,13 +666,12 @@ int ssl3_send_client_hello(SSL *ssl) {
ssl->client_version = max_version;
}

/* If the configured session has expired or was created at a version higher
* than our maximum version, drop it. */
/* If the configured session has expired or was created at a disabled
* version, drop it. */
if (ssl->session != NULL &&
(ssl->session->session_id_length == 0 || ssl->session->not_resumable ||
ssl->session->timeout < (long)(time(NULL) - ssl->session->time) ||
(!SSL_IS_DTLS(ssl) && ssl->session->ssl_version > ssl->version) ||
(SSL_IS_DTLS(ssl) && ssl->session->ssl_version < ssl->version))) {
!ssl3_is_version_enabled(ssl, ssl->session->ssl_version))) {
SSL_set_session(ssl, NULL);
}



Loading…
取消
儲存