From 7bee0bff0d9949e2e001934ab22cb8bd6a71be76 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 2 Sep 2011 01:56:02 -0700 Subject: [PATCH 1/3] protocol update, require a recipient encrypted envelope or it cannot be decrypted. --- zot.txt | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/zot.txt b/zot.txt index dd9f709826..4d3a6f6d00 100644 --- a/zot.txt +++ b/zot.txt @@ -1,7 +1,7 @@ This is the Zot! social communications protocol. Specification revision: 1 -01 September 2011 +02 September 2011 Mike Macgirvin This specification is public domain. @@ -14,6 +14,10 @@ makes use of webfinger and ActivityStreams and several concepts from RFC822 (email). Zot encompasses the zot delivery framework, and the zid remote access protocol. +The current specification revision (1) is frozen until a reference +implementation is available. After that, any protocol changes will require a +change to the revision number. + **************** * Zot delivery * **************** @@ -28,6 +32,8 @@ resolvable addresses containing both salmon and zot endpoints. ((key)) ((iv)) + ((env_key)) + ((env_iv)) ((envelope)) ((sender signature)) AES-256-CBC @@ -39,15 +45,33 @@ zot:key ******* A suitable randomly generated encyption key of length 32 octets for encrypting -the envelope and salmon packet. This is then encrypted with the sender's -private key and base64url encoded. +the salmon packet. This is then encrypted with the sender's private key and +base64url encoded. zot:iv ****** A suitable randomly generated initialisation vector of length 16 octets for -encrypting the envelope and salmon packet. This is then encrypted with the -sender's private key and base64url encoded. +encrypting the salmon packet. This is then encrypted with the sender's private +key and base64url encoded. + +zot:env_key +*********** + +A suitable randomly generated encyption key of length 32 octets for encrypting +the envelope. This is then encrypted with the recipient's public key and +base64url encoded. For bulk deliveries, it is encrypted with the site bulk +delivery public key. + + +zot:env_iv +********** + +A suitable randomly generated initialisation vector of length 16 octets for +encrypting the envelope. This is then encrypted with the recipient's public +key and base64url encoded. For bulk deliveries, it is encrypted with the site +bulk delivery public key. + zot:env ******* @@ -99,9 +123,8 @@ is a valid entry. A zot envelope is UTF-8 encoded, which differs from RFC822. The host component MUST be US-ASCII, with punycode translation of internationalised domain names applied. -The entire envelope is encrypted with alg using key and iv. Only AES-256-CBC -is defined as an algorithm in this specification. The encrypted envelope is -then base64url encoded for transmission. +The entire envelope is then encrypted using alg with env_key and env_iv and +base64url encoded for transmission. The zot envelope MAY include remote addresses. A zot delivery agent MUST parse all addresses and determine whether a delivery address to the current endpoint @@ -246,6 +269,7 @@ Only authentication via OpenID is defined in this version of the specification. This can be used to provide access control of any web resource to any webfinger identity on the internet. + ********* * Links * ********* From 93b9d713776bd18e9a3126f025a0c63c8589c201 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 2 Sep 2011 05:13:38 -0700 Subject: [PATCH 2/3] completely enclose ~f hashtags so they don't get hijacked by D* --- include/bb2diaspora.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 92f492116f..2eeea32cd7 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -58,7 +58,8 @@ function bb2diaspora($Text,$preserve_nl = false) { $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '[$1]($1)', $Text); - $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.*?)\[/url\])", '[$2]($1)', $Text); + $Text = preg_replace("/\#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/", '[#$2]($1)', $Text); + $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/", '[$2]($1)', $Text); // $Text = preg_replace("/\[img\](.*?)\[\/img\]/", t('Image/photo: ') . '$1', $Text); // $Text = preg_replace("/\[img\](.*?)\[\/img\]/", t('image/photo'), $Text); From 9e9b6a3dd1dd6f364ee0448a37bc0d3df71b2977 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 2 Sep 2011 05:46:00 -0700 Subject: [PATCH 3/3] zot: dealing with foreign messages --- zot.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/zot.txt b/zot.txt index 4d3a6f6d00..0704875af0 100644 --- a/zot.txt +++ b/zot.txt @@ -11,7 +11,7 @@ webfinger and encapsulating salmon. First read the salmon and salmon magic envelope specifications. Zot also makes use of webfinger and ActivityStreams and several concepts from RFC822 -(email). Zot encompasses the zot delivery framework, and the zid remote +(email). Zot encompasses the zot delivery framework and the zid remote access protocol. The current specification revision (1) is frozen until a reference @@ -25,7 +25,8 @@ change to the revision number. Format of a zot wrapper. This completely encapsulates a salmon magic envelope and provides privacy protection, while defining a delivery envelope - a concept familiar to email systems. All addresses in zot are webfinger -resolvable addresses containing both salmon and zot endpoints. +resolvable addresses containing zot endpoints and salmon public keys (zot +is a superset of salmon). @@ -220,6 +221,17 @@ embed alternate message formats and protocols such as "application/x-diaspora+xml". If a delivery agent is unable to provide any acceptable data format, the delivery MUST be terminated/cancelled. +Foreign Messages +**************** + +Messages MAY be imported from other networks and systems which have no +knowledge of salmon signatures. The salmon signature in this case MUST be the +exact string 'NOTSIGNED' to indicate that the author (From address) cannot be +validated using salmon verification. This message MUST be relayed by a Sender +who can provide a valid salmon signature of the message. Delivery systems MAY +reject foreign messages. + + ********************** * Zid authentication *