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 IP-Secure tunnelling support #879

Merged
merged 37 commits into from Mar 28, 2022
Merged

Add IP-Secure tunnelling support #879

merged 37 commits into from Mar 28, 2022

Conversation

farmio
Copy link
Member

@farmio farmio commented Feb 28, 2022

Description

Add IP-Secure tunnelling support.

This is work in progress:

  • add necessary Frame parsers
  • add parsing and decryption of knxkeys files
  • verify knxkeys file with signature before using it
  • add SearchRequestExtended support to check for available tunnel users
  • add configuration options for needed parameters (passwords / keys / files)
  • add SecureSession class (between Interface and Transport)
  • SecureSession
    • properly initiate handshake and authentication
    • keep it alive
  • decrypt, verify and handle various encrypted KNXnet/IP frames
  • properly react to various SessionStatus indications
  • properly reconnect on lost TCP connection (bubble up connection_lost to Tunnel)
  • add tests... lots of tests

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • The documentation has been adjusted accordingly
  • The changes generate no new warnings
  • Tests have been added that prove the fix is effective or that the feature works
  • The changes are documented in the changelog
  • The Homeassistant plugin has been adjusted in case of new config options

@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #879 (5b19f24) into main (7542d97) will increase coverage by 0.11%.
The diff coverage is 95.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #879      +/-   ##
==========================================
+ Coverage   95.50%   95.61%   +0.11%     
==========================================
  Files         116      128      +12     
  Lines        7008     7670     +662     
==========================================
+ Hits         6693     7334     +641     
- Misses        315      336      +21     
Impacted Files Coverage Δ
xknx/exceptions/__init__.py 100.00% <ø> (ø)
xknx/io/transport/tcp_transport.py 46.03% <33.33%> (-1.34%) ⬇️
xknx/io/tunnel.py 75.84% <71.05%> (+1.62%) ⬆️
xknx/knxip/session_status.py 84.00% <84.00%> (ø)
xknx/io/connection.py 97.05% <90.90%> (-2.95%) ⬇️
xknx/knxip/session_authenticate.py 91.66% <91.66%> (ø)
xknx/knxip/session_request.py 92.00% <92.00%> (ø)
xknx/knxip/session_response.py 92.30% <92.30%> (ø)
xknx/io/secure_session.py 96.37% <96.37%> (ø)
xknx/knxip/secure_wrapper.py 97.14% <97.14%> (ø)
... and 17 more

@farmio farmio mentioned this pull request Feb 28, 2022
20 tasks
@farmio farmio marked this pull request as draft February 28, 2022 07:03
@farmio farmio marked this pull request as ready for review March 25, 2022 21:24
@marvin-w
Copy link
Member

Updates black in order to fix CI error: psf/black#2966

@marvin-w marvin-w merged commit c8dc469 into main Mar 28, 2022
@marvin-w marvin-w deleted the ip-secure branch March 28, 2022 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants