Skip to content

Add channel binding support in SSPs#4723

Merged
gpotter2 merged 3 commits into
secdev:masterfrom
gpotter2:gss-cbt
Apr 21, 2025
Merged

Add channel binding support in SSPs#4723
gpotter2 merged 3 commits into
secdev:masterfrom
gpotter2:gss-cbt

Conversation

@gpotter2
Copy link
Copy Markdown
Member

@gpotter2 gpotter2 commented Apr 20, 2025

  • add support for 'channel binding' in KerberosSSP and NTLMSSP
  • use it in LDAP_Client when SSL
  • use it in HTTP_Client when SSL
  • check for CBT validity in the server side of KerberosSSP and NTLMSSP by default, with the ability to require it
  • add LDAPS test against openldap (seems like the CI has an old version or something... works on my machine)
  • add HTTPS test with CBT

Comment thread scapy/layers/ldap.py Dismissed
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2025

Codecov Report

Attention: Patch coverage is 69.07895% with 47 lines in your changes missing coverage. Please review.

Project coverage is 74.52%. Comparing base (d947ff1) to head (80ea29e).

Files with missing lines Patch % Lines
scapy/layers/ldap.py 8.33% 22 Missing ⚠️
scapy/layers/gssapi.py 78.26% 10 Missing ⚠️
scapy/layers/kerberos.py 77.41% 7 Missing ⚠️
scapy/layers/ntlm.py 77.27% 5 Missing ⚠️
scapy/layers/http.py 81.81% 2 Missing ⚠️
scapy/layers/spnego.py 90.90% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (d947ff1) and HEAD (80ea29e). Click for more details.

HEAD has 10 uploads less than BASE
Flag BASE (d947ff1) HEAD (80ea29e)
12 2
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4723      +/-   ##
==========================================
- Coverage   82.12%   74.52%   -7.60%     
==========================================
  Files         361      343      -18     
  Lines       87079    86881     -198     
==========================================
- Hits        71510    64746    -6764     
- Misses      15569    22135    +6566     
Files with missing lines Coverage Δ
scapy/layers/msrpce/msnrpc.py 68.33% <100.00%> (-0.11%) ⬇️
scapy/layers/msrpce/rpcclient.py 48.85% <ø> (-3.42%) ⬇️
scapy/layers/smb2.py 79.38% <ø> (-8.74%) ⬇️
scapy/layers/smbclient.py 48.48% <ø> (-25.48%) ⬇️
scapy/layers/tls/cert.py 38.89% <100.00%> (-47.16%) ⬇️
scapy/layers/spnego.py 77.84% <90.90%> (-0.36%) ⬇️
scapy/layers/http.py 83.06% <81.81%> (+1.69%) ⬆️
scapy/layers/ntlm.py 86.50% <77.27%> (-0.66%) ⬇️
scapy/layers/kerberos.py 61.33% <77.41%> (-0.16%) ⬇️
scapy/layers/gssapi.py 84.32% <78.26%> (-2.55%) ⬇️
... and 1 more

... and 273 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gpotter2 gpotter2 requested a review from Copilot April 21, 2025 10:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for channel binding in SSPs by propagating a new channel‐bindings parameter through the KerberosSSP, NTLMSSP, LDAP, HTTP and related modules. Key changes include:

  • Introducing new methods and parameters (e.g. token and chan_bindings) and replacing legacy “val” parameters across several SSP implementations.
  • Enhancing connection APIs (LDAP_Client.connect and HTTP_Server) to accept SSL options (sni, no_check_certificate) and to generate and propagate channel binding tokens.
  • Updating error codes and adding LDAPS/HTTPS tests to verify correct CBT handling.

Reviewed Changes

Copilot reviewed 11 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scapy/layers/tls/cert.py Added getSignatureHash() to compute signature hash based on CBT data.
scapy/layers/spnego.py Renamed parameters (val → token) and passed chan_bindings to SSP calls.
scapy/layers/ntlm.py Updated NTLMSSP functions to use token and channel binding support.
scapy/layers/ldap.py Extended connect() API with new SSL options and integrated CBT usage.
scapy/layers/kerberos.py Updated KerberosSSP methods to accept token and chan_bindings parameters.
scapy/layers/http.py Enhanced HTTP_Client/Server to compute and apply channel binding tokens.
Files not reviewed (8)
  • .config/ci/install.sh: Language not supported
  • .config/ci/openldap-testdata.ldif: Language not supported
  • .config/ci/openldap/config.ldif: Language not supported
  • .config/ci/openldap/install.sh: Language not supported
  • .config/ci/openldap/testdata.ldif: Language not supported
  • doc/scapy/layers/kerberos.rst: Language not supported
  • test/scapy/layers/http.uts: Language not supported
  • test/scapy/layers/ldapopenldap.uts: Language not supported
Comments suppressed due to low confidence (1)

scapy/layers/ldap.py:1815

  • Update the docstring of the connect() method to describe the new parameters 'sni' and 'no_check_certificate' to improve clarity for future maintenance.
def connect(

Comment thread scapy/layers/tls/cert.py
@gpotter2 gpotter2 marked this pull request as ready for review April 21, 2025 21:39
@gpotter2 gpotter2 merged commit f8f35a6 into secdev:master Apr 21, 2025
22 of 23 checks passed
@gpotter2 gpotter2 deleted the gss-cbt branch April 21, 2025 21:43
alxroyer-thales pushed a commit to ThalesGroup/scapy that referenced this pull request Jun 27, 2025
* Implement channel bindings

* Hotpatch kerberos doc. More to come later

* Try to fix LDAP test
@gpotter2 gpotter2 added this to the 2.7.0 milestone Nov 2, 2025
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