summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/private/SDLProtocol.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/private/SDLProtocol.m')
-rw-r--r--SmartDeviceLink/private/SDLProtocol.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/SmartDeviceLink/private/SDLProtocol.m b/SmartDeviceLink/private/SDLProtocol.m
index 5f1b8302a..8f87bbdfb 100644
--- a/SmartDeviceLink/private/SDLProtocol.m
+++ b/SmartDeviceLink/private/SDLProtocol.m
@@ -397,6 +397,10 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
+/// Receives an array of `SDLProtocolMessage` and attempts to encrypt their payloads in place through the active security manager. If anything fails, it will return NO and pass back the error.
+/// @param protocolMessages The array of protocol messages to encrypt.
+/// @param error A passback error object if attempting to encrypt the protocol message payloads fails.
+/// @returns YES if the encryption was successful, NO if it was not
- (BOOL)sdl_encryptProtocolMessages:(NSArray<SDLProtocolMessage *> *)protocolMessages error:(NSError *__autoreleasing *)error {
for (SDLProtocolMessage *message in protocolMessages) {
if (message.header.frameType == SDLFrameTypeFirst) { continue; }
@@ -438,7 +442,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType {
- // We need to chunk encrypted data beneath the max TLS size
+ // Break up data larger than the max TLS size so the data can be encrypted by the security manager without failing due to the data size being too big
NSUInteger offset = 0;
do {
NSUInteger remainingDataLength = data.length - offset;