Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pubsub Signing: Fix typos and wording #1244

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions inbox/pubsub-signing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@
<p>The design goals of this XEP are:</p>
<ul>
<li>it must be possible to sign plain text items as well as end-to-end encrypted items;</li>
<li>it must be backwards compatible: attaching a signature must work with existing specifications so that clients that do not support pubsub signatures can continue to work as usual;</li>
<li>it must be backwards compatible: attaching a signature must work with existing specifications such that clients that do not support pubsub signatures can continue to work as usual;</li>
<li>it must be possible to sign an item by several authors;</li>
<li>it should be possible to have different signers from the item publisher;</li>
<li>it should be possible to have signers different from the item publisher;</li>
</ul>
</section1>
<section1 topic='Overview' anchor='overview'>
<p>To sign a pubsub item, the signature and the signed data are separated. Signed data is a wrapper element comprising essential data such as signers, and the item to be signed. The wrapper element is then normalized, serialized and signed. The signature and additional data of the wrapper element are then publised as &xep0470;. In case of multiple signers, each signer publish their own signature as an attachment.</p>
<p>To verify a signature, the process is similiar: the receiving client builds the same wrapper element, normalize and serialize it, and uses it to validate the given signature(s).</p>
<p>To sign a pubsub item, the signature and the signed data are separated. Signed data is a wrapper element comprising essential data such as signers, and the item to be signed. The wrapper element is then normalized, serialized and signed. The signature and additional data of the wrapper element are then publised as &xep0470;. In case of multiple signers, each signer publishes their own signature as an attachment.</p>
<p>To verify a signature, the process is similiar: the receiving client builds the same wrapper element, normalizes and serializes it, and uses it to validate the given signature(s).</p>
</section1>

<section1 topic='Signing a Pubsub Item' anchor='signing'>
<p>To sign a pubsub item, a &lt;sign-data/&gt; wrapper element qualified by the 'urn:xmpp:pubsub-signature:0' namespace is created. This element MUST contain at least one 'to' element which MUST have a 'jid' attribute whose value is the intended recipient's XMPP address. The XMPP address found in the 'to' element's 'jid' attribute SHOULD be without Resourcepart (i.e., a bare JID).</p>
<p>The &lt;sign-data/&gt; element MUST contain exactly one &lt;time/&gt; element. The &lt;time/&gt; element MUST have a 'stamp' attribute which contains the timestamp of the moment when the element is being signed in the DateTime format as specified in &xep0082;</p>
<p>The &lt;sign-data/&gt; element MUST contain exactly one &lt;time/&gt; element. The &lt;time/&gt; element MUST have a 'stamp' attribute which contains the timestamp of the moment when the element is being signed in the DateTime format as specified in &xep0082;.</p>
<p>The &lt;sign-data/&gt; element MUST contain one or more &lt;signer/&gt; element(s) which MUST possess a 'jid' attribute whose value is the bare JID of the signer.</p>
<p>One or more external elements specified by signing profile MAY be added</p>
<p>One or more external elements specified by signing profile MAY be added.</p>
<p>The item to sign MUST be added as a child of the &lt;sign-data/&gt; element. If the wrapped &lt;item/&gt; element possesses a 'publisher' attribute, it MUST be removed when added to the wrapper element. As item ID can be added or modified by the Pubsub/PEP service, if the &lt;item/&gt; has an 'id' attribute, it MUST be removed too when added to the wrapper element, thus the item ID is not part of the signed data.</p>
<p>Then the resulting item is put to canonical form by applying <link url='https://www.w3.org/TR/xml-c14n2/'>C14N v2.0</link> specification.</p>
<p>Then the resulting item is transformed into canonical form by applying the canonicalization algorithm from the <link url='https://www.w3.org/TR/xml-c14n2/'>C14N v2.0</link> specification.</p>
<p>The resulting element in canonical form is then serialized and signed.</p>
<p>Below is an example of wrapper element:</p>
<example caption="Wrapper Element (Before Normalization)"><![CDATA[
Expand All @@ -105,11 +105,11 @@

<example caption="Wrapper Element (After Normalization)"><![CDATA[<sign-data><to jid="[email protected]"></to><time stamp="2022-10-16T18:39:03Z"></time><signer>[email protected]</signer><item><entry xmlns="http://www.w3.org/2005/Atom"><author><name>Juliet Capulet</name><uri>xmpp:[email protected]</uri></author><title type="text">She is so pretty!</title><published>2022-10-16T18:39:02Z</published></entry></item></sign-data>]]></example>

<p>The signature is then put as an &xep0470;. The attachment is a &lt;signature/&gt; element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. The attachment MUST contain the same &lt;time/&gt; and &lt;signer/&gt; elements in the same order as in the &lt;sign-data/&gt; element. If any signing profile extra elements have been used in &lt;sign-data/&gt;, they MUST be added too in the same order as in &lt;sign-data/&gt;. Then the signature is added in an element specified in the signing profile specification.</p>
<p>The signature is then put as an &xep0470;. The attachment is a &lt;signature/&gt; element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. The attachment MUST contain the same &lt;time/&gt; and &lt;signer/&gt; elements in the same order as in the &lt;sign-data/&gt; element. If any additional elements from the signing profile have been used in &lt;sign-data/&gt;, they MUST be added too in the same order as in &lt;sign-data/&gt;. Then the signature is added in an element specified in the signing profile specification.</p>
<p>Each signer entity MUST publish a &lt;signature/&gt; attachment signed with their own encryption keys.</p>
<p>If the pubsub item is encrypted, the signature MUST be done on the plain text version of the item <strong>before</strong> the encryption of the item. The &lt;signature/&gt; attachment SHOULD be encrypted too.</p>

<example caption="Juliet Publish Her Signature as an Attachment"><![CDATA[
<example caption="Juliet Publishes Her Signature as an Attachment"><![CDATA[
<iq from='[email protected]/chamber'
id='signature_1'
to='[email protected]'
Expand All @@ -131,7 +131,7 @@
</pubsub>
</iq>
]]></example>
<section2 topic='rationales' anchor='signing-rationales'>
<section2 topic='Rationales' anchor='signing-rationales'>
<p>The reason we use &xep0470; instead of directly signing the target item is that we need to be backwards compatible, so we cannot replace the target item with another element, nor is it possible to add a sibling element to item's payload (this would not be compliant with &xep0060; specification). This requires detaching the signature from the &lt;item/&gt; element itself, and &xep0470; are dedicated to attaching data to items, so a viable solution.</p>
</section2>

Expand Down Expand Up @@ -178,7 +178,7 @@
<section1 topic='Implementation Notes' anchor='impl'>
<p>The client validating signatures should display a message or indicator depending on the validation result:</p>
<ul>
<li>If one of the signatures doesn't validate, the client SHOULD display a prominent warning message explicitely stating that the signature is not validated and that the message is probably spoofed.</li>
<li>If one of the signatures doesn't validate, the client SHOULD display a prominent warning message explicitly stating that the signature is not validated and that the message is probably spoofed.</li>
<li>If the signature is validated but at least one of the signers's fingerprints is not trusted, the client SHOULD display a warning message stating that the signature is validated but unreliable, and that the message may be forged.</li>
<li>If all signatures are validated <strong>and</strong> all signers' fingerprints are trusted, the client SHOULD display an information message or indication that the item is signed by one or more trusted signers.</li>
</ul>
Expand Down Expand Up @@ -209,7 +209,7 @@

<section1 topic='Security Considerations' anchor='security'>
<p>Signature is intimely linked to the trust in the fingerprint of the encryption keys. A warning SHOULD be displayed by a client if a signature is valid but the signing entity's fingerprints are not trusted. Trust should be done through an external channel (outside of XMPP), preferably face-to-face.</p>
<p>Security considerations of the signing profile applies.</p>
<p>Security considerations of the signing profile apply.</p>
</section1>

<section1 topic='IANA Considerations' anchor='iana'>
Expand Down