<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
	<header>
		<title>OTR Discovery</title>
		<abstract>
			This document provides a mechanism by which OTR encryption support can be
			discovered in XMPP, without relying on OTRs protocol agnostic discovery
			mechanism.
		</abstract>
		
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
		<number>0378</number>
		<status>Deferred</status>
		<type>Standards Track</type>
		<sig>Standards</sig>
		<approver>Council</approver>
		<dependencies>
			<spec>XMPP Core</spec>
			<spec>XEP-0030</spec>
		</dependencies>
		<supersedes/>
		<supersededby/>
		<shortname>OTR-DISCO</shortname>
		
  <author>
    <firstname>Sam</firstname>
    <surname>Whited</surname>
    <email>sam@samwhited.com</email>
    <jid>sam@samwhited.com</jid>
    <uri>https://blog.samwhited.com/</uri>
  </author>

  <revision>
    <version>0.1</version>
    <date>2017-09-11</date>
    <initials>XEP Editor (jwi)</initials>
    <remark>Defer due to lack of activity.</remark>
  </revision>
		<revision>
			<version>0.0.1</version>
			<date>2016-07-15</date>
			<initials>ssw</initials>
			<remark><p>Initial version approved by the Council.</p></remark>
		</revision>
	</header>
	<section1 topic="Introduction" anchor="intro">
		<p>
			The Off-the-Record messaging protocol (OTR) is widely layered on top of
			XMPP to provide end-to-end encryption. Current use of the protocol is
			described in <span class="ref"><link url="https://xmpp.org/extensions/xep-0364.html">Current Off-the-Record Messaging Usage (XEP-0364)</link></span> <note>XEP-0364: Current Off-the-Record Messaging Usage &lt;<link url="https://xmpp.org/extensions/xep-0364.html">https://xmpp.org/extensions/xep-0364.html</link>&gt;.</note>. OTR provides its own discovery mechanism in which
			it sends messages with special whitespace characters to indicate support.
			While this works when initializing a session, there is no way to query a
			client for support and to know in advance that a particular version of
			OTR is supported. This specification aims to solve that by providing an
			in-band mechanism for discovering OTR support in XMPP.
		</p>
		<p>
			It should be noted that newer, more secure encryption protocols exist for
			XMPP, and that new implementations of OTR are discouraged. This protocol
			is primarily intended to solve issues with existing implementations of
			OTR.
		</p>
	</section1>
	<section1 topic="Discovering support" anchor="disco">
		<p>
      If an entity supports OTR it MUST advertise the fact by returning a
      feature of 'urn:xmpp:otr:0' (see <link url="#registrar-versioning">Namespace Versioning</link> regarding the possibility of incrementing the version number) in response to a <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> information
      request. This indicates support for OTRv3 as defined by <span class="ref"><link url="https://otr.cypherpunks.ca/Protocol-v3-4.0.0.html">Off-the-Record Messaging Protocol version 3</link></span> <note>Off-the-Record Messaging Protocol (OTR) version 3 &lt;<link url="https://otr.cypherpunks.ca/Protocol-v3-4.0.0.html">https://otr.cypherpunks.ca/Protocol-v3-4.0.0.html</link>&gt; (Accessed 2015-08-30).</note>.
		</p>
    <example caption="Disco response"><![CDATA[
<feature var='urn:xmpp:otr:0' />]]></example>
		<p>
			If older versions of OTR are required, they may be discovered out of band
			using OTRs built in mechanism which is beyond the scope of this document.
		</p>
	</section1>
	<section1 topic="Security Considerations" anchor="security">
		<p>
			Because OTR support is advertised outside of any end-to-end encrypted
			stream, it may be subject to downgrade attacks (eg. the server operator
			may remove OTR from the features list).
		</p>
	</section1>
	<section1 topic="IANA Considerations" anchor="iana">
		<p>
			This document requires no interaction with the Internet Assigned Numbers
			Authority (IANA).
		</p>
	</section1>
<section1 topic="XMPP Registrar Considerations" anchor="registrar">
	<p>This specification defines the following XML namespaces:</p>
	<ul>
		<li>urn:xmpp:otr:0</li>
	</ul>
	<p>
		The <span class="ref"><link url="https://xmpp.org/registrar/">XMPP Registrar</link></span> <note>The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see &lt;<link url="https://xmpp.org/registrar/">https://xmpp.org/registrar/</link>&gt;.</note> shall include the foregoing namespaces in its disco
		features registry as defined in <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note>.
	</p>
	<code caption="Registry Submission"><![CDATA[
<var>
	<name>urn:xmpp:otr:0</name>
	<desc>Indicates support for Off-the-Record Messaging (OTR) version 3</desc>
	<doc>XEP-0378</doc>
</var>]]></code>
</section1>
</xep>
