From c5bc23fbd5676fb4920535f8d22574286ad707b5 Mon Sep 17 00:00:00 2001 From: Frank Elias Date: Fri, 22 Oct 2021 10:16:17 -0400 Subject: [PATCH 1/2] check added in sdl_processSecurityMessage --- SmartDeviceLink/private/SDLProtocol.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLink/private/SDLProtocol.m b/SmartDeviceLink/private/SDLProtocol.m index f2ef868c5..7a2f54f1b 100644 --- a/SmartDeviceLink/private/SDLProtocol.m +++ b/SmartDeviceLink/private/SDLProtocol.m @@ -825,7 +825,7 @@ - (void)sdl_processSecurityMessage:(SDLProtocolMessage *)clientHandshakeMessage // If the handshake went bad and the security library ain't happy, send over the failure to the module. This should result in an ACK with encryption off. SDLProtocolMessage *serverSecurityMessage = nil; - if (serverHandshakeData == nil) { + if (serverHandshakeData == nil || serverHandshakeData.length == 0) { SDLLogE(@"Error running TLS handshake procedure. Sending error to module. Error: %@", handshakeError); serverSecurityMessage = [self.class sdl_serverSecurityFailedMessageWithClientMessageHeader:clientHandshakeMessage.header messageId:++_messageID]; From de4c6e056e26bc61fc551e6b1e15c23a7d892389 Mon Sep 17 00:00:00 2001 From: Frank Elias <69520919+FrankElias77@users.noreply.github.com> Date: Fri, 22 Oct 2021 16:01:41 -0400 Subject: [PATCH 2/2] Update SmartDeviceLink/private/SDLProtocol.m Co-authored-by: Joel Fischer --- SmartDeviceLink/private/SDLProtocol.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLink/private/SDLProtocol.m b/SmartDeviceLink/private/SDLProtocol.m index 7a2f54f1b..1ed2faf12 100644 --- a/SmartDeviceLink/private/SDLProtocol.m +++ b/SmartDeviceLink/private/SDLProtocol.m @@ -825,7 +825,7 @@ - (void)sdl_processSecurityMessage:(SDLProtocolMessage *)clientHandshakeMessage // If the handshake went bad and the security library ain't happy, send over the failure to the module. This should result in an ACK with encryption off. SDLProtocolMessage *serverSecurityMessage = nil; - if (serverHandshakeData == nil || serverHandshakeData.length == 0) { + if (serverHandshakeData.length == 0) { SDLLogE(@"Error running TLS handshake procedure. Sending error to module. Error: %@", handshakeError); serverSecurityMessage = [self.class sdl_serverSecurityFailedMessageWithClientMessageHeader:clientHandshakeMessage.header messageId:++_messageID];