summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Batutin <ABatutin@luxoft.com>2014-07-14 16:38:06 +0300
committerAndrew Batutin <ABatutin@luxoft.com>2014-07-14 16:38:06 +0300
commit89b35276066cc5b1b1fd4f38224d36d3d1b1b0ad (patch)
treebb58d4c92dac86e0fdd895a4c13e00079562569c
parent74cb89afdc5cf4a032936bcfd09e36240319c571 (diff)
parentb88d85d013ba089ae13e1c6d981a9dbd84acc2cc (diff)
downloadsdl_core-89b35276066cc5b1b1fd4f38224d36d3d1b1b0ad.tar.gz
Merge branch 'develop' of https://adc.luxoft.com/stash/scm/ford/applink into develop
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc8
-rw-r--r--src/components/policy/src/policy/policy_table/table_struct_ext/validation.cc14
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc6
-rw-r--r--src/components/security_manager/include/security_manager/security_query.h4
-rw-r--r--src/components/transport_manager/src/mme/iap2_connection.cc6
-rw-r--r--test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h11
6 files changed, 28 insertions, 21 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index cc0f91bb96..abb87357f7 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -715,8 +715,6 @@ void ApplicationManagerImpl::OnMessageReceived(
if (outgoing_message) {
messages_from_mobile_.PostMessage(
impl::MessageFromMobile(outgoing_message));
- } else {
- LOG4CXX_WARN(logger_, "Incorrect message received");
}
}
@@ -819,7 +817,7 @@ bool ApplicationManagerImpl::IsAudioStreamingAllowed(uint32_t connection_key) co
ApplicationSharedPtr app = application(connection_key);
if (!app) {
- LOG4CXX_INFO(logger_, "An application is not registered.");
+ LOG4CXX_WARN(logger_, "An application is not registered.");
return false;
}
@@ -837,7 +835,7 @@ bool ApplicationManagerImpl::IsVideoStreamingAllowed(uint32_t connection_key) co
ApplicationSharedPtr app = application(connection_key);
if (!app) {
- LOG4CXX_INFO(logger_, "An application is not registered.");
+ LOG4CXX_WARN(logger_, "An application is not registered.");
return false;
}
@@ -1557,7 +1555,7 @@ utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
&&
message->service_type() != protocol_handler::kBulk) {
// skip this message, not under handling of ApplicationManager
- LOG4CXX_INFO(logger_, "Skipping message; not the under AM handling.");
+ LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
return outgoing_message;
}
diff --git a/src/components/policy/src/policy/policy_table/table_struct_ext/validation.cc b/src/components/policy/src/policy/policy_table/table_struct_ext/validation.cc
index 36f2690863..d11321f359 100644
--- a/src/components/policy/src/policy/policy_table/table_struct_ext/validation.cc
+++ b/src/components/policy/src/policy/policy_table/table_struct_ext/validation.cc
@@ -51,20 +51,22 @@ bool DeviceParams::Validate() const {
bool PolicyTable::Validate() const {
for (ApplicationPolicies::const_iterator it = app_policies.begin();
app_policies.end() != it; ++it) {
+ // TODO(AOleynik): checks below are disabled until clarification with
+ // customer, see APPLINK-8149
if (kDeviceApp == it->first) {
- if (it->second.AppHMIType.is_initialized()
+ if (/*it->second.AppHMIType.is_initialized()
|| it->second.memory_kb.is_initialized()
|| it->second.heart_beat_timeout_ms.is_initialized()
- || it->second.nicknames.is_initialized()) {
+ ||*/ it->second.nicknames.is_initialized()) {
initialization_state__ = kUninitialized;
return false;
}
continue;
}
if (kDefaultApp == it->first || kPreDataConsentApp == it->first) {
- if (!it->second.memory_kb.is_initialized()
+ if (/*!it->second.memory_kb.is_initialized()
|| !it->second.heart_beat_timeout_ms.is_initialized()
- || it->second.nicknames.is_initialized()) {
+ ||*/ it->second.nicknames.is_initialized()) {
initialization_state__ = kUninitialized;
return false;
}
@@ -72,9 +74,9 @@ bool PolicyTable::Validate() const {
}
if (!it->second.is_null() && !it->second.is_string()
&& (!it->second.nicknames.is_initialized()
- || !it->second.AppHMIType.is_initialized()
+ /*|| !it->second.AppHMIType.is_initialized()
|| !it->second.memory_kb.is_initialized()
- || !it->second.heart_beat_timeout_ms.is_initialized())) {
+ || !it->second.heart_beat_timeout_ms.is_initialized()*/)) {
initialization_state__ = kUninitialized;
return false;
}
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index c3d1a84e29..f60beac24b 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -480,7 +480,7 @@ void ProtocolHandlerImpl::OnTMMessageReceiveFailed(
}
void ProtocolHandlerImpl::NotifySubscribers(const RawMessagePtr message) {
- LOG4CXX_ERROR(logger_, "ProtocolHandlerImpl::NotifySubscribers");
+ LOG4CXX_TRACE(logger_, "ProtocolHandlerImpl::NotifySubscribers");
sync_primitives::AutoLock lock(protocol_observers_lock_);
for (ProtocolObservers::iterator it = protocol_observers_.begin();
protocol_observers_.end() != it; ++it) {
@@ -489,7 +489,7 @@ void ProtocolHandlerImpl::NotifySubscribers(const RawMessagePtr message) {
}
void ProtocolHandlerImpl::OnTMMessageSend(const RawMessagePtr message) {
- LOG4CXX_INFO(logger_, "Sending message finished successfully.");
+ LOG4CXX_DEBUG(logger_, "Sending message finished successfully.");
uint32_t connection_handle = 0;
uint8_t sessionID = 0;
@@ -1036,6 +1036,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
return RESULT_OK;
}
if (ssl_context->IsInitCompleted()) {
+ // mark service as protected
+ session_observer_->SetProtectionFlag(connection_key, service_type);
// Start service as protected with current SSLContext
SendStartSessionAck(connection_id, session_id, packet.protocol_version(),
connection_key, packet.service_type(), PROTECTION_ON);
diff --git a/src/components/security_manager/include/security_manager/security_query.h b/src/components/security_manager/include/security_manager/security_query.h
index 9c8f78536f..944553e64c 100644
--- a/src/components/security_manager/include/security_manager/security_query.h
+++ b/src/components/security_manager/include/security_manager/security_query.h
@@ -76,12 +76,12 @@ class SecurityQuery {
ERROR_NOT_SUPPORTED = 0x03, // SDL does not support encryption
ERROR_SERVICE_ALREADY_PROTECTED = 0x04,
ERROR_SERVICE_NOT_PROTECTED = 0x05, // got handshake or encrypted data
- // for not protected service ???
+ // for not protected service
ERROR_DECRYPTION_FAILED = 0x06,
ERROR_ENCRYPTION_FAILED = 0x07,
ERROR_SSL_INVALID_DATA = 0x08,
ERROR_INTERNAL = 0xFF,
- ERROR_UNKWOWN_INTERNAL_ERROR = 0xFE // error valeu for testing
+ ERROR_UNKWOWN_INTERNAL_ERROR = 0xFE // error value for testing
};
/**
* \brief QueryHeader is 12 byte header of security query
diff --git a/src/components/transport_manager/src/mme/iap2_connection.cc b/src/components/transport_manager/src/mme/iap2_connection.cc
index 056211c544..883d96c285 100644
--- a/src/components/transport_manager/src/mme/iap2_connection.cc
+++ b/src/components/transport_manager/src/mme/iap2_connection.cc
@@ -96,8 +96,10 @@ void IAP2Connection::ReceiveData() {
int size = iap2_eap_recv(iap2ea_hdl_, buffer_, kBufferSize);
if (size != -1) {
LOG4CXX_INFO(logger_, "iAP2: received " << size << " bytes on protocol " << protocol_name_);
- RawMessageSptr message(new protocol_handler::RawMessage(0, 0, buffer_, size));
- controller_->DataReceiveDone(device_uid_, app_handle_, message);
+ if (size != 0) {
+ RawMessageSptr message(new protocol_handler::RawMessage(0, 0, buffer_, size));
+ controller_->DataReceiveDone(device_uid_, app_handle_, message);
+ }
}
else {
switch (errno) {
diff --git a/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h b/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
index 51c9732197..9a8998081b 100644
--- a/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
+++ b/test/components/protocol_handler/include/protocol_handler/protocol_handler_tm_test.h
@@ -369,13 +369,16 @@ TEST_F(ProtocolHandlerImplTest,SecurityEnable_StartSessionProtected_SSLInitializ
//emulate SSL is initilized
WillOnce(Return(true));
+ // Expect service protection enable
+ EXPECT_CALL(session_observer_mock,
+ SetProtectionFlag(connection_key, start_service));
+
// expect send Ack with PROTECTION_ON (on SSL is initilized)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON))).
WillOnce(Return(E_SUCCESS));
SendControlMessage(PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
-
}
/*
* ProtocolHandler shall send Ack with PROTECTION_OFF on session handshhake fail
@@ -470,7 +473,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSu
// emulate protection for service is not enabled
WillOnce(ReturnNull());
- // On success handshake mark service as protected
+ // Expect service protection enable
EXPECT_CALL(session_observer_mock,
SetProtectionFlag(connection_key, start_service));
@@ -525,7 +528,7 @@ TEST_F(ProtocolHandlerImplTest,
// emulate protection for service is not enabled
WillOnce(ReturnNull());
- // On success handshake mark service as protected
+ // Expect service protection enable
EXPECT_CALL(session_observer_mock,
SetProtectionFlag(connection_key, start_service));
@@ -584,7 +587,7 @@ TEST_F(ProtocolHandlerImplTest,
// emulate protection for service is not enabled
WillOnce(ReturnNull());
- // On success handshake mark service as protected
+ // Expect service protection enable
EXPECT_CALL(session_observer_mock,
SetProtectionFlag(connection_key, start_service));