From 47f75b181372bf9952f9a8dc13158e3fcabe0a0e Mon Sep 17 00:00:00 2001 From: akwizgran Date: Fri, 24 Apr 2015 18:16:13 +0000 Subject: [PATCH] Blog signature must cover the client ID --- ForumClient.markdown | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ForumClient.markdown b/ForumClient.markdown index c6fbdd8..c3061bb 100644 --- a/ForumClient.markdown +++ b/ForumClient.markdown @@ -2,27 +2,26 @@ ForumClient is a [BSP client](BSP) that synchronises forum posts among groups of ### Channel identifiers -All forums share a single invitation channel with the following random identifier: -`667e 2acb da80 2e61 3168 98f2 8ec5 8102 fcf2 3d10 04ee 3086 f5e9 94d8 30f5 b773` - -Each forum also has its own channel with a [hash identifier](BSP#channel-identifiers). The client data structure for generating the identifier is a [BDF](BDF) list with two elements: `name` (string) and `salt` (raw). The random salt prevents collisions between forums with the same name. - -The client identifer is random: +ForumClient uses the following client identifer: `859a 7be5 0dca 035b 64bd 6902 fb79 7097 795a f837 abbf 8c16 d750 b3c2 ccc1 86ea` +Each forum has its own channel, and there is a single invitation channel shared by all forums. The [channel descriptor](BSP#channel-identifiers) for the invitation channel is an empty [BDF list](BDF). + +The channel descriptor for a forum channel is a list with two elements: `name` (string) and `salt` (raw). The salt is HASH_LEN random bytes. It prevents collisions between forums with the same name. + ### Message types -**0: INVITATION** - The content is a BDF list with two elements: `forum` (list) and `note` (string, may be null). `forum` is a list with two elements, `name` and `salt`, as described above. `note` is an optional note from the inviter to the invitee. +**0: INVITATION** - The content is a BDF list with three elements: `name` (string), `salt' (raw), and `note` (string or null). The channel identifier can be calculated from `name` and `salt`, as described above. `note` is an optional note from the inviter to the invitee. -**1: RESPONSE** - The content is a BDF list with three elements: `invitation_id` (raw), `decision` (boolean), and `note` (string, may be null). `invitation_id` is the identifier of an invitation created by the opposite peer. `decision` indicates whether the invitee wishes to subscribe. `note` is an optional note from the invitee to the inviter. +**1: RESPONSE** - The content is a BDF list with three elements: `invitation_id` (raw), `decision` (boolean), and `note` (string or null). `invitation_id` is the identifier of an invitation created by the opposite peer. `decision` indicates whether the invitee wishes to subscribe. `note` is an optional note from the invitee to the inviter. **2: DEPARTURE** - The content is a BDF list with one element: `invitation_id` (raw), which is the identifier of an invitation created by either peer. -**3: POST** - The content is a BDF list with three elements: `content` (list), `author` (list, may be null), and `signature` (raw, may be null). `content` is a list with three elements: `parent_id` (raw, may be null), `body` (string), and `attachments` (dictionary, may be null). If `parent_id` is not null, it is the identifier of a post to which this is a response. Each key in `attachments` is the name of an attachment, and the value is a list with two elements: `mime_type` (string) and `message_id` (raw). +**3: POST** - The content is a BDF list with two elements: `content` (list) and `author` (list or null), and `signature` (raw or null). `content` is a list with three elements: `parent_id` (raw or null), `body` (string), and `attachments` (dictionary or null). `parent_id` is the identifier of a post to which this is a response. Each key in `attachments` is the name of an attachment, and the value is a list with two elements: `mime_type` (string) and `message_id` (raw). If `author` is null, the post is anonymous and `signature` must also be null. Otherwise `author` is a list with two elements: `name` (string) and `public_key` (raw). -If `signature` is null, the post is anonymous and `author` must also be null. Otherwise `signature` is a signature with `public_key`, calculated over a list with five elements: `client_id` (raw), `forum` (list), `author` (list), `content` (list), and `timestamp` (int). `client_id` is the client identifier. `forum`, `author` and `content` are described above. `timestamp` is the timestamp from the [message header](BSP#message-format). +If `signature` is null, the post is anonymous and `author` must also be null. Otherwise `signature` is a signature over a list with four elements: `channel_id` (raw), `timestamp` (int), `author` (list), and `content` (list). `channel_id` and `timestamp` are taken from the [message header](BSP#message-format). `author` and `content` are described above. **4: ATTACHMENT** - The content is raw data.