mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-28 04:02:20 -05:00
ProtoXEP Pubsub Signing: version 0.0.2
- replaced "signatory" term with the more commonly used "signer" - added <to/> and <time/> elements (similar to XEP-0373)
This commit is contained in:
parent
03f89d8d7c
commit
72f6b99fc8
@ -30,6 +30,17 @@
|
|||||||
<email>goffi@goffi.org</email>
|
<email>goffi@goffi.org</email>
|
||||||
<jid>goffi@jabber.fr</jid>
|
<jid>goffi@jabber.fr</jid>
|
||||||
</author>
|
</author>
|
||||||
|
<revision>
|
||||||
|
<version>0.0.2</version>
|
||||||
|
<date>2022-10-20</date>
|
||||||
|
<initials>jp</initials>
|
||||||
|
<remark>
|
||||||
|
<ul>
|
||||||
|
<li>replaced "signatory" term with the more commonly used "signer"</li>
|
||||||
|
<li>added <to/> and <time/> elements (similar to XEP-0373)</li>
|
||||||
|
</ul>
|
||||||
|
</remark>
|
||||||
|
</revision>
|
||||||
<revision>
|
<revision>
|
||||||
<version>0.0.1</version>
|
<version>0.0.1</version>
|
||||||
<date>2022-10-17</date>
|
<date>2022-10-17</date>
|
||||||
@ -56,15 +67,18 @@
|
|||||||
<li>it must be possible to sign plain text items as well as end-to-end encrypted items;</li>
|
<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 so 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 must be possible to sign an item by several authors;</li>
|
||||||
<li>it should be possible to have different signatories from the item publisher;</li>
|
<li>it should be possible to have different signers from the item publisher;</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section1>
|
</section1>
|
||||||
<section1 topic='Overview' anchor='overview'>
|
<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 signatories, 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 signatories, each signatory publish their own signature as an attachment.</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 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 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>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Signing a Pubsub Item' anchor='signing'>
|
<section1 topic='Signing a Pubsub Item' anchor='signing'>
|
||||||
<p>To sign a pubsub item, a <sign-data/> wrapper element qualified by the 'urn:xmpp:pubsub-signature:0' namespace is created. This element MUST contain one or more <signatory/> element(s) which MUST possess a 'jid' attribute whose value is the bare JID of the signatory.</p>
|
<p>To sign a pubsub item, a <sign-data/> 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 <sign-data/> element MUST contain exactly one <time/> element. The <time/> 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 <sign-data/> element MUST contain one or more <signer/> 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 <sign-data/> element. If the wrapped <item/> 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 <item/> 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>The item to sign MUST be added as a child of the <sign-data/> element. If the wrapped <item/> 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 <item/> 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 put to canonical form by applying <link url='https://www.w3.org/TR/xml-c14n2/'>C14N v2.0</link> specification.</p>
|
||||||
@ -72,7 +86,9 @@
|
|||||||
<p>Below is an example of wrapper element:</p>
|
<p>Below is an example of wrapper element:</p>
|
||||||
<example caption="Wrapper Element (Before Normalization)"><![CDATA[
|
<example caption="Wrapper Element (Before Normalization)"><![CDATA[
|
||||||
<sign-data>
|
<sign-data>
|
||||||
<signatory>juliet@capulet.lit</signatory>
|
<to jid='juliet@capulet.lit' />
|
||||||
|
<time stamp='2022-10-16T18:39:03Z' />
|
||||||
|
<signer>juliet@capulet.lit</signer>
|
||||||
<item>
|
<item>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<author>
|
<author>
|
||||||
@ -87,10 +103,10 @@
|
|||||||
]]></example>
|
]]></example>
|
||||||
<p>The normalized form is as follow:</p>
|
<p>The normalized form is as follow:</p>
|
||||||
|
|
||||||
<example caption="Wrapper Element (After Normalization)"><![CDATA[<sign-data><signatory>juliet@capulet.lit</signatory><item><entry xmlns="http://www.w3.org/2005/Atom"><author><name>Juliet Capulet</name><uri>xmpp:juliet@capulet.lit</uri></author><title type="text">She is so pretty!</title><published>2022-10-16T18:39:02Z</published></entry></item></sign-data>]]></example>
|
<example caption="Wrapper Element (After Normalization)"><![CDATA[<sign-data><to jid="juliet@capulet.lit"></to><time stamp="2022-10-16T18:39:03Z"></time><signer>juliet@capulet.lit</signer><item><entry xmlns="http://www.w3.org/2005/Atom"><author><name>Juliet Capulet</name><uri>xmpp:juliet@capulet.lit</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 <signature/> element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. The attachment MUST contain the same <signatory/> element in the same order as in the <sign-data/> element. If any signing profile extra elements have been used in <sign-data/>, they MUST be added too in the same order as in <sign-data/>. 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 <signature/> element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. The attachment MUST contain the same <time/> and <signer/> elements in the same order as in the <sign-data/> element. If any signing profile extra elements have been used in <sign-data/>, they MUST be added too in the same order as in <sign-data/>. Then the signature is added in an element specified in the signing profile specification.</p>
|
||||||
<p>Each signatory entity MUST publish a <signature/> attachment signed with their own encryption keys.</p>
|
<p>Each signer entity MUST publish a <signature/> 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 <signature/> attachment SHOULD be encrypted too.</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 <signature/> attachment SHOULD be encrypted too.</p>
|
||||||
|
|
||||||
<example caption="Juliet Publish Her Signature as an Attachment"><![CDATA[
|
<example caption="Juliet Publish Her Signature as an Attachment"><![CDATA[
|
||||||
@ -103,7 +119,8 @@
|
|||||||
<item id='juliet@capulet.lit'>
|
<item id='juliet@capulet.lit'>
|
||||||
<attachments>
|
<attachments>
|
||||||
<signature xmlns='urn:xmpp:pubsub-signing:0' timestamp="2022-10-16T18:39:04Z">
|
<signature xmlns='urn:xmpp:pubsub-signing:0' timestamp="2022-10-16T18:39:04Z">
|
||||||
<signatory>juliet@capulet.lit</signatory>
|
<time stamp='2022-10-16T18:39:03Z' />
|
||||||
|
<signer>juliet@capulet.lit</signer>
|
||||||
<example-signature xmlns='https://example.org/signature'>
|
<example-signature xmlns='https://example.org/signature'>
|
||||||
<!-- SOME PAYLOAD -->
|
<!-- SOME PAYLOAD -->
|
||||||
</example-signature>
|
</example-signature>
|
||||||
@ -119,7 +136,7 @@
|
|||||||
</section2>
|
</section2>
|
||||||
|
|
||||||
<section2 topic='Summarizing' anchor='summarizing'>
|
<section2 topic='Summarizing' anchor='summarizing'>
|
||||||
<p>To summarize signatures as explained in &xep0470; the <signatory/> elements are grouped into a <signature/> element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. This allows a client to easily know that an item is signed, and to obtain the IDs of attachments that need to be retrieved to validate signatures.</p>
|
<p>To summarize signatures as explained in &xep0470; the <signer/> elements are grouped into a <signature/> element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. This allows a client to easily know that an item is signed, and to obtain the IDs of attachments that need to be retrieved to validate signatures.</p>
|
||||||
|
|
||||||
<example caption="Juliet Get Summary of Signatures of an Item"><![CDATA[
|
<example caption="Juliet Get Summary of Signatures of an Item"><![CDATA[
|
||||||
<iq from='juliet@capulet.lit'
|
<iq from='juliet@capulet.lit'
|
||||||
@ -133,8 +150,8 @@
|
|||||||
<!-- … -->
|
<!-- … -->
|
||||||
|
|
||||||
<signature xmlns='urn:xmpp:pubsub-signing:0' >
|
<signature xmlns='urn:xmpp:pubsub-signing:0' >
|
||||||
<signatory>juliet@capulet.lit</signatory>
|
<signer>juliet@capulet.lit</signer>
|
||||||
<signatory>romemo@montague.lit</signatory>
|
<signer>romemo@montague.lit</signer>
|
||||||
</signature>
|
</signature>
|
||||||
|
|
||||||
<!-- … -->
|
<!-- … -->
|
||||||
@ -146,24 +163,24 @@
|
|||||||
]]></example>
|
]]></example>
|
||||||
</section2>
|
</section2>
|
||||||
|
|
||||||
<section1 topic='Signature Validation' anchor='signature-validation'>
|
<section2 topic='Signature Validation' anchor='signature-validation'>
|
||||||
<p>Once one or more signatures have been found in an item attachment, a client SHOULD validate them. To do this, it builds a wrapper element with the target item as explained in <link url='#signing'>Signing a Pubsub Item</link>, and validate it with each signature. Validation mechanism depends of the signing profile.</p>
|
<p>Once one or more signatures have been found in an item attachment, a client SHOULD validate them. To do this, it builds a wrapper element with the target item as explained in <link url='#signing'>Signing a Pubsub Item</link>, and validate it with each signature. Validation mechanism depends of the signing profile.</p>
|
||||||
</section1>
|
</section2>
|
||||||
|
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Business Rules' anchor='rules'>
|
<section1 topic='Business Rules' anchor='rules'>
|
||||||
<p>C14N 2.0 defines <link url='https://www.w3.org/TR/xml-c14n2/#sec-Canonicalization-Parameters'>parameters</link> for the algorithm. For this specification, default values MUST be used, i.e. <em>IgnoreComments</em> is true, <em>TrimTextNodes</em> is true, <em>PrefixRewrite</em> is none, and <em>QNameAware</em> is the empty set. In other terms: there must be no comments, text nodes must be trimmed, prefixes are left unchanged, and no nodes must be processed as QName-valued.</p>
|
<p>C14N 2.0 defines <link url='https://www.w3.org/TR/xml-c14n2/#sec-Canonicalization-Parameters'>parameters</link> for the algorithm. For this specification, default values MUST be used, i.e. <em>IgnoreComments</em> is true, <em>TrimTextNodes</em> is true, <em>PrefixRewrite</em> is none, and <em>QNameAware</em> is the empty set. In other terms: there must be no comments, text nodes must be trimmed, prefixes are left unchanged, and no nodes must be processed as QName-valued.</p>
|
||||||
<p>Once the signature has been validated, it's the original item which MUST be used, as usual, not the normalized form. The original item has attributes missing from the normalized form ('published' and 'id' attribute), and spaces are trimmed, but they may be significant (e.g. in a dataform <value/>).</p>
|
<p>Once the signature has been validated, it's the original item which MUST be used, as usual, not the normalized form. The original item has attributes missing from the normalized form ('published' and 'id' attribute), and spaces are trimmed, but they may be significant (e.g. in a dataform <value/>).</p>
|
||||||
<p>It is essential to use the same <signatory/> and signing profile extra elements in the <signature/> element put in attachment and in wrapper <sign-data/> element used for signed data, as it is necessary for receiving client to re-build the wrapper element and then validate the signature.</p>
|
<p>It is essential to use the same <to/>, <time/>, <signer/> and signing profile extra elements in the <signature/> element put in attachment and in wrapper <sign-data/> element used for signed data, as it is necessary for receiving client to re-build the wrapper element and then validate the signature.</p>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
<section1 topic='Implementation Notes' anchor='impl'>
|
<section1 topic='Implementation Notes' anchor='impl'>
|
||||||
<p>The client validating signatures should display a message or indicator depending on the validation result:</p>
|
<p>The client validating signatures should display a message or indicator depending on the validation result:</p>
|
||||||
<ul>
|
<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 explicitely 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 signatories'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 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 signatories' fingerprints are trusted, the client SHOULD display an information message or indication that the item is signed by one or more trusted signatories.</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>
|
</ul>
|
||||||
</section1>
|
</section1>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user