Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDL 0317] Protocol Security Spec #1724

Merged
merged 17 commits into from
Sep 22, 2021
Merged

[SDL 0317] Protocol Security Spec #1724

merged 17 commits into from
Sep 22, 2021

Conversation

RHenigan
Copy link
Contributor

@RHenigan RHenigan commented Aug 4, 2021

Fixes #1720

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
  • I have tested Android, Java SE, and Java EE

Unit Tests

Add unit tests for new enum types

Core Tests

Test to verify Encryption still works, try sending an encrypted RPC from the test app.
To verify error logs work correctly update the ProtocolMessage to send junk data in BaseSdlSession.processControlService

protocolMessage.setData(new byte[iNumBytes + 12]);

This should trigger the error logs in processControlService here DebugTool.logError(TAG, "Client internal error: " + receivedHeader.getErrorCode().getName()); when core responds

Core version / branch / commit hash / module tested against: 7.1.1
HMI name / version / branch / commit hash / module tested against: Sdl Hmi

Summary

This PR updates the processControlService method of BaseSdlSession to correctly ready the Binary Security Header sent by core. Previously we would always call runHandshake regardless of what core sent. Now we want to only call runHandshake if the header recieved by core has an ID of SEND_HANDSHAKE_DATA and a type of NOTIFICATION or REQUEST.

CLA

@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #1724 (41d8407) into develop (470e703) will increase coverage by 0.09%.
The diff coverage is 65.28%.

❗ Current head 41d8407 differs from pull request most recent head b890c4e. Consider uploading reports for the commit b890c4e to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1724      +/-   ##
=============================================
+ Coverage      53.99%   54.09%   +0.09%     
- Complexity      5431     5467      +36     
=============================================
  Files            554      558       +4     
  Lines          25214    25398     +184     
  Branches        3278     3294      +16     
=============================================
+ Hits           13614    13738     +124     
- Misses         10381    10436      +55     
- Partials        1219     1224       +5     
Impacted Files Coverage Δ
...va/com/smartdevicelink/protocol/BaseSdlPacket.java 71.42% <0.00%> (-0.58%) ⬇️
.../com/smartdevicelink/protocol/ProtocolMessage.java 60.60% <0.00%> (-0.94%) ⬇️
.../com/smartdevicelink/protocol/SdlProtocolBase.java 15.75% <0.00%> (+0.05%) ⬆️
...va/com/smartdevicelink/session/BaseSdlSession.java 18.85% <0.00%> (-3.75%) ⬇️
...smartdevicelink/protocol/SecurityQueryPayload.java 69.35% <69.35%> (ø)
...martdevicelink/protocol/enums/SecurityQueryID.java 77.27% <77.27%> (ø)
...icelink/protocol/enums/SecurityQueryErrorCode.java 97.14% <97.14%> (ø)
...rtdevicelink/protocol/enums/SecurityQueryType.java 100.00% <100.00%> (ø)
...nk/managers/audio/AudioDecoderCompatOperation.java 75.00% <0.00%> (-4.55%) ⬇️
... and 3 more

@RHenigan RHenigan marked this pull request as ready for review August 13, 2021 13:05
Copy link
Contributor

@JulianKast JulianKast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor chages needed

Copy link
Contributor

@JulianKast JulianKast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one space needs to be added in a log statement

Robert Henigan and others added 2 commits September 3, 2021 09:36
@RHenigan RHenigan merged commit 9a2398f into develop Sep 22, 2021
@RHenigan RHenigan deleted the bugfix/issue_1720 branch September 22, 2021 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants