-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
208 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import type { PeerId } from '@libp2p/interface-peer-id' | ||
import type { bytes } from './basic.js' | ||
import type { NoiseSession } from './handshake.js' | ||
import type { NoiseExtensions } from '../proto/payload.js' | ||
|
||
export interface IHandshake { | ||
session: NoiseSession | ||
remotePeer: PeerId | ||
remoteEarlyData: bytes | ||
remoteNoiseExtensions: NoiseExtensions | ||
encrypt: (plaintext: bytes, session: NoiseSession) => bytes | ||
decrypt: (ciphertext: bytes, session: NoiseSession) => {plaintext: bytes, valid: boolean} | ||
decrypt: (ciphertext: bytes, session: NoiseSession) => { plaintext: bytes, valid: boolean } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
syntax = "proto3"; | ||
package pb; | ||
syntax = "proto2"; | ||
|
||
message NoiseHandshakePayload { | ||
bytes identity_key = 1; | ||
bytes identity_sig = 2; | ||
bytes data = 3; | ||
message NoiseExtensions { | ||
repeated bytes webtransport_certhashes = 1; | ||
} | ||
|
||
message NoiseHandshakePayload { | ||
optional bytes identity_key = 1; | ||
optional bytes identity_sig = 2; | ||
optional bytes data = 3; | ||
optional NoiseExtensions extensions = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.