pawsd:protocol
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| pawsd:protocol [2026/02/07 19:54] – created winter | pawsd:protocol [2026/02/11 18:07] (current) – [Zones, services and records] flags bitfield description winter | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| - | The PawSD protocol is designed around a simple request-response architecture that allows it to work over a variety of underlying transports. All a transport has to provide is a way for a client to send some bytes to a server and for the server to send some bytes back in response. | + | The PawSD protocol is designed around a simple request-response architecture that allows it to work over a variety of underlying |
| Unless otherwise specified, the protocol uses big-endian byte and bit order, and no padding. | Unless otherwise specified, the protocol uses big-endian byte and bit order, and no padding. | ||
| Line 61: | Line 61: | ||
| The signature is calculated from the concatenation of the index, flags, record count, and records fields (i.e. the entire service in wire format except for the signature itself). The signature algorithm is not given in the service itself but will be specified as part of the service' | The signature is calculated from the concatenation of the index, flags, record count, and records fields (i.e. the entire service in wire format except for the signature itself). The signature algorithm is not given in the service itself but will be specified as part of the service' | ||
| + | |||
| + | The " | ||
| Records are just a list of tag-value pairs: | Records are just a list of tag-value pairs: | ||
| Line 96: | Line 98: | ||
| | public key | varies | | public key | varies | ||
| | service index | 2 bytes | u16 | | | service index | 2 bytes | u16 | | ||
| + | |||
| + | Design note: although the length of the public key is implicitly given by the key type field (e.g. an ed25519 key will always be 32 bytes long), we still explicitly state its length, so that implementations that don't support a given key type can still parse the request properly, even if just to show a more useful error message. | ||
| Response payload: | Response payload: | ||
| Line 106: | Line 110: | ||
| </ | </ | ||
| + | |||
| + | ===== Verb 4096 (0x1000): Start authentication ===== | ||
| + | |||
| + | The client briefly identifies itself using a " | ||
| + | |||
| + | Request payload: | ||
| + | |||
| + | ^ Field ^ Length | ||
| + | | client ID | 16 bytes | [16]u8 | ||
| + | | scopes | ||
| + | |||
| + | The server then returns either a " | ||
| + | |||
| + | ^ Field ^ Length | ||
| + | | completed? | ||
| + | | token or challenges | ||
| + | |||
| + | If " | ||
| + | |||
| + | ^ Field ^ Length | ||
| + | | conjunction | ||
| + | | challenge count | 1 byte | u8 (≥ 1) | | ||
| + | | challenge< | ||
| + | | challenge< | ||
| + | | challenge< | ||
| + | | // | ||
| + | |||
| + | If the conjunction is " | ||
| + | |||
| + | |||
| + | ==== Challenges ==== | ||
| + | |||
| + | The structure of the " | ||
| + | |||
| + | |||
| + | ===== Verb 4097 (0x1001): Continue authentication ===== | ||
| + | |||
| + | The client sends one or multiple responses to challenges previously given by the server. (Note confusing terminology: | ||
| + | |||
| + | Request payload: | ||
| + | |||
| + | ^ Field ^ Length | ||
| + | | client ID | 16 bytes | [16]u8 | ||
| + | | response count | 1 byte | u8 | | ||
| + | | challenge< | ||
| + | | response< | ||
| + | | response< | ||
| + | | // | ||
| + | |||
| + | The response payload is identical to the //Start authentication// | ||
pawsd/protocol.1770494051.txt.gz · Last modified: by winter
