smartdevicelink / sdl_core

SmartDeviceLink In-Vehicle Software and Sample HMI
BSD 3-Clause "New" or "Revised" License
241 stars 244 forks source link

Core sends SendHandshakeData query with type NOTIFICATION #3755

Closed jacobkeeler closed 3 years ago

jacobkeeler commented 3 years ago

Bug Report

When SDL Core starts the handshake for an encrypted service, it sends a SendHandshakeData query with type 0x20 (NOTIFICATION). According to SDL-0317, this message is a request/response pair, and Core should send this message with the type 0x00 (REQUEST). In addition, Core always sends a value of 0 for the Sequential Number field, whereas it should send a different value for every request.

- const SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
+ const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
                                          SecurityQuery::SEND_HANDSHAKE_DATA,
                                          seq_number);
  // for client mode will be generated output data
  if (data != NULL && data_size != 0) {
-   SendHandshakeBinData(connection_key, data, data_size);
+   SendHandshakeBinData(connection_key, data, data_size, NextSequenceNumber());
  }
Reproduction Steps
  1. Active app attempts to start encrypted video service by sending Start Service (Video) with encrypted=true
Expected Behavior

Core sends SendHandshakeData security query with REQUEST type and a unique sequential number

Observed Behavior

Core sends SendHandshakeData security query with NOTIFICATION type and a sequential number of 0

OS & Version Information
jacobkeeler commented 3 years ago

Closed via #3761