diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2021-11-19 11:47:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 11:47:39 -0500 |
commit | 9c19083558f152a34648bcba70ce46dde7ddb2d0 (patch) | |
tree | d1bb377122a275bfe97aedae94dfd63f5daa507a | |
parent | 312c588441da000e4fe076148f8260354d59ed2c (diff) | |
parent | b2185eade15e045ad042a0d1742516155cd7d4ac (diff) | |
download | sdl_ios-9c19083558f152a34648bcba70ce46dde7ddb2d0.tar.gz |
Merge pull request #2057 from smartdevicelink/bugfix/issue-2049-security-error-notifications-are-missing-error-description-and-code
Fixed missing error description/code in security notifications
-rw-r--r-- | SmartDeviceLink/private/SDLProtocol.m | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/SmartDeviceLink/private/SDLProtocol.m b/SmartDeviceLink/private/SDLProtocol.m index 1ed2faf12..7ea872f18 100644 --- a/SmartDeviceLink/private/SDLProtocol.m +++ b/SmartDeviceLink/private/SDLProtocol.m @@ -868,7 +868,12 @@ NS_ASSUME_NONNULL_BEGIN serverMessageHeader.messageID = messageId; // For a control service packet, we need a binary header with a function ID corresponding to what type of packet we're sending. - SDLSecurityQueryPayload *serverTLSPayload = [[SDLSecurityQueryPayload alloc] initWithQueryType:SDLSecurityQueryTypeNotification queryID:SDLSecurityQueryIdSendInternalError sequenceNumber:0x00 jsonData:nil binaryData:nil]; + UInt8 errorCode = 0xFF; + NSDictionary *jsonDictionary = @{@"id" : @(errorCode), @"text" : [SDLSecurityQueryError convertErrorIdToStringEnum:@(errorCode)]}; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDictionary options:kNilOptions error:nil]; + + NSData *binaryDataPayload = [NSData dataWithBytes:&errorCode length:sizeof(errorCode)]; + SDLSecurityQueryPayload *serverTLSPayload = [[SDLSecurityQueryPayload alloc] initWithQueryType:SDLSecurityQueryTypeNotification queryID:SDLSecurityQueryIdSendInternalError sequenceNumber:0x00 jsonData:jsonData binaryData:binaryDataPayload]; NSData *binaryData = [serverTLSPayload convertToData]; |