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

Add support for external encryption libraries #348

Merged
merged 59 commits into from Aug 2, 2016

Conversation

joeljfischer
Copy link
Contributor

@joeljfischer joeljfischer commented Feb 8, 2016

Fixes #345, 370

This PR is ready for review.

Risk

This PR makes minor API changes.

Testing Plan

Unit tests must be added for new public methods including the additions to the SDLStreamingMediaManager, SDLProtocol, and SDLProxy.

Summary

This PR adds the capability to hook in a security library to the SDL library. The library will take care of automatically instantiating an object based on the make passed alongside it matching the make of the vehicle connected through an RAI. The library must now also take and hold the app id to pass to the security library. The library defines a protocol that must be followed by the security library's public interface.

The Protocol object now has the ability to start a service with security enabled, which will enable the security (TLS) flow to begin and the Protocol will begin interacting with the security library and head unit to establish a secure connection.

The StreamingMediaManager object now has hooks to start up with encryption using the new start service with encryption methods.

Changelog

Enchancements
  • SDLProtocol can now set up a TLS session using an external security library
  • SDLProxy can now take an external security library objects and initialize one when a vehilce make associated with it connects.
  • SDLStreamingMediaManager can now set up authenticated and/or encrypted sessions of video and audio if available.
Bug Fixes
  • compressed property on SDLV2ProtocolHeader is now encrypted in line with updated SDL specs (not developer facing)

Tasks Remaining:

Unit tests
  • StreamingMediaManager
  • SDLProxy
  • SDLProtocol
Other
  • Allow more than one make to be associated with a security library (e.g. Ford & Lincoln).

@joeljfischer joeljfischer added this to the 4.X milestone Feb 8, 2016
* SDLProtocol & SDLAbstractProtocol new methods to start a service with encryption
* Update SecurityType protocol
* Proxy now holds a dictionary of security managers (kindof) and takes a vehicle make string to associate it with.
* After the Proxy has connected to a vehicle, the SDLProxy property `currentSecurityManager` will hold the correct security manager if available
* Adapt StreamingMediaManager to use new API
* SDLProtocolHeader now returns a `__kindof` header in its `headerForVersion:` method
* SDLProtocol & AbstractProtocol API additions and deprecations to account for encryption
* Move some methods around in SDLProtocol to fit into #pragma categories better
…rviceACK

* If the Security Lib encounters an error in TLS handshake, send an error to the module
Conflicts:
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Headers/DSL.h
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Headers/NMBExceptionCapture.h
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Headers/Nimble-Swift.h
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Headers/Nimble.h
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Info.plist
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/arm.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/arm.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/arm64.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/arm64.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/i386.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/i386.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/x86_64.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Modules/Nimble.swiftmodule/x86_64.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/Nimble
	SmartDeviceLink-iOS/Carthage/Build/iOS/Nimble.framework/_CodeSignature/CodeResources
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Headers/Quick-Swift.h
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Headers/Quick.h
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Info.plist
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/arm.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/arm.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/arm64.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/arm64.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/i386.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/i386.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/x86_64.swiftdoc
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Modules/Quick.swiftmodule/x86_64.swiftmodule
	SmartDeviceLink-iOS/Carthage/Build/iOS/Quick.framework/Quick
* Don't store the `connectedVehicleType` since we don't have to
@joeljfischer joeljfischer modified the milestones: 4.2, 4.X Apr 14, 2016
@joeljfischer joeljfischer changed the title [WIP] Add support for external encryption libraries Add support for external encryption libraries May 2, 2016
@joeljfischer
Copy link
Contributor Author

@mrapitis @asm09fsu Is this stable enough that it can be merged?

* Proxy now retrieves makes from the security manager class on the updated protocol method
@codecov-io
Copy link

codecov-io commented Jul 27, 2016

Current coverage is 67.92% (diff: 17.04%)

Merging #348 into develop will increase coverage by 38.73%

@@            develop       #348   diff @@
==========================================
  Files           289        289           
  Lines          9637       9815    +178   
  Methods        2643       2683     +40   
  Messages          0          0           
  Branches        632        663     +31   
==========================================
+ Hits           2813       6667   +3854   
+ Misses         6779       2839   -3940   
- Partials         45        309    +264   

Powered by Codecov. Last update ca91918...60858c8

asm09fsu and others added 8 commits July 28, 2016 11:05
…ecurity_support

* origin/develop: (22 commits)
  add id attribute to section headers for linking
  Add link to smartdevicelink.com to README
  Update for v4.1.4
  Fix not handling the TCP disconnect case
  Update README.md
  Update README.md
  Add documentation coverage badge to README
  Fix `.xctool-args` path to project
  Fix another codecov.yml issue
  Fix branch issue for codecov comments
  Basically just a bump to re-run tests
  Update for v4.1.3
  Add clean switch to generate-documentation.sh
  Update gen documentation script
  Add Jazzy theme, scripts, initial documentation, and an updated gitignore
  Update codecov yaml file comment and status settings
  Fix mis-spaced README file causing header issues
  Fix test script
  Add carthage before_deploy generating of archive
  Fix a badge in the README
  ...
# Conflicts:
#	SmartDeviceLink/SDLProxy.m
#	SmartDeviceLink/SDLStreamingMediaManager.h
#	SmartDeviceLink/SDLStreamingMediaManager.m
@asm09fsu asm09fsu merged commit 1eb39d3 into develop Aug 2, 2016
@joeljfischer joeljfischer deleted the feature/external_security_support branch August 3, 2016 13:07
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.

None yet

3 participants