1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-21 23:28:51 -05:00

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

View File

@ -370,14 +370,14 @@
<publish node='urn:xmpp:omemo:1:bundles'>
<item id='31415'>
<bundle xmlns='urn:xmpp:omemo:1'>
<spk id='0'>BASE64ENCODED</spk>
<spks>BASE64ENCODED</spks>
<ik>BASE64ENCODED</ik>
<spk id='0'>b64/encoded/data</spk>
<spks>b64/encoded/data</spks>
<ik>b64/encoded/data</ik>
<prekeys>
<pk id='0'>BASE64ENCODED</pk>
<pk id='1'>BASE64ENCODED</pk>
<pk id='0'>b64/encoded/data</pk>
<pk id='1'>b64/encoded/data</pk>
<!---->
<pk id='99'>BASE64ENCODED</pk>
<pk id='99'>b64/encoded/data</pk>
</prekeys>
</bundle>
</item>
@ -489,7 +489,7 @@
<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.
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.
</p>
<example caption="Sending a message"><![CDATA[
@ -497,16 +497,16 @@
<encrypted xmlns='urn:xmpp:omemo:1'>
<header sid='27183'>
<keys jid='juliet@capulet.lit'>
<key rid='31415'>BASE64ENCODED...</key>
<key rid='31415'>b64/encoded/data</key>
</keys>
<keys jid='romeo@montague.lit'>
<key rid='1337'>BASE64ENCODED...</key>
<key prekey="true" rid='12321'>BASE64ENCODED...</key>
<key rid='1337'>b64/encoded/data</key>
<key kex="true" rid='12321'>b64/encoded/data</key>
<!-- ... -->
</keys>
</header>
<payload>
-- MESSAGE-KEY-ENCRYPTED CONTENT ELEMENT --
base64/encoded/message/key/encrypted/content/element
</payload>
</encrypted>
<store xmlns='urn:xmpp:hints'/>
@ -567,17 +567,17 @@
<encrypted xmlns='urn:xmpp:omemo:1'>
<header sid='27183'>
<keys jid='juliet@capulet.lit'>
<key rid='31415'>BASE64ENCODED...</key>
<key rid='31415'>b64/encoded/data</key>
</keys>
<keys jid='romeo@montague.lit'>
<key rid='123' prekey='true'>BASE64ENCODED...</key>
<key rid='123' prekey='true'>b64/encoded/data</key>
</keys>
<keys jid='mercutio@verona.lit'>
<key rid='456' prekey='true'>BASE64ENCODED...</key>
<key rid='456' prekey='true'>b64/encoded/data</key>
</keys>
</header>
<payload>
-- MESSAGE-KEY-ENCRYPTED CONTENT ELEMENT --
base64/encoded/message/key/encrypted/content/element
</payload>
</encrypted>
<store xmlns='urn:xmpp:hints'/>
@ -627,57 +627,107 @@
</section1>
<section1 topic='XML Schema' anchor='schema'>
<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"
targetNamespace="eu.siacs.conversations.axolotl"
xmlns="eu.siacs.conversations.axolotl">
targetNamespace="urn:xmpp:omemo:1"
xmlns="urn:xmpp:omemo:1">
<xs:element name="encrypted">
<xs:element name="header">
<xs:attribute name="sid" type="xs:integer"/>
<xs:complexType>
<xs:sequence>
<xs:element name="key" type="xs:base64Binary" maxOccurs="unbounded">
<xs:attribute name="rid" type="xs:integer" use="required"/>
<xs:attribute name="prekey" type="xs:boolean"/>
</xs:element>
<xs:element name="iv" type="xs:base64Binary"/>
</xs:complexType>
<xs:element name="encrypted">
<xs:complexType>
<xs:all>
<xs:element ref="header"/>
<xs:element ref="payload"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="payload" type="xs:base64Binary" minOccurs="0"/>
</xs:element>
<xs:element name="list">
<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="payload" type="xs:base64Binary"/>
<xs:element name="bundle">
<xs:complexType>
<xs:sequence>
<xs:element name="signedPreKeyPublic" type="base64Binary">
<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:element name="header">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="keys"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:attribute name="sid" type="xs:unsignedInt"/>
</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>
]]></code>
</section1>