Skip to content

Commit

Permalink
Merge pull request #2057 from smartdevicelink/bugfix/issue-2049-secur…
Browse files Browse the repository at this point in the history
…ity-error-notifications-are-missing-error-description-and-code

Fixed missing error description/code in security notifications
  • Loading branch information
joeljfischer authored Nov 19, 2021
2 parents 312c588 + b2185ea commit 9c19083
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SmartDeviceLink/private/SDLProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,12 @@ + (SDLProtocolMessage *)sdl_serverSecurityFailedMessageWithClientMessageHeader:(
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];

Expand Down

0 comments on commit 9c19083

Please # to comment.