summaryrefslogtreecommitdiff
path: root/src/components/security_manager/src/ssl_context_impl.cc
diff options
context:
space:
mode:
authorAnton Hrytsevich <ahrytsevich>2015-12-07 18:26:36 +0200
committerAnton Hrytsevich <ahrytsevich>2015-12-07 18:26:36 +0200
commitea659d62aa07e31767f6783fb5d5b0f997145713 (patch)
treebde9e1e2033f9de4fd72be98889c4d37fd3fca3f /src/components/security_manager/src/ssl_context_impl.cc
parent9bf77f2a2fd8c3c3b5a7084864f1939ca117f58e (diff)
downloadsdl_core-ea659d62aa07e31767f6783fb5d5b0f997145713.tar.gz
Fix core crash: assert to double taking mutex
SDL crashed when trying got mutex in sub method. Change automutex scope to minimal scope. Fixes: [APPLINK-19317](https://adc.luxoft.com/jira/browse/APPLINK-19317)
Diffstat (limited to 'src/components/security_manager/src/ssl_context_impl.cc')
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
index 4a46406675..999909aaf7 100644
--- a/src/components/security_manager/src/ssl_context_impl.cc
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -50,8 +50,6 @@ CryptoManagerImpl::SSLContextImpl::SSLContextImpl(SSL *conn, Mode mode)
bioIn_(BIO_new(BIO_s_mem())),
bioOut_(BIO_new(BIO_s_mem())),
bioFilter_(NULL),
- //recursive mutex
- bio_locker(true),
// TODO(EZamakhov): get MTU by parameter (from transport)
// default buffer size is TCP MTU
buffer_size_(1500),
@@ -300,12 +298,14 @@ DoHandshakeStep(const uint8_t* const in_data, size_t in_data_size,
*out_data_size = 0;
// TODO(Ezamakhov): add test - hanshake fail -> restart StartHandshake
- sync_primitives::AutoLock locker(bio_locker);
+ {
+ sync_primitives::AutoLock locker(bio_locker);
- if (SSL_is_init_finished(connection_)) {
- LOG4CXX_DEBUG(logger_, "SSL initilization is finished");
- is_handshake_pending_ = false;
- return Handshake_Result_Success;
+ if (SSL_is_init_finished(connection_)) {
+ LOG4CXX_DEBUG(logger_, "SSL initilization is finished");
+ is_handshake_pending_ = false;
+ return Handshake_Result_Success;
+ }
}