summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Byzhynar <AByzhynar@luxoft.com>2018-04-12 20:10:35 +0300
committerAndrii Kalinich <AKalinich@luxoft.com>2018-06-18 20:18:46 +0300
commit1e1c90e6871f4ea1e795cb25b944b9ca2274fda9 (patch)
tree98ab91be589c75d3c145773b12e81103dfa00c77
parenta7eba255dff0581da32e682a585ae833559a4082 (diff)
downloadsdl_core-1e1c90e6871f4ea1e795cb25b944b9ca2274fda9.tar.gz
Add correct certificate expiration handling
-rw-r--r--src/appMain/smartDeviceLink.ini4
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc4
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc8
3 files changed, 7 insertions, 9 deletions
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index 26b5c8a295..e128bc1a2e 100644
--- a/src/appMain/smartDeviceLink.ini
+++ b/src/appMain/smartDeviceLink.ini
@@ -152,8 +152,8 @@ HelpCommand = Help
AppInfoStorage = app_info.dat
[Security Manager]
-Protocol = TLSv1.2
-;Protocol = DTLSv1.0
+;Protocol = TLSv1.2
+Protocol = DTLSv1.0
; Certificate and key path to pem file
CertificatePath = mycert.pem
KeyPath = mykey.pem
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
index 84d4ac853a..915965f569 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -1157,6 +1157,10 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
if (ret) {
RefreshRetrySequence();
update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
+ const std::string certificate_data = cache_->GetCertificate();
+ if (!certificate_data.empty()) {
+ listener_->OnCertificateUpdated(certificate_data);
+ }
}
return ret;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 6ab63cbdda..5516af81c1 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -1425,17 +1425,11 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
}
#ifdef ENABLE_SECURITY
+ const uint8_t protocol_version = packet->protocol_version();
const bool protection =
-<<<<<<< HEAD
- // Protocol version 1 is not support protection
- (packet->protocol_version() > PROTOCOL_VERSION_1)
- ? packet->protection_flag()
- : false;
-=======
// Protocol version 1 does not support protection
(protocol_version > PROTOCOL_VERSION_1) ? packet->protection_flag()
: false;
->>>>>>> Add handling of wrong force protection settings in ini file
#else
const bool protection = false;
#endif // ENABLE_SECURITY