Skip to content

fix: ServerHello.key_share schema definition (SubRecord misuse)#476

Merged
dadrian merged 1 commit intozmap:masterfrom
UnaPibaGeek:fix/zschemas
Feb 18, 2026
Merged

fix: ServerHello.key_share schema definition (SubRecord misuse)#476
dadrian merged 1 commit intozmap:masterfrom
UnaPibaGeek:fix/zschemas

Conversation

@UnaPibaGeek
Copy link
Contributor

Summary

This PR fixes the schema definition of server_hello.key_share in zcrypto_schemas/zcrypto.py.

Technical Details

The current implementation defines it as: "key_share": SubRecord({ CurveID(...) }),.
However, SubRecord(...) expects a dictionary of named subfields. Passing a set-like literal results in a runtime error during schema import: AttributeError: 'set' object has no attribute 'items' (seen in zmap/zgrab2#672 integration tests).

This change replaces the incorrect SubRecord(...) usage with a direct CurveID(...) type: "key_share": CurveID(...).

CurveID already represents the correct structure for TLS NamedGroup values (hex, name, value). Since server_hello.key_share is a single negotiated group, it should use CurveID directly instead of being wrapped in SubRecord.

This bug currently causes zcrypto_schemas to fail at import time in Python (e.g., during zgrab2 integration tests).

Motivation

Attempt to fix the zmap/zgrab2#672 integration tests.

@dadrian dadrian merged commit 89b5f80 into zmap:master Feb 18, 2026
2 checks passed
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.

2 participants