summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CHANGELOG.md153
-rw-r--r--CMakeLists.txt63
-rw-r--r--Doxyfile2
-rw-r--r--README.md4
-rw-r--r--docs/SDL.SDD.Template.dox (renamed from docs/FORD.OpenSDL.SDD.TPL.dox)38
-rw-r--r--docs/mainpage.dox4
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp6
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp6
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp10
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h2
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp10
-rw-r--r--src/appMain/CMakeLists.txt4
-rw-r--r--src/appMain/sdl_preloaded_pt.json6
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h14
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h4
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h2
-rw-r--r--src/components/application_manager/src/application_impl.cc2
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc18
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc5
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc6
-rw-r--r--src/components/application_manager/test/CMakeLists.txt5
-rw-r--r--src/components/application_manager/test/commands/mobile/slider_test.cc5
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h3
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc4
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc9
-rw-r--r--src/components/application_manager/test/sdl_preloaded_pt.json2
-rw-r--r--src/components/application_manager/test/sdl_pt_update.json4
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h14
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h8
-rw-r--r--src/components/connection_handler/src/connection.cc4
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc21
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc59
-rw-r--r--src/components/connection_handler/test/connection_test.cc2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h30
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h30
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc29
-rw-r--r--src/components/hmi_message_handler/src/websocket_session.cc30
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h14
-rw-r--r--src/components/include/protocol_handler/session_observer.h20
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h2
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h14
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h4
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc6
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc60
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc2
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc14
-rw-r--r--src/components/policy/policy_external/test/json/PTU.json2
-rw-r--r--src/components/policy/policy_external/test/json/PTU2.json2
-rw-r--r--src/components/policy/policy_external/test/json/PTU3.json2
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json4
-rw-r--r--src/components/policy/policy_external/test/json/PTU_without_requestType_field.json4
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json2
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json2
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json2
-rw-r--r--src/components/policy/policy_external/test/json/ptu2_requestType.json6
-rw-r--r--src/components/policy/policy_external/test/json/ptu_requestType.json6
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt.json2
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json4
-rw-r--r--src/components/policy/policy_external/test/json/valid_sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc3
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc6
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h4
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc6
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc12
-rw-r--r--src/components/policy/policy_regular/test/PTU.json2
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json2
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json2
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json2
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc2
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json6
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json6
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json2
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json4
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json4
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json4
-rw-r--r--src/components/protocol_handler/CMakeLists.txt9
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc28
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc2
-rw-r--r--src/components/security_manager/docs/SDL.SDD.Security.dox (renamed from src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox)28
-rw-r--r--src/components/security_manager/docs/assets/sm_class_diagram.png (renamed from src/components/security_manager/docs/assets/sm_class_digram.png)bin368935 -> 368935 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png)bin28014 -> 28014 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png)bin22326 -> 22326 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_init.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_init.png)bin119018 -> 119018 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png (renamed from src/components/security_manager/docs/assets/sm_sequence_digram_verify.png)bin39820 -> 39820 bytes
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc5
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc2
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc59
-rw-r--r--src/components/utils/src/file_system.cc25
-rw-r--r--src/components/utils/test/policy.sql2
125 files changed, 685 insertions, 457 deletions
diff --git a/.gitignore b/.gitignore
index c552e22d6c..ec291473fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ CMakeCache.txt
CMakeFiles/
*.pyc
.idea
+src/appMain/build_config.txt
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b97dd0471..481f63a805 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,92 +1,61 @@
-# 4.3.0 Release Candidate
-
-## New Features
-
-### EXTENDED_POLICY modes:
-- The `EXTENDED_POLICY` CMake variable (previously `ENABLE_EXTENDED_POLICY`) now has three possible configurations
- - `HTTP` (previously `ENABLE_EXTENDED_POLICY: OFF`) - #941
- - `PROPRIETARY` (previously `ENABLE_EXTENDED_POLICY: ON`) - #940
- - `EXTERNAL_PROPRIETARY` (new, fully featured version of `PROPRIETARY` mode) - #942
-
-### EXTERNAL_PROPRIETARY mode:
-#### New policy table update sequence
-A new policy table update flow was created specifically for the `EXTERNAL_PROPRIETARY` policy mode
-
-- Requirements/Details - #933
-- Diagram - https://user-images.githubusercontent.com/10549248/26896053-9417c604-4b91-11e7-9e47-524c930eb542.png
-
-#### External Policy Manager
-As part of the `EXTERNAL_PROPRIETARY` policy mode, the concept of an "external policy manager" is necessary. This policy manager is a separate program which is in charge of encrypting/decrypting policy tables and attaching an HTTP header to the OnSystemRequest payload when performing a Policy Table Update.
-
-As part of this release, a sample application which performs this function was added to this repository for those who wish to implement this new policy mode, and this program can be started along with Core using an included bash script. This sample application does nothing with the policy table snapshot during the encryption and decryption phases, allowing for OEMs to implement their own encryption algorithms in their place.
-
-#### App permissions/User consent
-Users can now control what functional groups that they want apps to be able to access, as well as decide whether to enable SDL functionality at all on a device-by-device basis.
-
- - Logic was added to allow the user to control what devices are permitted to use SDL functionality - #934
- - Users are prompted when activating an app on a new device for the first time whether or not to allow the device to use SDL functionality (sequence shown in [this diagram](https://user-images.githubusercontent.com/10549248/26897493-ba378f2c-4b96-11e7-93b0-b24f01c7dc28.png))
- - Logic was added to the Policy Manager to allow the user to control what apps have access to specific functional groups - #939
- - Users are prompted when activating an app for the first time (or modifying permissions in settings) with information on what access a requested functional group requires. The user responds to determine whether or not to allow this functionality within the new app (sequence shown in [this diagram](https://user-images.githubusercontent.com/10549248/26902322-e6e02bf0-4ba6-11e7-98b3-c285396061a4.png))
-
-
-#### External user consent
-External user consent allows the HMI to define several groups of permissions within the policy table. This allows the user to enable/disable several functional groups at once.
-
- - The `externalConsentStatus` field is included as part of a GetListOfPermissions response from SDL Core to communicate which groups are activated - #1047
- - External consent groups can be used to enable sets of functional groups using the `disallowed_by_external_consent_entities_off` field in the Policy Table - #1049
- - If this external consent group is set to `ON`, all functional groupings with this parameter are allowed by the user - #1048
- - If this external consent group is set to `OFF`, all functional groupings with this parameter are disallowed by the user - #1050
- - External consent groups can be used to disable sets of functional groups using the `disallowed_by_external_consent_entities_on` field in the Policy Table
- - If this external consent group is set to `ON`, all functional groupings with this parameter are disallowed by the user
- - If this external consent group is set to `OFF`, all functional groupings with this parameter are allowed by the user
-
-#### Cache Manager Function Implementations
-Prior to this release, several functions included in cache_manager.cc were not fully implemented and would not query the local policy table for defined rules and policies. The newly implemented functions for the `EXTERNAL_PROPRIETARY` cache manager are listed below:
- - [CanAppKeepContext()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L310)
- - [CanAppStealFocus()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L363)
- - [GetDefaultHMI()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L374)
- - [ResetUserConsent()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L391)
- - [GetUserPermissionsForDevice()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L406)
- - [GetPreconsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L477)
- - [GetConsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L514)
- - [GetUnconsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L549)
- - [RemoveAppConsentForGroup()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L605)
- - [GetDeviceGroupsFromPolicies()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L799)
- - [SetDeviceData()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L975)
- - [SetUserPermissionsForDevice()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1008)
- - [ReactOnUserDevConsentForApp()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1043)
- - [SetUserPermissionsForApp()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1076)
- - [CountUnconsentedGroups()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1768)
- - [SetMetaInfo()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1868)
- - [IsMetaInfoPresent()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1884)
- - [SetSystemLanguage()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1893)
- - [CleanupUnpairedDevices()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L1919)
- - [SetVinValue()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L2175)
- - [ResetPT()](https://github.com/smartdevicelink/sdl_core/blob/release/4.3.0/src/components/policy/policy_external/src/cache_manager.cc#L2309)
-
-#### Security behavior
-Requirements/Details - #937
-
-### HMI_API additions:
-
-A new RPC was added as part of the implementation of `EXTERNAL_PROPRIETARY` policy mode
-
- - [DecryptCertificate](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L2468-L2476) RPC
-
-Several API additions were made as part of the implementation of the external user consent feature
-
- - [EntityStatus](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L1263-L1266) enum
- - [ExternalConsentStatus](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L1268-L1278) struct
- - externalConsentStatus field added to [OnAppPermissionConsent](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L4170-L4172) and [GetListOfPermissions](https://github.com/smartdevicelink/sdl_core/blob/6283aa26e262d2d16ed1393989d8e0e062dba88d/src/components/interfaces/HMI_API.xml#L4170-L4172)
-
-## Fixes
-- Includes fixes for all defects found by the Coverity scan tool that were introduced in this release - #1641
-- Includes fixes for several Coverity defects that were previously implemented in the `coverity` branch - #1637
-
-## Implemented proposals
-Two new evolution proposals were implemented in release 4.3.0:
-
-- Add API Patch Version [SDL-0050](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0050-add-api-patch-version.md)
- - A patch version was added to the MOBILE API version, HMI API interface versions, and SyncMsgVersion struct
-- External Policy Manager [SDL-0045](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0045-external-policy-manager.md)
- - Details for the implementation of this proposal can be found in the `External Policy Manager` section of these release notes
+# Release 4.5.0
+
+## Supported Specifications
+- SDL Mobile RPC Spec: [Version 4.5.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/4.5.0)
+- SDL Protocol Spec: [Version 5.0.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.0.0)
+
+## Implemented Proposals
+
+[Connectivity via iAP-BT and Transport Switch](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0053-Connectivity-via-iAP-BT-and-Transport-Switch.md) - Implementation of a mechanism to change a registered app connected over one transport to another seamlessly.
+
+[Mark public deprecated methods](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0092-Deprecated-interfaces-markup.md) - Implemented a DEPRECATED macro for marking deprecated methods in the project. Using methods marked with this macro will result in a warning being generated.
+
+[Remove QT HMI from SDL Core (Partially Complete)](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0110-remove-qt-hmi-from-sdl-core.md) - The `qt_hmi` component was removed from SDL Core, the QT_HMI_API interface and dbus adapter will be removed in the next major release, due to this aspect of the proposal requiring breaking changes.
+
+[Use Boost Library (Partially Complete)](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0044-use-Boost-library.md) - The `boost` library is now installed as a 3rd party library, this library is currently only used in the refactored message broker component.
+
+## Enhancements
+- `DBus` and `libusb` are now dynamically linked, instead of being installed as 3rd-party libraries during the SDL Core build - #2004
+
+## Bug Fixes
+- [Remove OEM Specific references in SDL policy table preload file](https://github.com/smartdevicelink/sdl_core/issues/1252)
+- ["resultCode" should be more descriptive than "INVALID_DATA"](https://github.com/smartdevicelink/sdl_core/issues/31)
+- [SDL doesn't apply sequence SUSPEND -> OnSDLAwake -> SUSPEND -> IGN_OFF for saving resumption data](https://github.com/smartdevicelink/sdl_core/issues/1395)
+- [SDL responds "resultCode: SUCCESS" while dataType:VEHICLEDATA_EXTERNTEMP is VEHICLE_DATA_NOT_AVAILABLE and not in subscribed list store](https://github.com/smartdevicelink/sdl_core/issues/982)
+- [Policies SDL should be case-insensetive to "AppID" against listed in policies manager](https://github.com/smartdevicelink/sdl_core/issues/992)
+- [App is disconnected due to PROTOCOL_VIOLATION when start audio streaming after rejected 2 times then accepted](https://github.com/smartdevicelink/sdl_core/issues/1004)
+- [SDL doesn't set unsuccessful "message" value to "info" param in case HMI responds via single UI.RPC when Interface.IsReady missing](https://github.com/smartdevicelink/sdl_core/issues/997)
+- [Navigation SDL does not respond info message in case GENERIC_ERROR watchdog timeout from HMI](https://github.com/smartdevicelink/sdl_core/issues/990)
+- [SDL does not respond info message in case GENERIC_ERROR watchdog timeout from HM](https://github.com/smartdevicelink/sdl_core/issues/1012)
+- [SDL doesn't send info parameter when result of ResetGlobalProperties is GENERIC_ERROR](https://github.com/smartdevicelink/sdl_core/issues/1016)
+- [SDL does not send StopAudioStream() if exit app while Video service and Audio service are starting.](https://github.com/smartdevicelink/sdl_core/issues/1002)
+- [APIs AlertManeuver: SDL responds GENERIC_ERROR instead of INVALID_DATA when soft button has Type is Image or Both and Text is whitespace or \t or \n or empty](https://github.com/smartdevicelink/sdl_core/issues/980)
+- [IVSU SDL doesn't reject SystemRequest with filenam=IVSU but w/o binary data.](https://github.com/smartdevicelink/sdl_core/issues/976)
+- [Memory leaks: SDL does not release memory after sending AddCommand limit exhausted](https://github.com/smartdevicelink/sdl_core/issues/1029)
+- [Negative result code send instead of IGNORED for UnsubscribedVehicleData when VehicleInfo IsReady Missing](https://github.com/smartdevicelink/sdl_core/issues/996)
+- [API SDL responds "UNSUPPORTED_RESOURCE", success= false in case only have "UNSUPPORTED_RESOURCE" to Navigation.AlertManeuver](https://github.com/smartdevicelink/sdl_core/issues/989)
+- [Default app policies are never updated after a PTU](https://github.com/smartdevicelink/sdl_core/issues/1772)
+- [Build fails with GCC6+](https://github.com/smartdevicelink/sdl_core/issues/1975)
+- [Remote Control test suite fails](https://github.com/smartdevicelink/sdl_core/issues/1993)
+- [PoliciesManager allows all requested params in case "parameters" field is empty](https://github.com/smartdevicelink/sdl_core/issues/1873)
+- [OnDriverDistraction SDL does not send notification to app right after this app changes level from NONE to any other](https://github.com/smartdevicelink/sdl_core/issues/1881)
+- [Protect access to Resumption data during LastState::SaveStateToFileSystem](https://github.com/smartdevicelink/sdl_core/issues/1953)
+- [Need to protect cache manager "pt_" from concurrent access](https://github.com/smartdevicelink/sdl_core/issues/1961)
+- [Prevent deadlock in EventDispatcherIimpl::raise_event](https://github.com/smartdevicelink/sdl_core/issues/1949)
+- [Bluetooth StartService fail after Core restarted](https://github.com/smartdevicelink/sdl_core/issues/1932)
+- [Silent error caused by implicit conversion of SmartPointer to integer](https://github.com/smartdevicelink/sdl_core/issues/1834)
+- [AOA USB transport buffer size too small](https://github.com/smartdevicelink/sdl_core/issues/1863)
+- [Lock screen icon URL should be updated](https://github.com/smartdevicelink/sdl_core/issues/1646)
+- [Broken link in README.md for Software Architecture Documentation](https://github.com/smartdevicelink/sdl_core/issues/2091)
+- [SDL doesn't send OnPermissionsChange in case of external user consent](https://github.com/smartdevicelink/sdl_core/issues/2072)
+- [Build fails when ENABLE_SECURITY=OFF](https://github.com/smartdevicelink/sdl_core/issues/2073)
+
+### Security Related Fixes
+- [SDL must start PTU for navi app right after app successfully registration](https://github.com/smartdevicelink/sdl_core/issues/1925)
+- [SDL must start PTU for any app except navi right after app successfully request to start first secure service](https://github.com/smartdevicelink/sdl_core/issues/1924)
+- [PolicyTableUpdate is failed by any reason and "ForceProtectedService"=ON at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1923)
+- [PolicyTableUpdate has NO "certificate" and "ForceProtectedService"=ON at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1922)
+- [SDL must respond NACK in case navigation app connected over protocol v2 sends StartService for audio service](https://github.com/smartdevicelink/sdl_core/issues/1912)
+- [PolicyTableUpdate has NO "certificate" and "ForceProtectedService"=OFF at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1894)
+- [PolicyTableUpdate is failed by any reason and "ForceProtectedService"=OFF at .ini file](https://github.com/smartdevicelink/sdl_core/issues/1891)
+- [PolicyTableUpdate is valid and brings "certificate"](https://github.com/smartdevicelink/sdl_core/issues/1888)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 450a9192f3..49959597a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,6 +163,65 @@ endif()
#Jenkins integration section end
+#Deliver Build Configuration
+
+set(build_config_path "src/appMain/build_config.txt")
+FILE(WRITE "${build_config_path}" "")
+
+get_property(cHelpString CACHE EXTENDED_POLICY PROPERTY HELPSTRING)
+get_property(cType CACHE EXTENDED_POLICY PROPERTY TYPE)
+get_property(cValue CACHE EXTENDED_POLICY PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "EXTENDED_POLICY:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE REMOTE_CONTROL PROPERTY HELPSTRING)
+get_property(cType CACHE REMOTE_CONTROL PROPERTY TYPE)
+get_property(cValue CACHE REMOTE_CONTROL PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "REMOTE_CONTROL:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE BUILD_BT_SUPPORT PROPERTY HELPSTRING)
+get_property(cType CACHE BUILD_BT_SUPPORT PROPERTY TYPE)
+get_property(cValue CACHE BUILD_BT_SUPPORT PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "BUILD_BT_SUPPORT:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE BUILD_USB_SUPPORT PROPERTY HELPSTRING)
+get_property(cType CACHE BUILD_USB_SUPPORT PROPERTY TYPE)
+get_property(cValue CACHE BUILD_USB_SUPPORT PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "BUILD_USB_SUPPORT:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE ENABLE_SECURITY PROPERTY HELPSTRING)
+get_property(cType CACHE ENABLE_SECURITY PROPERTY TYPE)
+get_property(cValue CACHE ENABLE_SECURITY PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "ENABLE_SECURITY:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE EXTENDED_MEDIA_MODE PROPERTY HELPSTRING)
+get_property(cType CACHE EXTENDED_MEDIA_MODE PROPERTY TYPE)
+get_property(cValue CACHE EXTENDED_MEDIA_MODE PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "EXTENDED_MEDIA_MODE:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE TELEMETRY_MONITOR PROPERTY HELPSTRING)
+get_property(cType CACHE TELEMETRY_MONITOR PROPERTY TYPE)
+get_property(cValue CACHE TELEMETRY_MONITOR PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "TELEMETRY_MONITOR:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE HMI PROPERTY HELPSTRING)
+get_property(cType CACHE HMI PROPERTY TYPE)
+get_property(cValue CACHE HMI PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "HMI:${cType}=${cValue}\n\n")
+
+get_property(cHelpString CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY HELPSTRING)
+get_property(cType CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY TYPE)
+get_property(cValue CACHE ENABLE_HMI_PTU_DECRYPTION PROPERTY VALUE)
+file(APPEND "${build_config_path}" "//${cHelpString}\n")
+file(APPEND "${build_config_path}" "ENABLE_HMI_PTU_DECRYPTION:${cType}=${cValue}\n")
+
add_custom_target(pasa-tarball
COMMAND ${CMAKE_SOURCE_DIR}/tools/Utils/export-customer-specific.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} pasa
COMMAND tar -cz -C /tmp/PASA -f ${CMAKE_BINARY_DIR}/pasa.tar.gz .
@@ -180,7 +239,6 @@ add_custom_target(genivi-tarball
COMMAND tar -cz -C /tmp/GENIVI -f ${CMAKE_BINARY_DIR}/genivi.tar.gz .
)
-
project (${PROJECT})
#ADD_DEPENDENCIES(${PROJECT} Policy)
@@ -445,5 +503,4 @@ find_package(Doxygen)
message(STATUS "sudo apt-get install doxygen graphviz")
message(STATUS "To enable processing of MscGen comments please install mscgen")
message(STATUS "sudo apt-get install mscgen")
-endif()
-
+endif() \ No newline at end of file
diff --git a/Doxyfile b/Doxyfile
index 0b46c939b6..36155e37a7 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -838,7 +838,7 @@ RECURSIVE = YES
# run.
EXCLUDE = **/CMakeLists.txt \
- docs/FORD.OpenSDL.SDD.TPL.dox
+ docs/SDL.SDD.Template.dox
src/components/test_main.cc
src/thirdPartyLibs \
tools/FlexeLint \
diff --git a/README.md b/README.md
index e7146636a2..4939a2e2fe 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Pull Requests Welcome!
## Documentation
- * [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
+ * [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
* [Transport Manager Programming Guide](https://smartdevicelink.com/en/guides/core/transport-manager-programming/)
* [Software Detailed Design](https://app.box.com/s/ohgrvemtx39f8hfea1ab676xxrzvyx1y)
* [Integration Guidelines](https://smartdevicelink.com/en/docs/hmi/master/overview/)
@@ -65,8 +65,10 @@ The dependencies for SDL Core vary based on the configuration. You can change SD
| Flag | Description | Dependencies |
|------|-------------|--------------|
|Web HMI|Use HTML5 HMI|chromium-browser|
+|DBus|Use DBus HMI Adapter|dbus-1-dev|
|EXTENDED_MEDIA_MODE|Support Video and Audio Streaming|Opengl es2, gstreamer1.0*|
|Bluetooth|Enable bluetooth transport adapter|libbluetooth3, libbluetooth-dev, bluez-tools|
+|USB|Enable USB transport adapter|libusb-dev|
|Testing framework|Needed to support running unit tests|libgtest-dev|
|Cmake|Needed to configure SDL prior to compilation|cmake|
diff --git a/docs/FORD.OpenSDL.SDD.TPL.dox b/docs/SDL.SDD.Template.dox
index c0106df5d4..435da665db 100644
--- a/docs/FORD.OpenSDL.SDD.TPL.dox
+++ b/docs/SDL.SDD.Template.dox
@@ -9,19 +9,19 @@ https://adc.luxoft.com/confluence/display/PORTAL/Software+Detailed+Design+Templa
For adding new component documentation please follow this steps:
1. Copy this document to the 'doc' subdirectory in the Component working directory with a new name
- Example:
- + src/components/transport_manager/docs/FORD.OpenSDL.SDD.TM.dox
- + src/components/utils/docs/FORD.OpenSDL.SDD.Utils.dox
+ + src/components/transport_manager/docs/SDL.SDD.TM.dox
+ + src/components/utils/docs/SDL.SDD.Utils.dox
- https://adc.luxoft.com/confluence/display/PORTAL/Documentation+Control+Guideline#DocumentationControlGuideline-DocumentNaming
2. Replace <!Component Name> with a correct naming according to SAD naming
- Name examples:
Application Manager, Connection Handler
- Replace examples:
- ~ sed -i 's/<!Component Name>/Utils/g' FORD.OpenSDL.SDD.Utils.dox
+ ~ sed -i 's/<!Component Name>/Utils/g' SDL.SDD.Utils.dox
3. Replace <!Component_Id> with a shot unique name
- Something like app_manage, connection_handler, policy
- It shall be one word without spaces and special symbols except '_'
- Replace examples:
- ~ sed -i 's/<!Component_Id>/connection_handler/g' FORD.OpenSDL.SDD.Utils.dox
+ ~ sed -i 's/<!Component_Id>/connection_handler/g' SDL.SDD.Utils.dox
Note: After that step all Doxygen tags becomes working well and IDE could be used
4. Add reference in mainpage.dox Table of Content using <!Component_Id> used in p.3
5. Replace blocks marked as following with a content according to instructions in these blocks
@@ -101,7 +101,7 @@ Example:
Here need to be added a reason and short description of the components functionality
Example:
Security Manager component extracted as a separate module for
- Ford channel data protection.
+ SDL channel data protection.
This components is used to :
- Provide security communications
- Protect income and outcome business layer data from interception
@@ -152,27 +152,27 @@ Example:
\anchor <!Component_Id>_class_structure
### 2.2 Class Structure
-The following UML class digram shows the component classes structure.
+The following UML class diagram shows the component classes structure.
<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
Here need to be added class diagram
Example:
- ![Security Manager class diagram](sm_class_digram.png)
+ ![Security Manager class diagram](sm_class_diagram.png)
For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
+As a tool for image preparing could be used Gliffy diagram
https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
OR plantuml diagram
http://plantuml.com/classes.html
Note: Source files of diagram and output images need to be also committed to git.
<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-For more information about class digram follow:
+For more information about class diagram follow:
- http://www.uml-diagrams.org/class-diagrams-overview.html
- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
\anchor <!Component_Id>_sequence_diagram
### 2.3 Sequence diagram
-The following UML sequence digram shows how objects operate with one another and in what order.
+The following UML sequence diagram shows how objects operate with one another and in what order.
<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
Here need to be added sequence diagram
@@ -182,34 +182,34 @@ Example:
![job](job.png)
![disconnection](disconnection.png)
For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
+As a tool for image preparing could be used Gliffy diagram
https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
OR plantuml diagram
http://plantuml.com/sequence.html
Note: Source files of diagram and output images need to be also committed to git.
<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-For more information about sequence digram follow:
+For more information about sequence diagram follow:
- http://www.uml-diagrams.org/sequence-diagrams.html
- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
\anchor <!Component_Id>_state_chart
### 2.4 State chart diagram
-The following UML state digram shows the component life cycle states.
+The following UML state diagram shows the component life cycle states.
<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
Here need to be added state diagram
Example:
![StateControllerImpl state](state_contoroller_states.png)
For adding images in MD format follow https://www.stack.nl/~dimitri/doxygen/manual/markdown.html#md_images
-As a tool for image preparing could be used Gliffy digram
+As a tool for image preparing could be used Gliffy diagram
https://adc.luxoft.com/confluence/pages/createpage.action?showGliffyMacro=true&fromCreateDialog=true&spaceKey=APPLINK
OR plantuml diagram
http://plantuml.com/state.html
Note: Source files of diagram and output images need to be also committed to git.
<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
-For more information about class digram follow:
+For more information about class diagram follow:
- http://www.uml-diagrams.org/state-machine-diagrams.html
*/
//-----------------------------------------------------------
@@ -285,7 +285,7 @@ The format of processing/saving/loading data is:
Here need to be added a list of formats
Example:
- Json data according to APPLINK-19421
- - Binary data array according to Ford Protocol Specification
+ - Binary data array according to SDL Protocol Specification
+ https://github.com/smartdevicelink/protocol_spec
- PEM certificates according to APPLINK-21512
All link will be auto-added by doxygen
@@ -314,7 +314,7 @@ Example:
\page <!Component_Id>_references_and_history 5. References and history
\anchor <!Component_Id>_references
### 5.1 References
-- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
+- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
Here need to be added a list of all related to component functionality
@@ -349,7 +349,7 @@ Example:
For more precise document change history follow github history -
<!!!!!!!!!!!BEGIN_INSTRUCTION!!!!!!!!!!!!!>
Example for this template:
-- https://github.com/smartdevicelink/sdl_core/commits/master/docs/software_detailed_design_template.dox
-- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/software_detailed_design_template.dox
+- https://github.com/smartdevicelink/sdl_core/commits/master/docs/SDL.SDD.Template.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/docs/SDL.SDD.Template.dox
<!!!!!!!!!!!END_INSTRUCTION!!!!!!!!!!!!!>
*/ \ No newline at end of file
diff --git a/docs/mainpage.dox b/docs/mainpage.dox
index 91ee95fc26..08ef020594 100644
--- a/docs/mainpage.dox
+++ b/docs/mainpage.dox
@@ -1,9 +1,9 @@
/**
* \mainpage Software Detail Design Documentation
*
- * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/).
+ * This documents contain SW detailed design information fro each [SmartDeviceLink component](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/).
*
- * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/core/master/software-architecture-document/table-of-contents/)
+ * For getting SmartDeviceLink overview, please, refer to [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
*
* ##Table of contents
* - \ref security_manager
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp
index 9fda7c8eb4..157982e845 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <stdlib.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp
index ea5a680a6c..0336b8dafa 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetdecoder.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/charsetdecoder.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp
index 6b1f564666..adb8f8526d 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/charsetencoder.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
#include <log4cxx/helpers/charsetencoder.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp
index 2963b45619..40e3b67bd0 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/inputstreamreader.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <string.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
index e74d015335..654f9b0eb8 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/locationinfo.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/spi/location/locationinfo.h>
@@ -148,7 +150,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
if (lineNumber == -1 && fileName == NA && methodName == NA_METHOD) {
os.writeNull(p);
} else {
- char prolog[] = {
+ unsigned char prolog[] = {
0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E,
0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C,
0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69,
@@ -161,7 +163,7 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67,
0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
0x78, 0x70 };
- os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
+ os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, reinterpret_cast<char *>(prolog), sizeof(prolog), p);
char* line = p.itoa(lineNumber);
//
// construct Java-like fullInfo (replace "::" with ".")
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp
index 203cb5c346..37b57180a2 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/logger.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
index 1faae3f702..f9730792cf 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/spi/loggingevent.h>
@@ -254,7 +256,7 @@ void LoggingEvent::setProperty(const LogString& key, const LogString& value)
void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
- char classDesc[] = {
+ unsigned char classDesc[] = {
0x72, 0x00, 0x21,
0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63,
0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A,
@@ -310,7 +312,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p) {
0x3B, 0x78, 0x70 };
os.writeProlog("org.apache.log4j.spi.LoggingEvent",
- 8, classDesc, sizeof(classDesc), p);
+ 8, reinterpret_cast<char *>(classDesc), sizeof(classDesc), p);
}
void LoggingEvent::write(helpers::ObjectOutputStream& os, Pool& p) const {
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
index 7cd696b842..29412c1a67 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/objectoutputstream.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#if defined(_MSC_VER)
#pragma warning ( disable: 4231 4251 4275 4786 )
@@ -36,8 +38,8 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
objectHandle(0x7E0000),
classDescriptions(new ClassDescriptionMap())
{
- char start[] = { 0xAC, 0xED, 0x00, 0x05 };
- ByteBuffer buf(start, sizeof(start));
+ unsigned char start[] = { 0xAC, 0xED, 0x00, 0x05 };
+ ByteBuffer buf(reinterpret_cast<char *>(start), sizeof(start));
os->write(buf, p);
}
@@ -81,7 +83,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
//
// TC_OBJECT and the classDesc for java.util.Hashtable
//
- char prolog[] = {
+ unsigned char prolog[] = {
0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
@@ -90,7 +92,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
0x6F, 0x6C, 0x64, 0x78, 0x70 };
- writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
+ writeProlog("java.util.Hashtable", 1, reinterpret_cast<char *>(prolog), sizeof(prolog), p);
//
// loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
char data[] = { 0x3F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
index f2b5de61c7..e5c1b29be9 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/serversocket.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/helpers/serversocket.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp
index 09f5d8ce31..5ef4b1b794 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/sockethubappender.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#if defined(_MSC_VER)
#pragma warning ( disable: 4231 4251 4275 4786 )
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp
index d5166dc8ec..a0e30aa6aa 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/socketoutputstream.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <string.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp
index fffb43a66a..a40df3be94 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/cpp/threadcxx.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#include <log4cxx/logstring.h>
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h
index 5d82b36b39..8f5fac2341 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/logger.h
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#ifndef _LOG4CXX_LOGGER_H
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h
index fc98121dce..f07216afe2 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/location/locationinfo.h
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#ifndef _LOG4CXX_SPI_LOCATION_LOCATIONINFO_H
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
index 2c9c353f8b..58deb3694a 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
#ifndef _LOG4CXX_SPI_LOGGING_EVENT_H
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp b/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
index a500628180..903646048f 100644
--- a/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
+++ b/src/3rd_party/apache-log4cxx-0.10.0/src/test/cpp/xml/domtestcase.cpp
@@ -13,6 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
*/
@@ -190,9 +192,9 @@ public:
DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
#if LOG4CXX_LOGCHAR_IS_UTF8
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };
#else
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
#endif
File file;
file.setPath(fname);
@@ -209,9 +211,9 @@ public:
DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
#if LOG4CXX_LOGCHAR_IS_UTF8
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };
#else
- const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };
+ const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
#endif
File file;
file.setPath(fname);
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index 514867624a..2acc0bf3ae 100644
--- a/src/appMain/CMakeLists.txt
+++ b/src/appMain/CMakeLists.txt
@@ -154,7 +154,7 @@ endif()
target_link_libraries(${PROJECT} ${LIBRARIES})
add_dependencies(${PROJECT} Policy)
-
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/build_config.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/audio.8bit.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
@@ -212,7 +212,7 @@ endif ()
# Install rules
install(TARGETS ${PROJECT} DESTINATION bin)
install(
- FILES log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
+ FILES build_config.txt log4cxx.properties audio.8bit.wav test.txt smartDeviceLink.ini
hmi_capabilities.json sdl_preloaded_pt.json sample_policy_manager.py
${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem
DESTINATION bin
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index 12ebafcb89..e5c82418ee 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -13,16 +13,16 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://localhost:3000/api/1/policies/proprietary"]
+ "default": ["http://x.x.x.x:3000/api/1/policies/proprietary"]
},
"0x04": {
- "default": ["http://localhost:3000/api/1/softwareUpdate"]
+ "default": ["http://x.x.x.x:3000/api/1/softwareUpdate"]
},
"queryAppsUrl": {
"default": ["http://sdl.shaid.server"]
},
"lock_screen_icon_url": {
- "default": ["http://i.imgur.com/QwZ9uKG.png"]
+ "default": ["http://i.imgur.com/TgkvOIZ.png"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index 281f989e51..286ad87018 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -939,6 +939,13 @@ class ApplicationManagerImpl
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason) OVERRIDE;
+ /**
+ * @brief Check if application with specified app_id has NAVIGATION HMI type
+ * @param app_id id of application to check
+ * @return true if application is navi otherwise returns false
+ */
+ bool CheckAppIsNavi(const uint32_t app_id) const OVERRIDE;
+
#ifdef ENABLE_SECURITY
/**
* @brief Notification about protection result
@@ -970,13 +977,6 @@ class ApplicationManagerImpl
*/
security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const OVERRIDE;
-
- /**
- * @brief Check if application with specified app_id has NAVIGATION HMI type
- * @param app_id id of application to check
- * @return true if application is navi otherwise returns false
- */
- bool CheckAppIsNavi(const uint32_t app_id) const OVERRIDE;
#endif // ENABLE_SECURITY
/**
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 4edcd36486..b94609c01b 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -49,6 +49,7 @@
#include "protocol_handler/session_observer.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "smart_objects/smart_object.h"
+#include "transport_manager/common.h"
namespace policy {
class PolicyHandlerInterface;
@@ -140,7 +141,8 @@ class MessageHelper {
mobile_apis::Result::eType mobile_result);
static std::string GetDeviceMacAddressForHandle(
- const uint32_t device_handle, const ApplicationManager& app_mngr);
+ const transport_manager::DeviceHandle device_handle,
+ const ApplicationManager& app_mngr);
/**
* @brief Converts string to mobile Result enum value
* @param mobile_result stringified value
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
index ce5c0818f1..b4653c6cb2 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -67,7 +67,7 @@ class ApplicationManager;
namespace policy {
typedef std::vector<uint32_t> AppIds;
-typedef std::vector<uint32_t> DeviceHandles;
+typedef std::vector<transport_manager::DeviceHandle> DeviceHandles;
namespace custom_str = utils::custom_string;
class PolicyHandler : public PolicyHandlerInterface,
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 22a0f2628e..ac21219d7d 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -46,6 +46,7 @@
#include "utils/timer_task_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "transport_manager/common.h"
namespace {
@@ -81,6 +82,7 @@ void SwitchApplicationParameters(ApplicationSharedPtr app,
const uint32_t app_id,
const size_t device_id,
const std::string& mac_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
utils::SharedPtr<ApplicationImpl> application =
ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app);
DCHECK_OR_RETURN_VOID(application);
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 8c91bf363a..248b54fee5 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -1659,6 +1659,15 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
}
}
+bool ApplicationManagerImpl::CheckAppIsNavi(const uint32_t app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application(app_id);
+ if (app) {
+ return app->is_navi();
+ }
+ return false;
+}
+
#ifdef ENABLE_SECURITY
bool ApplicationManagerImpl::OnHandshakeDone(
uint32_t connection_key,
@@ -1704,15 +1713,6 @@ ApplicationManagerImpl::GetHandshakeContext(uint32_t key) const {
}
return SSLContext::HandshakeContext();
}
-
-bool ApplicationManagerImpl::CheckAppIsNavi(const uint32_t app_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr app = application(app_id);
- if (app) {
- return app->is_navi();
- }
- return false;
-}
#endif // ENABLE_SECURITY
void ApplicationManagerImpl::set_hmi_message_handler(
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 61012224b6..6a908c4ebc 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -54,6 +54,7 @@
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "connection_handler/connection_handler_impl.h"
+#include "transport_manager/common.h"
#include "interfaces/MOBILE_API.h"
#include "smart_objects/enum_schema_item.h"
#include "utils/file_system.h"
@@ -295,7 +296,8 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
}
std::string MessageHelper::GetDeviceMacAddressForHandle(
- const uint32_t device_handle, const ApplicationManager& app_mngr) {
+ const transport_manager::DeviceHandle device_handle,
+ const ApplicationManager& app_mngr) {
std::string device_mac_address = "";
app_mngr.connection_handler().get_session_observer().GetDataOnDeviceID(
device_handle, NULL, NULL, &device_mac_address);
@@ -2415,6 +2417,7 @@ void MessageHelper::SendOnPermissionsChangeNotification(
uint32_t connection_key,
const policy::Permissions& permissions,
ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject content(smart_objects::SmartType_Map);
content[strings::params][strings::function_id] =
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index b6b208b39b..559b9c0035 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -103,7 +103,7 @@ const std::string RequestTypeToString(mobile_apis::RequestType::eType type) {
const policy::DeviceParams GetDeviceParams(
connection_handler::DeviceHandle device_handle,
const protocol_handler::SessionObserver& session_observer) {
- CREATE_LOGGERPTR_LOCAL(logger_, "PolicyHandler")
+ CREATE_LOGGERPTR_LOCAL(logger_, "PolicyHandler");
policy::DeviceParams device_params;
if (-1 ==
session_observer.GetDataOnDeviceID(
@@ -1091,8 +1091,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
MessageHelper::CreateGetVehicleDataRequest(
correlation_id, vehicle_data_args, application_manager_);
} else {
- LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one.");
- policy_manager_->ForcePTExchange();
+ LOG4CXX_WARN(logger_, "Exchange wasn't successful");
}
OnPTUFinished(ret);
return ret;
@@ -1223,6 +1222,7 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
device_handle);
// If consent done from HMI menu
if (it == pending_device_handles_.end()) {
+ LOG4CXX_WARN(logger_, "No pendining application activation");
return;
}
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index 3e9010e22c..90059e4d98 100644
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -101,11 +101,14 @@ set(LIBRARIES
MediaManager
Resumption
ProtocolHandler
- SecurityManager
bson -L${BSON_LIBS_DIRECTORY}
emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
+if (ENABLE_SECURITY)
+ list(APPEND LIBRARIES SecurityManager)
+endif()
+
if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(REMOVE_ITEM LIBRARIES dl)
endif()
diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc
index 54ac3cccc0..53764e3fcd 100644
--- a/src/components/application_manager/test/commands/mobile/slider_test.cc
+++ b/src/components/application_manager/test/commands/mobile/slider_test.cc
@@ -282,9 +282,8 @@ TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) {
CommandPtr command(CreateCommand<SliderRequest>(msg_));
EXPECT_TRUE(command->Init());
- EXPECT_CALL(
- app_mngr_,
- updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
+ EXPECT_CALL(app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, _));
Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
event.set_smart_object(*msg_);
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 7598e33e19..93db0d9795 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -40,6 +40,7 @@
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager.h"
#include "smart_objects/smart_object.h"
+#include "transport_manager/common.h"
namespace application_manager {
@@ -266,7 +267,7 @@ class MockMessageHelper {
MOCK_METHOD1(StringifiedHMILevel,
std::string(const mobile_apis::HMILevel::eType hmi_level));
MOCK_METHOD2(GetDeviceMacAddressForHandle,
- std::string(const uint32_t device_handle,
+ std::string(const transport_manager::DeviceHandle device_handle,
const ApplicationManager& app_mngr));
MOCK_METHOD3(SendDeleteCommandRequest,
void(smart_objects::SmartObject* cmd,
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 2a74f5b3b1..24bba63e71 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -33,6 +33,7 @@
#include "application_manager/message_helper.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "transport_manager/common.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
@@ -496,7 +497,8 @@ std::string MessageHelper::StringifiedHMILevel(
}
std::string MessageHelper::GetDeviceMacAddressForHandle(
- const uint32_t device_handle, const ApplicationManager& app_mngr) {
+ const transport_manager::DeviceHandle device_handle,
+ const ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()->GetDeviceMacAddressForHandle(
device_handle, app_mngr);
}
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 66efe45e30..d9e1cefa01 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -40,8 +40,10 @@
#include "connection_handler/connection_handler_impl.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application_impl.h"
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_crypto_manager.h"
+#endif // ENABLE_SECURITY
#include "application_manager/mock_message_helper.h"
#include "connection_handler/mock_connection_handler_settings.h"
#include "transport_manager/mock_transport_manager.h"
@@ -406,7 +408,6 @@ TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK_PTNotLoaded) {
// Checks
EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(false));
- EXPECT_CALL(*mock_policy_manager_, ForcePTExchange()).WillOnce(Return(""));
EXPECT_CALL(app_manager_, GetNextHMICorrelationID()).Times(0);
EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _))
.Times(0);
@@ -1601,6 +1602,7 @@ TEST_F(PolicyHandlerTest, OnGetListOfPermissions_GroupPermissions_SUCCESS) {
policy_handler_.OnGetListOfPermissions(app_id, corr_id);
}
+#ifdef ENABLE_SECURITY
TEST_F(PolicyHandlerTest, RetrieveCertificate) {
// Arrange
EnablePolicyAndPolicyManagerMock();
@@ -1609,6 +1611,7 @@ TEST_F(PolicyHandlerTest, RetrieveCertificate) {
.WillOnce(Return(test_certificate));
EXPECT_EQ(test_certificate, policy_handler_.RetrieveCertificate());
}
+#endif // ENABLE_SECURITY
TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlNotAdded) {
EnablePolicyAndPolicyManagerMock();
@@ -1826,6 +1829,7 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
}
+#ifdef ENABLE_SECURITY
#ifdef EXTERNAL_PROPRIETARY_MODE
TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
const std::string app_storage = "storage";
@@ -1851,7 +1855,8 @@ TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
EXPECT_CALL(policy_handler_observer, OnCertificateUpdated(cert_data));
policy_handler_.OnCertificateUpdated(cert_data);
}
-#endif
+#endif // EXTERNAL_PROPRIETARY_MODE
+#endif // ENABLE_SECURITY
TEST_F(PolicyHandlerTest, GetAppIdForSending_WithoutApps) {
// Arrange
diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json
index d6f34c12fc..10894516cf 100644
--- a/src/components/application_manager/test/sdl_preloaded_pt.json
+++ b/src/components/application_manager/test/sdl_preloaded_pt.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json
index a332f92382..f890e8e5ae 100644
--- a/src/components/application_manager/test/sdl_pt_update.json
+++ b/src/components/application_manager/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1698,7 +1698,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index b0f9586046..9b72d60776 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -212,6 +212,13 @@ class Connection {
void SetProtectionFlag(const uint8_t session_id,
const protocol_handler::ServiceType& service_type);
+#endif // ENABLE_SECURITY
+ /**
+ * @brief Returns map of sessions which have been opened in
+ * current connection.
+ */
+ const SessionMap session_map() const;
+
/**
* @brief Check if session contains service with specified service type
* @param session_id id of session to check
@@ -222,13 +229,6 @@ class Connection {
const uint8_t session_id,
const protocol_handler::ServiceType& service_type) const;
-#endif // ENABLE_SECURITY
- /**
- * @brief Returns map of sessions which have been opened in
- * current connection.
- */
- const SessionMap session_map() const;
-
/**
* @brief Close session
* @param session_id session id
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
index 3aa304aabc..66b2d7cf16 100644
--- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
@@ -350,6 +350,10 @@ class ConnectionHandlerImpl
const uint32_t& key,
const protocol_handler::ServiceType& service_type) OVERRIDE;
+ security_manager::SSLContext::HandshakeContext GetHandshakeContext(
+ uint32_t key) const OVERRIDE;
+#endif // ENABLE_SECURITY
+
/**
* @brief Check if session contains service with specified service type
* @param connection_key unique id of session to check
@@ -360,10 +364,6 @@ class ConnectionHandlerImpl
const uint32_t connection_key,
const protocol_handler::ServiceType& service_type) const OVERRIDE;
- security_manager::SSLContext::HandshakeContext GetHandshakeContext(
- uint32_t key) const OVERRIDE;
-#endif // ENABLE_SECURITY
-
/**
* \brief Get device handle by mac address
* \param mac_address uniq address
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index d494611643..16b88c4164 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -314,6 +314,8 @@ void Connection::SetProtectionFlag(
}
}
+#endif // ENABLE_SECURITY
+
bool Connection::SessionServiceExists(
const uint8_t session_id,
const protocol_handler::ServiceType& service_type) const {
@@ -330,8 +332,6 @@ bool Connection::SessionServiceExists(
return session.FindService(service_type);
}
-#endif // ENABLE_SECURITY
-
ConnectionHandle Connection::connection_handle() const {
return connection_handle_;
}
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 7ea9efa1cc..5b26304302 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -753,12 +753,11 @@ struct CompareMAC {
bool ConnectionHandlerImpl::GetDeviceID(const std::string& mac_address,
DeviceHandle* device_handle) {
+ DCHECK_OR_RETURN(device_handle, false);
DeviceMap::const_iterator it = std::find_if(
device_list_.begin(), device_list_.end(), CompareMAC(mac_address));
if (it != device_list_.end()) {
- if (device_handle) {
- *device_handle = it->first;
- }
+ *device_handle = it->first;
return true;
}
return false;
@@ -775,7 +774,7 @@ int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
int32_t result = -1;
DeviceMap::const_iterator it = device_list_.find(device_handle);
if (device_list_.end() == it) {
- LOG4CXX_ERROR(logger_, "Device not found!");
+ LOG4CXX_ERROR(logger_, "Device not found for handle " << device_handle);
return result;
}
@@ -878,6 +877,13 @@ void ConnectionHandlerImpl::SetProtectionFlag(
connection.SetProtectionFlag(session_id, service_type);
}
+security_manager::SSLContext::HandshakeContext
+ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
+ return connection_handler_observer_->GetHandshakeContext(key);
+}
+
+#endif // ENABLE_SECURITY
+
bool ConnectionHandlerImpl::SessionServiceExists(
const uint32_t connection_key,
const protocol_handler::ServiceType& service_type) const {
@@ -896,13 +902,6 @@ bool ConnectionHandlerImpl::SessionServiceExists(
return connection.SessionServiceExists(session_id, service_type);
}
-security_manager::SSLContext::HandshakeContext
-ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
- return connection_handler_observer_->GetHandshakeContext(key);
-}
-
-#endif // ENABLE_SECURITY
-
void ConnectionHandlerImpl::StartDevicesDiscovery() {
LOG4CXX_AUTO_TRACE(logger_);
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
index a951598917..d0b9ce4ae4 100644
--- a/src/components/connection_handler/test/connection_handler_impl_test.cc
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -37,8 +37,10 @@
#include "connection_handler/connection_handler_impl.h"
#include "protocol/common.h"
// TODO(EZamakhov): move security test
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
+#endif // ENABLE_SECURITY
#include "protocol_handler/mock_protocol_handler.h"
#include "connection_handler/mock_connection_handler_observer.h"
#include "connection_handler/mock_connection_handler_settings.h"
@@ -175,7 +177,7 @@ class ConnectionHandlerTest : public ::testing::Test {
ASSERT_FALSE(connection_list.empty());
ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
ASSERT_NE(conn_it, connection_list.end());
- const Connection& connection = *connection_list.begin()->second;
+ const Connection& connection = *conn_it->second;
const SessionMap& session_map = connection.session_map();
SessionMap::const_iterator sess_it = session_map.find(session_id);
@@ -206,7 +208,7 @@ class ConnectionHandlerTest : public ::testing::Test {
ASSERT_FALSE(connection_list.empty());
ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
ASSERT_NE(conn_it, connection_list.end());
- const Connection& connection = *connection_list.begin()->second;
+ const Connection& connection = *conn_it->second;
const SessionMap& session_map = connection.session_map();
ASSERT_FALSE(session_map.empty());
@@ -223,7 +225,9 @@ class ConnectionHandlerTest : public ::testing::Test {
ASSERT_EQ(serv_it, service_list.end());
}
}
- // Check Service Wrapper
+
+// Check Service Wrapper
+#ifdef ENABLE_SECURITY
void CheckService(const int connectionId,
const int session_id,
const ::protocol_handler::ServiceType serviceId,
@@ -235,16 +239,14 @@ class ConnectionHandlerTest : public ::testing::Test {
ASSERT_FALSE(connection_list.empty());
ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
ASSERT_NE(conn_it, connection_list.end());
- const Connection& connection = *connection_list.begin()->second;
+ const Connection& connection = *conn_it->second;
const SessionMap& session_map = connection.session_map();
ASSERT_FALSE(session_map.empty());
SessionMap::const_iterator sess_it = session_map.find(session_id);
ASSERT_NE(sess_it, session_map.end());
const Session& session = sess_it->second;
-#ifdef ENABLE_SECURITY
ASSERT_EQ(session.ssl_context, ssl_context);
-#endif // ENABLE_SECURITY
const ServiceList& service_list = session.service_list;
ASSERT_FALSE(service_list.empty());
ServiceList::const_iterator serv_it =
@@ -253,14 +255,39 @@ class ConnectionHandlerTest : public ::testing::Test {
const Service& service = *serv_it;
EXPECT_EQ(PROTECTION_OFF, service.is_protected_);
-#ifdef ENABLE_SECURITY
if (is_protected) {
// Emulate success protection - check enable service flag
const uint32_t connection_key_ =
connection_handler_->KeyFromPair(connectionId, session_id);
connection_handler_->SetProtectionFlag(connection_key_, serviceId);
}
+ }
#endif // ENABLE_SECURITY
+
+ void CheckService(const int connectionId,
+ const int session_id,
+ const ::protocol_handler::ServiceType serviceId) {
+ // Check all tree to find Service and check own protected value
+ const ConnectionList& connection_list =
+ connection_handler_->getConnectionList();
+ ASSERT_FALSE(connection_list.empty());
+ ConnectionList::const_iterator conn_it = connection_list.find(connectionId);
+ ASSERT_NE(conn_it, connection_list.end());
+ const Connection& connection = *conn_it->second;
+
+ const SessionMap& session_map = connection.session_map();
+ ASSERT_FALSE(session_map.empty());
+ SessionMap::const_iterator sess_it = session_map.find(session_id);
+ ASSERT_NE(sess_it, session_map.end());
+ const Session& session = sess_it->second;
+ const ServiceList& service_list = session.service_list;
+ ASSERT_FALSE(service_list.empty());
+ ServiceList::const_iterator serv_it =
+ std::find(service_list.begin(), service_list.end(), serviceId);
+ ASSERT_NE(serv_it, service_list.end());
+
+ const Service& service = *serv_it;
+ EXPECT_EQ(PROTECTION_OFF, service.is_protected_);
}
void ChangeProtocol(const int connectionId,
@@ -1482,8 +1509,7 @@ TEST_F(ConnectionHandlerTest,
connection_handler_->OnSessionStartedCallback(
uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
EXPECT_NE(0u, positive_context.new_session_id_);
- CheckService(
- uid_, positive_context.new_session_id_, kRpc, NULL, PROTECTION_OFF);
+ CheckService(uid_, positive_context.new_session_id_, kRpc);
EXPECT_EQ(SessionHash(uid_, positive_context.new_session_id_),
positive_context.hash_id_);
}
@@ -1525,10 +1551,10 @@ TEST_F(ConnectionHandlerTest,
EXPECT_NE(0u, positive_context.new_session_id_);
EXPECT_EQ(SessionHash(uid_, positive_context.new_session_id_),
positive_context.hash_id_);
-
+#ifdef ENABLE_SECURITY
// Protection steal FALSE because of APPlink Protocol implementation
- CheckService(
- uid_, positive_context.new_session_id_, kRpc, NULL, PROTECTION_OFF);
+ CheckService(uid_, positive_context.new_session_id_, kRpc);
+#endif // ENABLE_SECURITY
}
TEST_F(ConnectionHandlerTest,
@@ -1634,8 +1660,6 @@ TEST_F(ConnectionHandlerTest,
#else
EXPECT_EQ(0u, positive_context.new_session_id_);
EXPECT_EQ(protocol_handler::HASH_ID_WRONG, positive_context.hash_id_);
- CheckService(
- uid_, positive_context.new_session_id_, kAudio, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
}
@@ -1667,7 +1691,6 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) {
EXPECT_EQ(0u, context_new.new_session_id_);
// Post protection nedd no hash
EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_new.hash_id_);
- CheckService(uid_, context_new.new_session_id_, kRpc, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
// Start Audio session without protection
@@ -1678,8 +1701,7 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) {
static_cast<BsonObject*>(NULL));
EXPECT_EQ(out_context_.new_session_id_, context_second.new_session_id_);
EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_second.hash_id_);
- CheckService(
- uid_, context_second.new_session_id_, kAudio, NULL, PROTECTION_OFF);
+ CheckService(uid_, context_second.new_session_id_, kAudio);
// Start Audio protection
connection_handler_->OnSessionStartedCallback(uid_,
@@ -1695,8 +1717,6 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) {
#else
EXPECT_EQ(0u, context_third.new_session_id_);
EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_third.hash_id_);
- CheckService(
- uid_, context_third.new_session_id_, kAudio, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
}
@@ -1718,7 +1738,6 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) {
CheckService(uid_, new_context.new_session_id_, kRpc, NULL, PROTECTION_ON);
#else
EXPECT_EQ(0u, new_context.new_session_id_);
- CheckService(uid_, new_context.new_session_id_, kRpc, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
}
diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc
index 5fd6b40e0e..de21dd1e97 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -40,8 +40,10 @@
#include "protocol/service_type.h"
#include "connection_handler/mock_connection_handler_settings.h"
#include "transport_manager/mock_transport_manager.h"
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
+#endif // ENABLE_SECURITY
#define EXPECT_RETURN_TRUE true
#define EXPECT_RETURN_FALSE false
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
index 98d5260259..60dc50ad7a 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
@@ -1,3 +1,33 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
#ifndef MB_CONTROLLER_H
#define MB_CONTROLLER_H
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
index c084bd7769..9692c4aef4 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
@@ -1,3 +1,33 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
#ifndef WEBSOCKET_SESSION_H
#define WEBSOCKET_SESSION_H
diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc
index ec0d1f8bd8..8d3b11add5 100644
--- a/src/components/hmi_message_handler/src/mb_controller.cc
+++ b/src/components/hmi_message_handler/src/mb_controller.cc
@@ -1,3 +1,32 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
#include "hmi_message_handler/mb_controller.h"
diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc
index 19227a1555..26f15695c9 100644
--- a/src/components/hmi_message_handler/src/websocket_session.cc
+++ b/src/components/hmi_message_handler/src/websocket_session.cc
@@ -1,3 +1,33 @@
+/*
+Copyright (c) 2018 Livio, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
#include "hmi_message_handler/websocket_session.h"
#include "hmi_message_handler/mb_controller.h"
#include <unistd.h>
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
index 1bd919f30e..b4c04c17c9 100644
--- a/src/components/include/connection_handler/connection_handler_observer.h
+++ b/src/components/include/connection_handler/connection_handler_observer.h
@@ -140,6 +140,13 @@ class ConnectionHandlerObserver {
*/
virtual void OnDeviceSwitchingFinish(const std::string& device_uid) = 0;
+ /**
+ * @brief Check if application with specified app_id has NAVIGATION HMI type
+ * @param app_id id of application to check
+ * @return true if application is navi otherwise returns false
+ */
+ virtual bool CheckAppIsNavi(const uint32_t app_id) const = 0;
+
#ifdef ENABLE_SECURITY
/**
* @brief Get unique handshake context by application id
@@ -149,13 +156,6 @@ class ConnectionHandlerObserver {
*/
virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const = 0;
-
- /**
- * @brief Check if application with specified app_id has NAVIGATION HMI type
- * @param app_id id of application to check
- * @return true if application is navi otherwise returns false
- */
- virtual bool CheckAppIsNavi(const uint32_t app_id) const = 0;
#endif // ENABLE_SECURITY
protected:
/**
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index ccf000a18d..3482c6569c 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -297,6 +297,16 @@ class SessionObserver {
uint8_t session_id,
uint8_t& protocol_version) const = 0;
+ /**
+ * @brief Check if session contains service with specified service type
+ * @param connection_key unique id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ virtual bool SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const = 0;
+
#ifdef ENABLE_SECURITY
/**
* \brief Sets crypto context of connection
@@ -327,16 +337,6 @@ class SessionObserver {
const uint32_t& key,
const protocol_handler::ServiceType& service_type) = 0;
- /**
- * @brief Check if session contains service with specified service type
- * @param connection_key unique id of session to check
- * @param service_type type of service to check
- * @return true if session contains service with specified service type
- */
- virtual bool SessionServiceExists(
- const uint32_t connection_key,
- const protocol_handler::ServiceType& service_type) const = 0;
-
virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const = 0;
#endif // ENABLE_SECURITY
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
index f1c605eaca..a96498028d 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -63,9 +63,11 @@ class MockConnectionHandlerObserver
void(const int32_t& session_key,
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason));
+#ifdef ENABLE_SECURITY
MOCK_CONST_METHOD1(
GetHandshakeContext,
security_manager::SSLContext::HandshakeContext(uint32_t key));
+#endif // ENABLE_SECURITY
MOCK_METHOD2(OnDeviceSwitchingStart,
void(const connection_handler::Device& device_from,
diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h
index 3d54b97fad..ae32f35948 100644
--- a/src/components/include/test/protocol_handler/mock_session_observer.h
+++ b/src/components/include/test/protocol_handler/mock_session_observer.h
@@ -37,6 +37,7 @@
#include <string>
#include <list>
#include "protocol_handler/session_observer.h"
+#include "transport_manager/common.h"
namespace test {
namespace components {
@@ -101,13 +102,6 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
std::string* mac_address,
std::string* connection_type));
- DEPRECATED MOCK_CONST_METHOD5(GetDataOnDeviceID,
- int32_t(uint32_t device_handle,
- std::string* device_name,
- std::list<uint32_t>* applications_list,
- std::string* mac_address,
- std::string* connection_type));
-
MOCK_CONST_METHOD2(IsHeartBeatSupported,
bool(transport_manager::ConnectionUID connection_handle,
uint8_t session_id));
@@ -115,6 +109,9 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
bool(uint32_t connection_id,
uint8_t session_id,
uint8_t& protocol_version));
+ MOCK_CONST_METHOD2(SessionServiceExists,
+ bool(const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type));
#ifdef ENABLE_SECURITY
MOCK_METHOD2(SetSSLContext,
@@ -126,9 +123,6 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
MOCK_METHOD2(SetProtectionFlag,
void(const uint32_t& key,
const protocol_handler::ServiceType& service_type));
- MOCK_CONST_METHOD2(SessionServiceExists,
- bool(const uint32_t connection_key,
- const protocol_handler::ServiceType& service_type));
MOCK_CONST_METHOD1(
GetHandshakeContext,
security_manager::SSLContext::HandshakeContext(uint32_t key));
diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h
index f57919b6f7..232191cfea 100644
--- a/src/components/policy/policy_external/include/policy/policy_types.h
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -41,6 +41,8 @@
#include <utility>
#include "utils/shared_ptr.h"
#include "utils/helpers.h"
+#include "transport_manager/common.h"
+
namespace policy {
// TODO(PV): specify errors
@@ -190,7 +192,7 @@ struct DeviceParams {
std::string device_name;
std::string device_mac_address;
std::string device_connection_type;
- uint32_t device_handle;
+ transport_manager::DeviceHandle device_handle;
};
/**
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
index 5425777833..8be0372c03 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -797,7 +797,7 @@ void FillFunctionalGroupPermissions(
FunctionalGroupNames& names,
GroupConsent state,
std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs::const_iterator it = ids.begin();
FunctionalGroupIDs::const_iterator it_end = ids.end();
for (; it != it_end; ++it) {
@@ -817,7 +817,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) {
FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
const FunctionalGroupIDs& what) {
- LOG4CXX_INFO(logger_, "Exclude same groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs from_copy(from);
FunctionalGroupIDs what_copy(what);
@@ -839,7 +839,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Merge groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs first_copy(first);
FunctionalGroupIDs second_copy(second);
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index 806b7e13ba..433a7a6bca 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -313,7 +313,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
utils::SharedPtr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
- LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to create snapshot of policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
@@ -327,7 +330,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
// Replace current data with updated
if (!cache_->ApplyUpdate(*pt_update)) {
- LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table.");
+ LOG4CXX_WARN(
+ logger_,
+ "Unsuccessful save of updated policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
@@ -588,13 +594,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
policy_table::FunctionalGroupings functional_groupings;
cache_->GetFunctionalGroupings(functional_groupings);
-#ifdef SDL_REMOTE_CONTROL
- ApplicationOnDevice who = {device_id, app_id};
- const policy_table::Strings app_groups = access_remote_->GetGroups(who);
-#else // SDL_REMOTE_CONTROL
- const policy_table::Strings app_groups =
- GetGroupsNames(app_group_permissions);
-#endif // SDL_REMOTE_CONTROL
+ policy_table::Strings app_groups = GetGroupsNames(app_group_permissions);
// Undefined groups (without user consent) disallowed by default, since
// OnPermissionsChange notification has no "undefined" section
@@ -614,8 +614,19 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
<< " returns true");
}
+ if (cache_->IsApplicationRevoked(app_id)) {
+ // SDL must be able to notify mobile side with its status after app has
+ // been revoked by backend
+ if ("OnHMIStatus" == rpc && "NONE" == hmi_level) {
+ result.hmi_level_permitted = kRpcAllowed;
+ } else {
+ result.hmi_level_permitted = kRpcDisallowed;
+ }
+ return;
+ }
+
const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc);
- LOG4CXX_INFO(logger_, "Is known rpc " << known_rpc);
+ LOG4CXX_DEBUG(logger_, "Is known rpc " << (known_rpc ? "true" : "false"));
if (!known_rpc) {
// RPC not found in list == disallowed by backend
result.hmi_level_permitted = kRpcDisallowed;
@@ -637,6 +648,9 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find(
hmi_level)) {
// RPC found in allowed == allowed by backend, but disallowed by user
+ LOG4CXX_DEBUG(
+ logger_,
+ "RPC found in allowed == allowed by backend, but disallowed by user");
result.hmi_level_permitted = kRpcUserDisallowed;
} else {
LOG4CXX_DEBUG(logger_,
@@ -715,17 +729,6 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
LOG4CXX_DEBUG(logger_, "There are no parameters allowed.");
result.hmi_level_permitted = kRpcDisallowed;
}
-
- if (cache_->IsApplicationRevoked(app_id)) {
- // SDL must be able to notify mobile side with its status after app has
- // been revoked by backend
- if ("OnHMIStatus" == rpc && "NONE" == hmi_level) {
- result.hmi_level_permitted = kRpcAllowed;
- } else {
- result.hmi_level_permitted = kRpcDisallowed;
- }
- return;
- }
}
bool PolicyManagerImpl::ResetUserConsent() {
@@ -967,6 +970,7 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges(
void PolicyManagerImpl::NotifyPermissionsChanges(
const std::string& policy_app_id,
const std::vector<FunctionalGroupPermission>& app_group_permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
// Get current functional groups from DB with RPC permissions
policy_table::FunctionalGroupings functional_groups;
cache_->GetFunctionalGroupings(functional_groups);
@@ -986,11 +990,6 @@ void PolicyManagerImpl::SetUserConsentForApp(
const PermissionConsent& permissions, const NotificationMode mode) {
LOG4CXX_AUTO_TRACE(logger_);
- if (permissions.group_permissions.empty()) {
- LOG4CXX_DEBUG(logger_, "Permissions list is empty, skipping update.");
- return;
- }
-
cache_->ResetCalculatedPermissions();
PermissionConsent verified_permissions =
EnsureCorrectPermissionConsent(permissions);
@@ -1157,14 +1156,8 @@ void PolicyManagerImpl::GetPermissionsForApp(
FunctionalIdType group_types;
-#ifdef SDL_REMOTE_CONTROL
- allowed_by_default = false;
- const bool ret = access_remote_->GetPermissionsForApp(
- device_id, app_id_to_check, group_types);
-#else
const bool ret =
cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
-#endif // REMOTE_CONTROL
if (!ret) {
LOG4CXX_WARN(logger_,
@@ -1581,8 +1574,7 @@ void PolicyManagerImpl::OnUpdateStarted() {
uint32_t update_timeout = TimeoutExchangeMSec();
LOG4CXX_DEBUG(logger_,
"Update timeout will be set to (milisec): " << update_timeout);
- send_on_update_sent_out_ =
- !wrong_ptu_update_received_ && !update_status_manager_.IsUpdatePending();
+ send_on_update_sent_out_ = !update_status_manager_.IsUpdatePending();
if (send_on_update_sent_out_) {
update_status_manager_.OnUpdateSentOut(update_timeout);
diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc
index 4afce16885..9702c315b0 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -325,7 +325,7 @@ const std::string kCreateSchema =
"`consent_group.fk_consent_group_functional_group1_idx` "
" ON `consent_group`(`functional_group_id`); "
"CREATE TABLE IF NOT EXISTS `endpoint`( "
- " `service` INTEGER NOT NULL, "
+ " `service` VARCHAR(100) NOT NULL, "
" `url` VARCHAR(100) NOT NULL, "
" `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
" CONSTRAINT `fk_endpoint_application1` "
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index f9cc5e5ed5..4315d99b3a 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -559,10 +559,10 @@ void SQLPTRepresentation::GatherModuleConfig(
LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints");
} else {
while (endpoints.Next()) {
- std::stringstream stream;
- stream << "0x0" << endpoints.GetInteger(1);
- config->endpoints[stream.str()][endpoints.GetString(2)].push_back(
- endpoints.GetString(0));
+ const std::string& url = endpoints.GetString(0);
+ const std::string& service = endpoints.GetString(1);
+ const std::string& app_id = endpoints.GetString(2);
+ config->endpoints[service][app_id].push_back(url);
}
}
@@ -1262,11 +1262,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints(
const policy_table::URL& urls = app_it->second;
policy_table::URL::const_iterator url_it;
for (url_it = urls.begin(); url_it != urls.end(); ++url_it) {
- std::stringstream temp_stream(it->first);
- int service;
- temp_stream.seekg(3);
- temp_stream >> service;
- query.Bind(0, service);
+ query.Bind(0, it->first);
query.Bind(1, *url_it);
query.Bind(2, app_it->first);
if (!query.Exec() || !query.Reset()) {
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json
index 7316c7539d..c0f18bb6a9 100644
--- a/src/components/policy/policy_external/test/json/PTU.json
+++ b/src/components/policy/policy_external/test/json/PTU.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json
index c1a6bccb68..8ad6aefb83 100644
--- a/src/components/policy/policy_external/test/json/PTU2.json
+++ b/src/components/policy/policy_external/test/json/PTU2.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json
index 56939a789a..33f699d068 100644
--- a/src/components/policy/policy_external/test/json/PTU3.json
+++ b/src/components/policy/policy_external/test/json/PTU3.json
@@ -15,7 +15,7 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app.json b/src/components/policy/policy_external/test/json/PTU_default_app.json
index 833d46316a..b036d96b50 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -295,7 +295,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
index 1e5b1c46a4..49ed46f16c 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -293,7 +293,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
index 76365ee4bb..66af76309a 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -290,7 +290,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
index b380fa2de5..0a7c059097 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -289,7 +289,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
index b8793b6cdc..08f12a21c8 100644
--- a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -296,7 +296,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
index 833d46316a..b036d96b50 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -295,7 +295,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
index 8a183b45d5..6aeb637503 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -290,7 +290,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
index 6ffc42c3e4..8c68aaeb89 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -291,7 +291,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
index 24d0871d18..0ae0761f27 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -283,7 +283,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
index b674913268..6b170089fe 100644
--- a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -296,7 +296,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
index 7e0836a805..45e616c874 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1703,7 +1703,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
index a056c3ce9c..917d53177f 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1706,7 +1706,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
index c7e0a727fe..f514f279de 100644
--- a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
+++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1703,7 +1703,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
index a96ef74bd1..57c1bce8f1 100644
--- a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
+++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1702,7 +1702,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
index 4c1bf19005..20023ba8e5 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
index 02801cc976..5e4dffbc56 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
index a9abeea5a2..6b92db7c17 100644
--- a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json
index 899e58a68d..c12ec773e0 100644
--- a/src/components/policy/policy_external/test/json/ptu2_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json
@@ -16,12 +16,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -2594,7 +2594,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context" : false,
"steal_focus" : false,
"priority"
diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json
index a1f085ac74..0b1f0ed469 100644
--- a/src/components/policy/policy_external/test/json/ptu_requestType.json
+++ b/src/components/policy/policy_external/test/json/ptu_requestType.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -2553,7 +2553,7 @@
}
},
"app_policies": {
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
index d6f34c12fc..10894516cf 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
index 78c5f873d9..79d1b572e6 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
@@ -2385,11 +2385,11 @@
{
"0x04" :
{
- "default" : [ "http://ivsu.software.ford.com/api/getsoftwareupdates" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/softwareUpdate" ]
},
"0x07" :
{
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 20,
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
index 49f9a1da3a..1401c3b7a1 100644
--- a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
@@ -16,12 +16,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
index e6817da0d3..ac2b18ab6f 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1720,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
index d5f5f480f3..230ad1fa4f 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1720,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json
index 5047d832dd..4e2dd3a85c 100644
--- a/src/components/policy/policy_external/test/json/sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1704,7 +1704,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
index 18b0a09040..8a3ef897c5 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
index 3530c01388..dcb96f147b 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
index e169aea24a..dd7a529ec8 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
index df45a0be61..14eb11d195 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
index c471d6ec97..f1e460e603 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
index 29781d211c..0ba24ce484 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
index 91be06a561..6e8ce0c6a7 100644
--- a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
@@ -15,12 +15,12 @@
"endpoints": {
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
},
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
}
},
diff --git a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
index 56c728f104..c384ea73e2 100644
--- a/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1696,7 +1696,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index da0cd913b6..947bb5d3ad 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -574,8 +574,7 @@ TEST_F(PolicyManagerImplTest2, GetUpdateUrl) {
CreateLocalPT(preloaded_pt_filename_);
GetPTU(kValidSdlPtUpdateJson);
// Check expectations
- const std::string update_url(
- "http://policies.telematics.ford.com/api/policies");
+ const std::string update_url("http://x.x.x.x:3000/api/1/policies");
EXPECT_EQ(update_url, policy_manager_->GetUpdateUrl(7));
EXPECT_EQ("", policy_manager_->GetUpdateUrl(4));
}
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index 0608799535..48e86d24b7 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -238,8 +238,8 @@ void PolicyManagerImplTest::TearDown() {
// PolicyManagerImplTest2 class methods
PolicyManagerImplTest2::PolicyManagerImplTest2()
: app_id_1_("123456789")
- , app_id_2_("1766825573")
- , app_id_3_("584421907")
+ , app_id_2_("1010101010")
+ , app_id_3_("123454321")
, device_id_1_("XXX123456789ZZZ")
, device_id_2_("08-00-27-CE-76-FE")
, application_id_("1234")
@@ -629,7 +629,7 @@ PolicyManagerImplTest_RequestTypes::PolicyManagerImplTest_RequestTypes()
"PTU_pre_data_consent_app_one_invalid_value_RequestType_"
"array."
"json"}
- , kAppId("1766825573")
+ , kAppId("1010101010")
, kDefaultAppId(policy::kDefaultId)
, app_storage_folder_("storage3")
, preloaded_pt_filename_(kSdlPreloadedPtJson) {}
diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h
index 25aa126a03..af1d119e7a 100644
--- a/src/components/policy/policy_regular/include/policy/policy_types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -41,6 +41,8 @@
#include <utility>
#include "utils/shared_ptr.h"
#include "utils/helpers.h"
+#include "transport_manager/common.h"
+
namespace policy {
// TODO(PV): specify errors
@@ -190,7 +192,7 @@ struct DeviceParams {
std::string device_name;
std::string device_mac_address;
std::string device_connection_type;
- uint32_t device_handle;
+ transport_manager::DeviceHandle device_handle;
};
/**
diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
index 782a65f91a..95f275769c 100644
--- a/src/components/policy/policy_regular/src/policy_helper.cc
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -709,7 +709,7 @@ void FillFunctionalGroupPermissions(
FunctionalGroupNames& names,
GroupConsent state,
std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs::const_iterator it = ids.begin();
FunctionalGroupIDs::const_iterator it_end = ids.end();
for (; it != it_end; ++it) {
@@ -729,7 +729,7 @@ bool IsPredefinedApp(const AppPoliciesValueType& app) {
FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
const FunctionalGroupIDs& what) {
- LOG4CXX_INFO(logger_, "Exclude same groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs from_copy(from);
FunctionalGroupIDs what_copy(what);
@@ -751,7 +751,7 @@ FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Merge groups");
+ LOG4CXX_AUTO_TRACE(logger_);
FunctionalGroupIDs first_copy(first);
FunctionalGroupIDs second_copy(second);
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 055b57d985..3e08147a4c 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -196,7 +196,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
utils::SharedPtr<policy_table::Table> policy_table_snapshot =
cache_->GenerateSnapshot();
if (!policy_table_snapshot) {
- LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed to create snapshot of policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
@@ -209,7 +212,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
// Replace current data with updated
if (!cache_->ApplyUpdate(*pt_update)) {
- LOG4CXX_WARN(logger_, "Unsuccessful save of updated policy table.");
+ LOG4CXX_WARN(
+ logger_,
+ "Unsuccessful save of updated policy table, trying another exchange");
+ ForcePTExchange();
return false;
}
@@ -754,7 +760,7 @@ void PolicyManagerImpl::GetPermissionsForApp(
std::string& PolicyManagerImpl::GetCurrentDeviceId(
const std::string& policy_app_id) const {
- LOG4CXX_INFO(logger_, "GetDeviceInfo");
+ LOG4CXX_AUTO_TRACE(logger_);
last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
return last_device_id_;
}
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
index 6d663e9a0c..d9f70426d1 100644
--- a/src/components/policy/policy_regular/test/PTU.json
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 4062e94516..b4c3c0624c 100644
--- a/src/components/policy/policy_regular/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
index 78596189da..6309bd9cfd 100644
--- a/src/components/policy/policy_regular/test/PTU3.json
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -83,7 +83,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index ab4c2f8927..651a4cb2ef 100644
--- a/src/components/policy/policy_regular/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index f76e856cd0..5fd0a48f7c 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -181,7 +181,7 @@ class PolicyManagerImplTest2 : public ::testing::Test {
public:
PolicyManagerImplTest2()
: app_id1("123456789")
- , app_id2("1766825573")
+ , app_id2("1010101010")
, dev_id1("XXX123456789ZZZ")
, dev_id2("08-00-27-CE-76-FE")
, PTU_request_types(Json::arrayValue) {}
diff --git a/src/components/policy/policy_regular/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 50364397fd..e25095bb9f 100644
--- a/src/components/policy/policy_regular/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -2595,7 +2595,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index 44bd8356fe..c5aa6f0a6c 100644
--- a/src/components/policy/policy_regular/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
@@ -17,12 +17,12 @@
"endpoints": {
"0x07": {
"default": [
- "http://policies.telematics.ford.com/api/policies"
+ "http://x.x.x.x:3000/api/1/policies"
]
},
"0x04": {
"default": [
- "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ "http://x.x.x.x:3000/api/1/softwareUpdate"
]
}
},
@@ -2590,7 +2590,7 @@
"PROPRIETARY"
]
},
- "584421907": {
+ "123454321": {
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
index d6f34c12fc..10894516cf 100644
--- a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -14,7 +14,7 @@
625],
"endpoints": {
"0x07": {
- "default": ["http://policies.telematics.ford.com/api/policies"]
+ "default": ["http://x.x.x.x:3000/api/1/policies"]
}
},
"notifications_per_minute_by_priority": {
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
index e6817da0d3..ac2b18ab6f 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1720,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
index d5f5f480f3..230ad1fa4f 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1720,7 +1720,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index a332f92382..f890e8e5ae 100644
--- a/src/components/policy/policy_regular/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1698,7 +1698,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
index 56c728f104..c384ea73e2 100644
--- a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -1,7 +1,7 @@
{
"policy_table" : {
"app_policies" : {
- "1766825573" : {
+ "1010101010" : {
"AppHMIType" : [ "MEDIA" ],
"certificate" : "akdjfhaliuygrglurng",
"default_hmi" : "BACKGROUND",
@@ -1696,7 +1696,7 @@
},
"endpoints" : {
"0x07" : {
- "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ "default" : [ "http://x.x.x.x:3000/api/1/policies" ]
}
},
"exchange_after_x_days" : 30,
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index ebecff2402..ed3aaaf24c 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -42,7 +42,14 @@ set(PATHS
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-collect_sources(SOURCES "${PATHS}")
+
+if (ENABLE_SECURITY)
+ set(EXCLUDE_PATHS)
+else()
+ set(EXCLUDE_PATHS handshake_handler.cc)
+endif()
+
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
set(LIBRARIES
ProtocolLibrary
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index 47d546657f..762b986782 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -75,11 +75,11 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
,
#ifdef ENABLE_SECURITY
security_manager_(NULL)
+ , is_ptu_triggered_(false)
,
#endif // ENABLE_SECURITY
- is_ptu_triggered_(false)
- , raw_ford_messages_from_mobile_(
- "PH FromMobile", this, threads::ThreadOptions(kStackSize))
+ raw_ford_messages_from_mobile_(
+ "PH FromMobile", this, threads::ThreadOptions(kStackSize))
, raw_ford_messages_to_mobile_(
"PH ToMobile", this, threads::ThreadOptions(kStackSize))
, start_session_frame_map_lock_()
@@ -1252,13 +1252,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
logger_,
"Protocol version:" << static_cast<int>(packet.protocol_version()));
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
- const uint8_t protocol_version = packet.protocol_version();
#ifdef ENABLE_SECURITY
const bool protection =
- // Protocolo version 1 is not support protection
- (protocol_version > PROTOCOL_VERSION_1) ? packet.protection_flag()
- : false;
+ // Protocol version 1 is not support protection
+ (packet.protocol_version() > PROTOCOL_VERSION_1)
+ ? packet.protection_flag()
+ : false;
#else
const bool protection = false;
#endif // ENABLE_SECURITY
@@ -1274,7 +1274,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
<< static_cast<int32_t>(service_type) << " type.");
SendStartSessionNAck(connection_id,
packet.session_id(),
- protocol_version,
+ packet.protocol_version(),
packet.service_type());
return RESULT_OK;
}
@@ -1323,7 +1323,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
if (!rejectedParams.empty()) {
SendStartSessionNAck(connection_id,
packet.session_id(),
- protocol_version,
+ packet.protocol_version(),
packet.service_type(),
rejectedParams);
} else if (ssl_context->IsInitCompleted()) {
@@ -1383,7 +1383,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
std::string("protocolVersion"));
SendStartSessionNAck(connection_id,
packet.session_id(),
- protocol_version,
+ packet.protocol_version(),
packet.service_type(),
rejectedParams);
}
@@ -1408,7 +1408,6 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
logger_,
"Protocol version:" << static_cast<int>(packet->protocol_version()));
const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
- const uint8_t protocol_version = packet->protocol_version();
BsonObject bson_obj;
if (packet->data() != NULL) {
bson_obj = bson_object_from_bytes(packet->data());
@@ -1418,9 +1417,10 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
#ifdef ENABLE_SECURITY
const bool protection =
- // Protocolo version 1 is not support protection
- (protocol_version > PROTOCOL_VERSION_1) ? packet->protection_flag()
- : false;
+ // Protocol version 1 is not support protection
+ (packet->protocol_version() > PROTOCOL_VERSION_1)
+ ? packet->protection_flag()
+ : false;
#else
const bool protection = false;
#endif // ENABLE_SECURITY
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index cb11eca887..77de1705da 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -41,8 +41,10 @@
#include "protocol_handler/mock_protocol_handler_settings.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
+#ifdef ENABLE_SECURITY
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
+#endif // ENABLE_SECURITY
#include "transport_manager/mock_transport_manager.h"
#include "utils/make_shared.h"
#include "utils/test_async_waiter.h"
diff --git a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox b/src/components/security_manager/docs/SDL.SDD.Security.dox
index 42da2364d3..ba35bc116e 100644
--- a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
+++ b/src/components/security_manager/docs/SDL.SDD.Security.dox
@@ -32,12 +32,12 @@ deployment concepts, to accomplish their respective tasks without reliance on th
\anchor security_manager_rationale
## 1.1 Rationale
Security Manager implements SDL Architectural Solution according to:
-- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#security-manager
+- https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/components-view/#security-manager
\anchor security_manager_scope
## 1.2 Scope
Security Manager component extracted as a separate module for
-Ford channel data protection.
+SDL channel data protection.
This components is used to:
- Provide security communications
- Protect income and outcome business layer data from interception
@@ -100,30 +100,30 @@ protocol layer response on handshake procedure finish.
\anchor security_manager_class_structure
### 2.2 Class Structure
-The following UML class digram shows the component structure.
-![Security Manager class diagram](sm_class_digram.png)
-For more information about class digram follow:
+The following UML class diagram shows the component structure.
+![Security Manager class diagram](sm_class_diagram.png)
+For more information about class diagram follow:
- http://www.uml-diagrams.org/class-diagrams-overview.htqml
- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
\anchor security_manager_sequence_diagram
### 2.3 Sequence diagram
-The following UML sequence digram shows the component dynamic behavior.
-For more information about sequence digram follow:
+The following UML sequence diagram shows the component dynamic behavior.
+For more information about sequence diagram follow:
- http://www.uml-diagrams.org/sequence-diagrams.html
- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
Security first initialization on session:
-![Start encryption](sm_sequence_digram_init.png)
+![Start encryption](sm_sequence_diagram_init.png)
Security initialization for service on session with already initialized security:
-![Initialization](sm_sequence_digram_verify.png)
+![Initialization](sm_sequence_diagram_verify.png)
Decryption procedure:
-![Decryption](sm_sequence_digram_decryption.png)
+![Decryption](sm_sequence_diagram_decryption.png)
Encryption procedure:
-![Encryption](sm_sequence_digram_encryption.png)
+![Encryption](sm_sequence_diagram_encryption.png)
\anchor security_manager_state_chart
### 2.4 State chart diagram
@@ -215,7 +215,7 @@ data using OpenSSl API.
\page security_manager_references_and_history 5 References and history
\anchor security_manager_references
### 5.1 References
-- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
+- [Software Architecture Document](https://smartdevicelink.com/en/docs/sdl-core/master/software-architecture-document/table-of-contents/)
- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346)
- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246)
@@ -236,6 +236,6 @@ Document approve history
| | | | |
For more precise document change history follow github history -
-- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/security_manager_software_detailed_design.dox
-- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/security_manager_software_detailed_design.dox
+- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/SDL.SDD.Security.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/SDL.SDD.Security.dox
*/ \ No newline at end of file
diff --git a/src/components/security_manager/docs/assets/sm_class_digram.png b/src/components/security_manager/docs/assets/sm_class_diagram.png
index 61e300f4e7..61e300f4e7 100644
--- a/src/components/security_manager/docs/assets/sm_class_digram.png
+++ b/src/components/security_manager/docs/assets/sm_class_diagram.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png
index 849fe45b88..849fe45b88 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_decryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png
index 66dffd265e..66dffd265e 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_encryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png
index 334b42b258..334b42b258 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_init.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png
index cb040c918b..cb040c918b 100644
--- a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png
+++ b/src/components/security_manager/docs/assets/sm_sequence_diagram_verify.png
Binary files differ
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index 6bee28a976..2cc88c5966 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -137,8 +137,13 @@ bool CryptoManagerImpl::Init() {
#endif
switch (get_settings().security_manager_protocol_name()) {
case SSLv3:
+#ifdef OPENSSL_NO_SSL3
+ LOG4CXX_WARN(logger_, "OpenSSL does not support SSL3 protocol");
+ return false;
+#else
method = is_server ? SSLv3_server_method() : SSLv3_client_method();
break;
+#endif
case TLSv1:
method = is_server ? TLSv1_server_method() : TLSv1_client_method();
break;
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
index 5be5ff8363..0b30198f4c 100644
--- a/src/components/security_manager/src/ssl_context_impl.cc
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -280,7 +280,7 @@ bool CryptoManagerImpl::SSLContextImpl::WriteHandshakeData(
if (ret <= 0) {
is_handshake_pending_ = false;
ResetConnection();
- return Handshake_Result_AbnormalFail;
+ return false;
}
}
return true;
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index 945059e58c..a77cd98b27 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -228,7 +228,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
GetParam().server_ciphers_list);
const bool crypto_manager_initialization = crypto_manager->Init();
- EXPECT_TRUE(crypto_manager_initialization);
+ ASSERT_TRUE(crypto_manager_initialization);
mock_client_manager_settings_ = utils::MakeShared<
NiceMock<security_manager_test::MockCryptoManagerSettings> >();
@@ -241,7 +241,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
GetParam().client_ciphers_list);
const bool client_manager_initialization = client_manager->Init();
- EXPECT_TRUE(client_manager_initialization);
+ ASSERT_TRUE(client_manager_initialization);
server_ctx = crypto_manager->CreateSSLContext();
client_ctx = client_manager->CreateSSLContext();
@@ -261,9 +261,12 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
}
void TearDown() OVERRIDE {
- crypto_manager->ReleaseSSLContext(server_ctx);
- client_manager->ReleaseSSLContext(client_ctx);
-
+ if (crypto_manager) {
+ crypto_manager->ReleaseSSLContext(server_ctx);
+ }
+ if (client_manager) {
+ client_manager->ReleaseSSLContext(client_ctx);
+ }
delete crypto_manager;
delete client_manager;
}
@@ -303,10 +306,10 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
mock_crypto_manager_settings_;
utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
- security_manager::CryptoManager* crypto_manager;
- security_manager::CryptoManager* client_manager;
- security_manager::SSLContext* server_ctx;
- security_manager::SSLContext* client_ctx;
+ security_manager::CryptoManager* crypto_manager = NULL;
+ security_manager::CryptoManager* client_manager = NULL;
+ security_manager::SSLContext* server_ctx = NULL;
+ security_manager::SSLContext* client_ctx = NULL;
std::string certificate_data_base64_;
};
@@ -323,11 +326,15 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1_1,
kFordCipher,
- kFordCipher),
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
ProtocolAndCipher(security_manager::SSLv3,
security_manager::SSLv3,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
INSTANTIATE_TEST_CASE_P(
IncorrectProtocolAndCiphers,
@@ -336,18 +343,10 @@ INSTANTIATE_TEST_CASE_P(
security_manager::TLSv1_1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1,
- security_manager::SSLv3,
- kFordCipher,
- kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1,
kFordCipher,
kFordCipher),
- ProtocolAndCipher(security_manager::TLSv1_1,
- security_manager::SSLv3,
- kFordCipher,
- kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::TLSv1,
kFordCipher,
@@ -355,6 +354,16 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::TLSv1_1,
kFordCipher,
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
+ ProtocolAndCipher(security_manager::TLSv1,
+ security_manager::SSLv3,
+ kFordCipher,
+ kFordCipher),
+ ProtocolAndCipher(security_manager::TLSv1_1,
+ security_manager::SSLv3,
+ kFordCipher,
kFordCipher),
ProtocolAndCipher(security_manager::TLSv1_2,
security_manager::SSLv3,
@@ -367,7 +376,9 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::SSLv3,
security_manager::TLSv1_1,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
@@ -521,11 +532,15 @@ INSTANTIATE_TEST_CASE_P(
ProtocolAndCipher(security_manager::TLSv1_1,
security_manager::TLSv1_2,
kFordCipher,
- kFordCipher),
+ kFordCipher)
+#ifndef OPENSSL_NO_SSL3
+ ,
ProtocolAndCipher(security_manager::SSLv3,
security_manager::TLSv1_2,
kFordCipher,
- kFordCipher)));
+ kFordCipher)
+#endif
+ ));
TEST_P(SSLTestForTLS1_2, HandshakeFailed) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index 62a91ad1f3..62a090550d 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -71,17 +71,14 @@ int64_t file_system::FileSize(const std::string& path) {
size_t file_system::DirectorySize(const std::string& path) {
size_t size = 0;
- int32_t return_code = 0;
DIR* directory = NULL;
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
+
struct dirent* result = NULL;
struct stat file_info = {0};
directory = opendir(path.c_str());
if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
+ result = readdir(directory);
+ for (; NULL != result; result = readdir(directory)) {
if (0 == strcmp(result->d_name, "..") ||
0 == strcmp(result->d_name, ".")) {
continue;
@@ -229,19 +226,15 @@ bool file_system::DeleteFile(const std::string& name) {
}
void file_system::remove_directory_content(const std::string& directory_name) {
- int32_t return_code = 0;
DIR* directory = NULL;
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
struct dirent* result = NULL;
directory = opendir(directory_name.c_str());
if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
+ result = readdir(directory);
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
+ for (; NULL != result; result = readdir(directory)) {
if (0 == strcmp(result->d_name, "..") ||
0 == strcmp(result->d_name, ".")) {
continue;
@@ -295,18 +288,14 @@ std::vector<std::string> file_system::ListFiles(
return listFiles;
}
- int32_t return_code = 0;
DIR* directory = NULL;
- struct dirent dir_element_;
- struct dirent* dir_element = &dir_element_;
struct dirent* result = NULL;
directory = opendir(directory_name.c_str());
if (NULL != directory) {
- return_code = readdir_r(directory, dir_element, &result);
+ result = readdir(directory);
- for (; NULL != result && 0 == return_code;
- return_code = readdir_r(directory, dir_element, &result)) {
+ for (; NULL != result; result = readdir(directory)) {
if (0 == strcmp(result->d_name, "..") ||
0 == strcmp(result->d_name, ".")) {
continue;
diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql
index 292855734e..d588d695a6 100644
--- a/src/components/utils/test/policy.sql
+++ b/src/components/utils/test/policy.sql
@@ -263,7 +263,7 @@ BEGIN TRANSACTION;
CREATE INDEX IF NOT EXISTS `consent_group.fk_consent_group_functional_group1_idx`
ON `consent_group`(`functional_group_id`);
CREATE TABLE IF NOT EXISTS `endpoint`(
- `service` INTEGER NOT NULL,
+ `service` VARCHAR(100) NOT NULL,
`url` VARCHAR(100) NOT NULL,
`application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
CONSTRAINT `fk_endpoint_application1`