mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 22:46:52 +01:00
Make post-quantum handshakes hybrid only: drop ix_psk2_mlkem1024, need a v3 certificate, and leave a classical msg1 crossing a hybrid one unanswered
This commit is contained in:
1 parent
656164b259
commit
dff5c51dd6
18 files changed
+337
-609
No files matched your search
+2
-21
@@ -12,16 +12,13 @@ import (
|
||||
type msgFlags struct {
|
||||
expectsPayload bool // message carries indexes and time
|
||||
expectsCert bool // message carries the certificate
|
||||
kemKey bool // payload carries an ML-KEM encapsulation key
|
||||
kemCiphertext bool // message is prefixed with the ML-KEM ciphertext for the peer's key
|
||||
}
|
||||
|
||||
// subtypeInfo bundles the noise pattern with the per-message flags for a
|
||||
// given handshake subtype.
|
||||
type subtypeInfo struct {
|
||||
pattern noise.HandshakePattern
|
||||
pskPlacement int // noise psk modifier position, 0 means no psk token
|
||||
msgs []msgFlags
|
||||
pattern noise.HandshakePattern
|
||||
msgs []msgFlags
|
||||
|
||||
// kem is the KEM of a hybrid pattern, nil for any other. Hybrid patterns
|
||||
// carry composite static keys and need version 3 certificates on both
|
||||
@@ -41,22 +38,6 @@ var subtypeInfos = map[header.MessageSubType]subtypeInfo{
|
||||
},
|
||||
},
|
||||
|
||||
// IX with an ephemeral ML-KEM-1024 exchange:
|
||||
// msg1 (I->R): payload + cert + encapsulation key
|
||||
// msg2 (R->I): ciphertext || noise(payload + cert)
|
||||
// The responder encapsulates after reading msg1 and mixes the shared secret in
|
||||
// through the psk2 token at the end of msg2. The ciphertext travels outside the
|
||||
// noise message because the initiator needs the secret before it can process
|
||||
// that token.
|
||||
header.HandshakeIXPSK2MLKEM1024: {
|
||||
pattern: noise.HandshakeIX,
|
||||
pskPlacement: 2,
|
||||
msgs: []msgFlags{
|
||||
{expectsPayload: true, expectsCert: true, kemKey: true},
|
||||
{expectsPayload: true, expectsCert: true, kemCiphertext: true},
|
||||
},
|
||||
},
|
||||
|
||||
// Hybrid IX (github.com/DefinedNet/noise, see its PQ_RESEARCH.md):
|
||||
// msg1 (I->R): e, s payload + cert
|
||||
// msg2 (R->I): ekem, skem, e, ee, se, s, es payload + cert
|
||||
|
||||
Reference in new issue
Block a user