XEP-0384: update XML schema

This commit is contained in:
Marvin W 2020-03-08 17:27:47 +01:00
parent 11af6f0252
commit c7a29c7462
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
1 changed files with 109 additions and 59 deletions

View File

@ -370,14 +370,14 @@
<publish node='urn:xmpp:omemo:1:bundles'> <publish node='urn:xmpp:omemo:1:bundles'>
<item id='31415'> <item id='31415'>
<bundle xmlns='urn:xmpp:omemo:1'> <bundle xmlns='urn:xmpp:omemo:1'>
<spk id='0'>BASE64ENCODED</spk> <spk id='0'>b64/encoded/data</spk>
<spks>BASE64ENCODED</spks> <spks>b64/encoded/data</spks>
<ik>BASE64ENCODED</ik> <ik>b64/encoded/data</ik>
<prekeys> <prekeys>
<pk id='0'>BASE64ENCODED</pk> <pk id='0'>b64/encoded/data</pk>
<pk id='1'>BASE64ENCODED</pk> <pk id='1'>b64/encoded/data</pk>
<!----> <!---->
<pk id='99'>BASE64ENCODED</pk> <pk id='99'>b64/encoded/data</pk>
</prekeys> </prekeys>
</bundle> </bundle>
</item> </item>
@ -489,7 +489,7 @@
<p> <p>
An OMEMO encrypted message is specified to include an the &lt;encrypted&gt; element in the 'urn:xmpp:omomo:1' namespace. It always contains two child nodes, the &lt;header&gt; and the &payload; element. An OMEMO encrypted message is specified to include an the &lt;encrypted&gt; element in the 'urn:xmpp:omomo:1' namespace. It always contains two child nodes, the &lt;header&gt; and the &payload; element.
The &lt;header&gt; element has an attribute named 'sid' referencing the device id of the sending device and contains one or multiple &lt;keys&gt; elements, each with an attribute 'jid' of one recipient JID as well as one or multiple &lt;key&gt; elements. The &lt;header&gt; element has an attribute named 'sid' referencing the device id of the sending device and contains one or multiple &lt;keys&gt; elements, each with an attribute 'jid' of one recipient JID as well as one or multiple &lt;key&gt; elements.
A &lt;key&gt; element has an attribute named 'rid' referencing the device id of the recipient device. The ciphertext that is the key and HMAC encrypted using the long-standing OMEMO session for that recipient device is encoded using base64 and places as text content into the &lt;key&gt; element. A &lt;key&gt; element has an attribute named 'rid' referencing the device id of the recipient device, and an attribute named 'kex' which defaults to 'false' and indicates if the enclosed encrypted message includes a key exchange. The ciphertext that is the key and HMAC encrypted using the long-standing OMEMO session for that recipient device is encoded using base64 and places as text content into the &lt;key&gt; element.
The ciphertext that is the encrypted &content; element is encoded using base64 and placed as text content into the &payload; element. The ciphertext that is the encrypted &content; element is encoded using base64 and placed as text content into the &payload; element.
</p> </p>
<example caption="Sending a message"><![CDATA[ <example caption="Sending a message"><![CDATA[
@ -497,16 +497,16 @@
<encrypted xmlns='urn:xmpp:omemo:1'> <encrypted xmlns='urn:xmpp:omemo:1'>
<header sid='27183'> <header sid='27183'>
<keys jid='juliet@capulet.lit'> <keys jid='juliet@capulet.lit'>
<key rid='31415'>BASE64ENCODED...</key> <key rid='31415'>b64/encoded/data</key>
</keys> </keys>
<keys jid='romeo@montague.lit'> <keys jid='romeo@montague.lit'>
<key rid='1337'>BASE64ENCODED...</key> <key rid='1337'>b64/encoded/data</key>
<key prekey="true" rid='12321'>BASE64ENCODED...</key> <key kex="true" rid='12321'>b64/encoded/data</key>
<!-- ... --> <!-- ... -->
</keys> </keys>
</header> </header>
<payload> <payload>
-- MESSAGE-KEY-ENCRYPTED CONTENT ELEMENT -- base64/encoded/message/key/encrypted/content/element
</payload> </payload>
</encrypted> </encrypted>
<store xmlns='urn:xmpp:hints'/> <store xmlns='urn:xmpp:hints'/>
@ -567,17 +567,17 @@
<encrypted xmlns='urn:xmpp:omemo:1'> <encrypted xmlns='urn:xmpp:omemo:1'>
<header sid='27183'> <header sid='27183'>
<keys jid='juliet@capulet.lit'> <keys jid='juliet@capulet.lit'>
<key rid='31415'>BASE64ENCODED...</key> <key rid='31415'>b64/encoded/data</key>
</keys> </keys>
<keys jid='romeo@montague.lit'> <keys jid='romeo@montague.lit'>
<key rid='123' prekey='true'>BASE64ENCODED...</key> <key rid='123' prekey='true'>b64/encoded/data</key>
</keys> </keys>
<keys jid='mercutio@verona.lit'> <keys jid='mercutio@verona.lit'>
<key rid='456' prekey='true'>BASE64ENCODED...</key> <key rid='456' prekey='true'>b64/encoded/data</key>
</keys> </keys>
</header> </header>
<payload> <payload>
-- MESSAGE-KEY-ENCRYPTED CONTENT ELEMENT -- base64/encoded/message/key/encrypted/content/element
</payload> </payload>
</encrypted> </encrypted>
<store xmlns='urn:xmpp:hints'/> <store xmlns='urn:xmpp:hints'/>
@ -627,57 +627,107 @@
</section1> </section1>
<section1 topic='XML Schema' anchor='schema'> <section1 topic='XML Schema' anchor='schema'>
<code><![CDATA[ <code><![CDATA[
<xml version="1.0" encoding="utf8"> <?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="eu.siacs.conversations.axolotl" targetNamespace="urn:xmpp:omemo:1"
xmlns="eu.siacs.conversations.axolotl"> xmlns="urn:xmpp:omemo:1">
<xs:element name="encrypted"> <xs:element name="encrypted">
<xs:element name="header"> <xs:complexType>
<xs:attribute name="sid" type="xs:integer"/> <xs:all>
<xs:complexType> <xs:element ref="header"/>
<xs:sequence> <xs:element ref="payload"/>
<xs:element name="key" type="xs:base64Binary" maxOccurs="unbounded"> </xs:all>
<xs:attribute name="rid" type="xs:integer" use="required"/> </xs:complexType>
<xs:attribute name="prekey" type="xs:boolean"/>
</xs:element>
<xs:element name="iv" type="xs:base64Binary"/>
</xs:complexType>
</xs:element> </xs:element>
<xs:element name="payload" type="xs:base64Binary" minOccurs="0"/>
</xs:element>
<xs:element name="list"> <xs:element name="payload" type="xs:base64Binary"/>
<xs:complexType>
<xs:sequence>
<xs:element name="device" maxOccurs="unbounded">
<xs:attribute name="id" type="integer" use="required"/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="bundle"> <xs:element name="header">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence maxOccurs="unbounded">
<xs:element name="signedPreKeyPublic" type="base64Binary"> <xs:element ref="keys"/>
<xs:attribute name="signedPreKeyId" type="integer"/>
</xs:element>
<xs:element name="signedPreKeySignature" type="base64Binary"/>
<xs:element name="identityKey" type="base64Binary"/>
<xs:element name="prekeys">
<xs:complexType>
<xs:sequence>
<xs:element name="preKeyPublic" type="base64Binary" maxOccurs="unbounded">
<xs:attribute name="preKeyId" type="integer" use="required"/>
</xs:element>
</xs:sequence> </xs:sequence>
</xs:complexType> <xs:attribute name="sid" type="xs:unsignedInt"/>
</xs:element> </xs:complexType>
</xs:sequence> </xs:element>
</xs:complexType>
</xs:element>
<xs:element name="keys">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="key"/>
</xs:sequence>
<xs:attribute name="jid" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="key">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="rid" type="xs:unsignedInt" use="required"/>
<xs:attribute name="kex" type="xs:boolean" default="false"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="devices">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="device"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="device">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
<xs:attribute name="label" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="bundle">
<xs:complexType>
<xs:all>
<xs:element ref="spk"/>
<xs:element ref="spks"/>
<xs:element ref="ik"/>
<xs:element ref="prekeys"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="spk">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="spks" type="xs:base64Binary"/>
<xs:element name="ik" type="xs:base64Binary"/>
<xs:element name="prekeys">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="pk"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pk">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attribute name="id" type="xs:unsignedInt" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema> </xs:schema>
]]></code> ]]></code>
</section1> </section1>