summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLEncryptionLifecycleManager.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/SDLEncryptionLifecycleManager.m')
-rw-r--r--SmartDeviceLink/SDLEncryptionLifecycleManager.m14
1 files changed, 12 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLEncryptionLifecycleManager.m b/SmartDeviceLink/SDLEncryptionLifecycleManager.m
index 3d0589981..3f998c0db 100644
--- a/SmartDeviceLink/SDLEncryptionLifecycleManager.m
+++ b/SmartDeviceLink/SDLEncryptionLifecycleManager.m
@@ -88,8 +88,7 @@ NS_ASSUME_NONNULL_BEGIN
return;
}
- if (![self.currentHMILevel isEqualToEnum:SDLHMILevelNone]
- && (self.requiresEncryption || [self containsAtLeastOneRPCThatRequiresEncryption])) {
+ if (![self.currentHMILevel isEqualToEnum:SDLHMILevelNone] && [self appRequiresEncryption]) {
[self.encryptionStateMachine transitionToState:SDLEncryptionLifecycleManagerStateStarting];
} else {
SDLLogE(@"Encryption Manager is not ready to encrypt.");
@@ -233,6 +232,17 @@ NS_ASSUME_NONNULL_BEGIN
}
}
+- (BOOL)appRequiresEncryption {
+ if (self.requiresEncryption) {
+ return YES;
+ } else {
+ if ([self containsAtLeastOneRPCThatRequiresEncryption]) {
+ return YES;
+ }
+ }
+ return NO;
+}
+
- (BOOL)rpcRequiresEncryption:(__kindof SDLRPCMessage *)rpc {
if (self.permissions[rpc.name].requireEncryption != nil) {
return self.permissions[rpc.name].requireEncryption.boolValue;