diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2021-03-04 15:34:11 -0500 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2021-03-04 15:34:11 -0500 |
commit | 6ef83ea3a111b74dfa7290107e82cb20e17c30c6 (patch) | |
tree | a1719ed3ffe5b7ef24f8de60c2970918981a1a75 | |
parent | 1e26adcfdfd98ed3f034de45af092eb3d7427f5b (diff) | |
download | sdl_core-6ef83ea3a111b74dfa7290107e82cb20e17c30c6.tar.gz |
Fix setting encrypted block size when cipher is unknown
-rw-r--r-- | src/components/security_manager/src/ssl_context_impl.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc index 3e1b7db0bb..de5d918685 100644 --- a/src/components/security_manager/src/ssl_context_impl.cc +++ b/src/components/security_manager/src/ssl_context_impl.cc @@ -522,16 +522,15 @@ bool CryptoManagerImpl::SSLContextImpl::Decrypt(const uint8_t* const in_data, size_t CryptoManagerImpl::SSLContextImpl::get_max_block_size(size_t mtu) const { SDL_LOG_AUTO_TRACE(); + const auto max_allowed_block_size = + mtu > SSL3_RT_MAX_PLAIN_LENGTH ? SSL3_RT_MAX_PLAIN_LENGTH : mtu; if (!max_block_size_) { // FIXME(EZamakhov): add correct logics for TLS1/1.2/SSL3 // For SSL3.0 set temporary value 90, old TLS1.2 value is 29 - assert(mtu > 90); - return mtu - 90; + assert(max_allowed_block_size > 90); + return max_allowed_block_size - 90; } - const auto max_allowed_block_size = - mtu > SSL3_RT_MAX_PLAIN_LENGTH ? SSL3_RT_MAX_PLAIN_LENGTH : mtu; - return max_block_size_(max_allowed_block_size); } |