---
id: HSCP-T-025
titre: "Scan of the hybrid key exchange: every connection scanned, a dated decision for every refusal of hybrid"
titre_court: "Check the scan of the hybrid key exchange"
type: note
objet: test
langue: en
statut: brouillon
version: 0.1
verifie_le: 2026-12-05
traduit_de: LISEZ-MOI.md
traduit_de_version: 0.1
traduit_de_empreinte: 71b0df761726f6eb
traduction: modèle de langue, glossaire catalogue/glossaire-en.yaml
source: traduction de LISEZ-MOI.md, version 0.1
sensibilite: interne
licence: Apache-2.0
gestes: [HSCP-G-042]
recette: HSCP-R-040
piece: releve
---

# Scan of the hybrid key exchange: every connection scanned, a dated decision for every refusal of hybrid

## What the test checks

The evidence item is the scan of the negotiated key exchange, one line per connection (JSON Lines), incoming and outgoing. Every line carries:

| Field | Required | Meaning |
|---|---|---|
| `connexion` | yes | the connection: `host:port` of the exposed endpoint, or the name of its line in the inventory of encryption |
| `sens` | yes | `entrant` (incoming, the product receives the connection) or `sortant` (outgoing, the product opens it to a third party) |
| `autre_bout` | yes | who holds the other end: browsers, partners, model provider, sector authority |
| `hybride` | yes | `oui` (yes) if the hybrid key exchange was negotiated, otherwise `non` (no) |
| `decision` | for `non` | `date`, `motif` (reason), and an optional `action`: `mettre-a-jour` (update), `demander-une-date` (ask for a date) or `accepter` (accept) |
| `groupe` | no | negotiated key exchange group, for example `X25519MLKEM768` |

The test rejects:

- an unreadable line, a missing required field, a direction, a `hybride` value or an action outside the vocabulary;
- a `non` without a decision, a decision without a readable date, dated after the day of the check, or without a real reason.

With `--inventaire`, it also reads the inventory of encryption from recipe HSCP-R-019 (evidence item of test HSCP-T-006) and rejects a transit connection of the inventory (layer `circulation-externe` or `circulation-interne`) missing from the scan. The connection is matched by its `point` if it has one, otherwise by its `donnee`. A different direction between the two items is rejected too. A scanned connection that is not in the inventory is not rejected here: the inventory must carry it.

## Running the test

```sh
python3 verifier.py releve.jsonl --inventaire inventaire.jsonl --date 2026-12-05
```

Without `--date`, the test uses the current day. `--json` gives the same answer as JSON. Exit code: 0 evidence accepted, 1 evidence rejected, 2 incorrect call. Python 3.10 or later, no dependency, no network access.

## Producing the evidence

The test reads a scan produced elsewhere; it connects to nothing. For each connection, a command from a free software tool, with OpenSSL 3.5 or later, succeeds only if the other end accepts the hybrid key exchange:

```sh
openssl s_client -connect portail.exemple.test:443 -groups X25519MLKEM768 </dev/null
```

Run from outside towards an exposed endpoint, it gives the incoming side; run from the product's environment towards a third party, the outgoing side. The result for each connection is written as one line of the scan.

## Examples

- `exemples/valide/`: four connections. The portal negotiates hybrid; the partner interface, the AI model and a national service do not, each with its dated decision (update, date asked of the provider, authority's schedule accepted). The three transit connections of the inventory are scanned. Accepted on 05/12/2026.
- `exemples/refuse/`: a `non` without a decision, a `peut-être` (maybe) value, a decision without a readable date or a real reason, and the outgoing connection to the AI model, present in the inventory, missing from the scan. Rejected.

## What the test does not say

- It does not say whether the scan is accurate: it does not reconnect. An outgoing scan made from a workstation is not worth one made from the product's environment.
- It does not say whether a decision is the right one, nor whether the migration plan is in the right order: that is the review of the recipe.
- It does not see an intermediary that decrypts and re-encrypts: each segment is a connection to scan.
