summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2021-04-16 10:29:32 -0400
committerJoel Fischer <joeljfischer@gmail.com>2021-04-16 10:29:32 -0400
commit89152d813cc2fd4f874e537d799c8c026acd912c (patch)
tree1633fc97b44f7cc204efa6c9f916ab2161ea013d
parentd041ee1cc39c9022db6f123489bea820f8dfed4b (diff)
downloadsdl_ios-89152d813cc2fd4f874e537d799c8c026acd912c.tar.gz
Manager RPC requests check encryption is set up
-rw-r--r--SmartDeviceLink/private/SDLLifecycleManager.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/SmartDeviceLink/private/SDLLifecycleManager.m b/SmartDeviceLink/private/SDLLifecycleManager.m
index a349b35b5..c049a6be1 100644
--- a/SmartDeviceLink/private/SDLLifecycleManager.m
+++ b/SmartDeviceLink/private/SDLLifecycleManager.m
@@ -798,6 +798,15 @@ NSString *const BackgroundTaskTransportName = @"com.sdl.transport.backgroundTask
return;
}
+ if (request.isPayloadProtected && !self.encryptionLifecycleManager.isEncryptionReady) {
+ SDLLogW(@"Encryption Manager not ready, request not sent (%@)", request);
+ if (handler) {
+ handler(request, nil, [NSError sdl_encryption_lifecycle_notReadyError]);
+ }
+
+ return;
+ }
+
// Before we send a message, we have to check if we need to adapt the RPC. When adapting the RPC, there could be multiple RPCs that need to be sent.
NSError *error = nil;
NSArray<SDLRPCMessage *> *messages = [SDLLifecycleRPCAdapter adaptRPC:request direction:SDLRPCDirectionOutgoing];