-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPC Message Protection Implementation #1187
Conversation
- Add getter/setter for 'requireEncryption' field in PermissionItem and OnPermissionChange
… for app level and individual rpc accordingly.
…er trying to start a secured service.
…avor of a ISdlServiceListener
- Reset mRPCSecuredServiceStarted on service error, on service ended and during proxy dispose - Improve log info
Change method signature to getter and setter match
- Add comments, more unit tests and rename getter/setter method
… not a secured service.
- Add BaseEncryptionLifecycleManager
* develop_mainRepo: (262 commits) Fix error on FunctionID Update predefined window to be a enum Update the validations for the ONHMIStatus Update tests Change to int enum Validation of the manager on the onHMIStatus change to set it as Object as suggested Update checkLifecycleConfiguration logic fix failing tests removed more references to 'default' fix improper tab dont require Menu config params and remove defaults add some javadocs for migrating to newer SDL Versions fix tabulation and position change back to previous way revert last commit Add javadoc for scale, ppi and diagonalscreensize Dont allow user to modify scale value Call sendRPC method Fix documentation Fix indentation for Convert odd resolution to pair resolution. Deprecate old proxy classes ...
Move encryption related public methods back to encryption manager
Refractor to proper directory to match current structure of Managers
Create hook to lifecycle manager Add method to prepare message payload
* develop_mainRepo_local: (22 commits) Fixed unit test. Update VehicleDataTypeTests.java Update VehicleDataTypeTests.java Update VehicleDataType.java Update VehicleDataType.java Simplify if conditions LockScreenManager Address review comments fix review comments some of the fixes requested clarify javadocs merge variable declarations lock screen changes to match iOS Additional update for adding VEHICLEDATA_OEM_VEHICLE_DATA_TYPE in VehicleDataType as well as making oemCustomDataType as Non-Mandatory. Also, updating test cases. Fix some spacing issues Updating test cases for Generic Network Signal data Proposal changes. Fix #1102: add StreamingStateMachine transition and SdlRemoteDisplay condition Additional changes to method names as per revised proposal. Add ability to use TCP transport with new layers Make TCP write thread actually not on main thread Create TCPTransportManager ...
- Notify developer on encryption service status change - Check app level encryption in the other loop, in SdlProxyBase
* develop_mainRepo_local: fix bracket Fix per code review recommendations: remove unused imports and attempt to fix indentation. Fix function id to match mobile API spec. Removed unused import. Revert "Attempt a work-around to fix failed test suite on server." Attempt a work-around to fix failed test suite on server. Resolve more conflict. Merge new changes from develop branch Merge new changes from develop branch Add more unit tests Add unit tests for ReleaseInteriorVehicleDataModule and ReleaseInteriorVehicleDataModuleResponse Add unit tests for ReleaseInteriorVehicleDataModule and ReleaseInteriorVehicleDataModuleResponse Add test for GetInteriorVehicleDataConsentResponse Add unit tests for Grid, SeatLocation, GetInteriorVehicleDataConsent Fix comment in SystemCapabilityType Add unit tests for Grid, SeatLocation, GetInteriorVehicleDataConsent Fix comment in SystemCapabilityType Add unit tests for SeatLocationCapability Add tests for ModuleInfo Fix test cases, add more enum to enum tests and refractor functionId names. Add overridden methods onGetInteriorVehicleDataConsentResponse and onReleaseInteriorVehicleDataModuleResponse to ProxyBridge - handle new response msg for GetInteriorVehicleDataConsentResponse and ReleaseInteriorVehicleDataModuleResponse in SdlProxyBase - change hash keys in Grid and ModuleInfo - refractor method names and constants Multiple Module, 1st batch
…curity with encryption listener - In SdlProxyBase: also listen to HMI level when starting secured service, make call back to app on all statuses of service listener - Match method name changes for PermissionItem in JavaSE - In BasePermissionManager, also listen for HMI Level - Provide public method to start secured service in SdlManager - Provide public methods to check encryption requirement and requirement for individual RPC in both SdlManager and SdlProxyBase
…no secured service, notify the caller using the OnRPCResponseListener instead of propagating to SdlManager.
…hod return after the call back.
…service is not secured, also clear resources on dispose.
- Change logic to decide if encryption is needed base on new requirement - Decide on encryption when hmi level is not NONE, not only when FULL - Improve ISdlServiceListener logs - Improve readability when setting payload protection for message
* develop_mainRepo_local: (60 commits) fix is paused logic Make ChoiceSetManager operations blocking (#1155) handle case where TM is null in protocolbase add a null check to proxylistener fix thread lock issue notify iProxyListenerBase of service ending remove deprecation and add javadoc fix incorrect method logic add one more check allow videos to be stopped properly with secondary transport disconnection fix older video stream restarts Removed unused code Refactored Thread.currentThread().isInterrupted() Removed uneeded deprecated presentKeyboard() dismissKeyboard() now takes a nonnull Integer Attempting to fix spacing issue in tests Update base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java Update base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java Update base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java Update base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java ...
- Remove local rpc names set and use instance variable - startRPCEncryptionService method should be void type - Remove redundant empty rpc names set check in SdlProxyBase
Codecov Report
@@ Coverage Diff @@
## develop #1187 +/- ##
=============================================
- Coverage 47.36% 46.68% -0.69%
- Complexity 4323 4382 +59
=============================================
Files 481 481
Lines 23338 24090 +752
Branches 2648 2900 +252
=============================================
+ Hits 11055 11247 +192
- Misses 11604 12162 +558
- Partials 679 681 +2
Continue to review full report at Codecov.
|
@@ -2447,6 +2447,10 @@ public static boolean validatePermissionItem(PermissionItem item1, PermissionIte | |||
return false; | |||
} | |||
|
|||
if(item1.getRequireEncryption() != item2.getRequireEncryption()) { | |||
return false; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
* | ||
* @return true if encryption is required for app level; false otherwise | ||
*/ | ||
boolean getRequiresEncryption() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be private?
/** | ||
* Checks the current state and make the call back to initiate secured service flow | ||
*/ | ||
void checkStatusAndInitSecuredService() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be private?
Fixes #978 (based on PR #1103)
This PR is ready for review.
Risk
This PR makes minor API changes.
Testing Plan
Unit tests are added. Manual tests can be done by requiring some RPC to be encrypted in policy table.
Summary
This PR adds RPC encryption to Android and JavaSE libraries as described in the proposal.
CLA