Unverified Commit 43ed695d authored by Sofia Celi's avatar Sofia Celi

Remove several Prekey Profiles

parent 5d5f80ba
......@@ -533,11 +533,11 @@ Alice will be initiating the DAKEZ with the Prekey Server:
`prekey_mac_k = KDF(usagePreMACKey, SK, 64)`.
* Computes the `Prekey MAC` (notice that most of these values are from the
received "Prekey Publication message"):
* If a Client Profile and Prekey Profiles are present in the message:
* If a Client Profile and Prekey Profile are present in the message:
`KDF(usagePreMAC, prekey_mac_k || message type || N ||
KDF(usagePrekeyMessage, Prekey Messages, 64) || K ||
KDF(usageClientProfile, Client Profile, 64) || J ||
KDF(usagePrekeyProfile, Prekey Profiles, 64))`.
KDF(usagePrekeyProfile, Prekey Profile, 64))`.
* If only Prekey Messages are present in the message:
* Calculate `KDF(usagePreMAC, prekey_mac_k || message type || N ||
KDF(usagePrekeyMessage, Prekey Messages, 64) || K || J, 64)`. `J`
......@@ -551,11 +551,10 @@ Alice will be initiating the DAKEZ with the Prekey Server:
* Checks that `K` is set to 1. If it is not, aborts the DAKE and sends
a "Failure message", as defined in the [Failure Message](#failure-message)
section.
* If Prekey profiles are present in the message:
* Checks that `J` corresponds to the number of concatenated Prekey
Profiles. If it is not, aborts the DAKE and sends a
"Failure message", as defined in the
[Failure Message](#failure-message) section.
* If a Prekey Profiles is present in the message:
* Checks that `J` is set to 1. If it is not, aborts the DAKE and sends
a "Failure message", as defined in the [Failure Message](#failure-message)
section.
* If Prekey Messages are present in the message:
* Checks that `N` corresponds to the number of concatenated Prekey
Messages. If it is not, aborts the DAKE and sends a
......@@ -563,7 +562,7 @@ Alice will be initiating the DAKEZ with the Prekey Server:
[Failure Message](#failure-message) section.
* Checks that `J` and `K` are set to zero, if Prekey Messages are only
present.
* Stores the Client Profile, each Prekey Profile and Prekey Message if is
* Stores the Client Profile, the Prekey Profile and Prekey Message if is
possible in the Prekey Server's storage. If not, aborts the DAKE and
sends a "Failure message" as defined in the
[Failure Message](#failure-message) section.
......@@ -814,17 +813,17 @@ This is the message sent when you want to store/publish Prekey Ensembles to the
Prekey Server. This message can contain these three entities:
- Client Profile
- Prekey Profiles
- Prekey Profile
- Prekey Messages
Client Profile and Prekey Profiles are included in this message when none have
Client Profile and Prekey Profile are included in this message when none have
been published before to the Prekey Server (this is the first time a client
uploads these values), when a new Client or Prekey Profile is generated with a
different long-term public key, and when the stored Client or Prekey Profile
will soon expire. A client must always upload new Client and Prekey Profiles
when one of these scenarios happen to replace the old stored ones. Only one
Client Profile can be published in one message. The maximum number of Prekey
Profiles that can be published in one message is 255.
different long-term public key or other values, and when the stored Client or
Prekey Profile will soon expire. A client must always upload new Client and
Prekey Profiles when one of these scenarios happen to replace the old stored
ones. Only one Client Profile can be published in one message. Only one Prekey
Profile can be published in one message.
Prekey Messages are included in this message when there are few or none of
these messages left on the Prekey Server. This can be checked by sending a
......@@ -843,14 +842,14 @@ A valid Prekey Publication Message is generated as follows:
Messages.
1. Concatenate the Client Profile, if it needs to be published. Assign `K`
to `01`. If there is no Client Profile, assign 0x00 to `K`.
1. Concatenate all Prekey Profiles, if they need to be published. Assign
`J` as the number of Prekey Profiles. If there are none, assign 0x00 to `J`.
1. Concatenate the Prekey Profile, if it needs to be published. Assign `J`
to `01`. If there is no Prekey Profile, assign 0x00 to `J`.
1. Calculate the `Prekey MAC`:
* If client profiles and Prekey profiles are present:
`KDF(usagePreMAC, prekey_mac_k || message type || N ||
KDF(usagePrekeyMessages, Prekey Messages, 64) || K ||
KDF(usageClientProfile, Client Profile, 64) || J ||
KDF(usagePrekeyProfile, Prekey Profiles, 64), 64)`.
KDF(usagePrekeyProfile, Prekey Profile, 64), 64)`.
* If only Prekey Messages are present:
`KDF(usagePreMAC, prekey_mac_k || message type || N ||
KDF(usagePrekeyMessage, Prekey Messages, 64) ||
......@@ -876,16 +875,16 @@ K (BYTE)
to one; otherwise, to zero.
Client Profile (CLIENT-PROF)
The Client Profiles created as described in the section "Creating a Client
The Client Profile created as described in the section "Creating a Client
Profile" of the OTRv4 specification. This value is optional.
J (BYTE)
The number of Prekey Profiles present in this message. If there are none,
the value is zero.
A number that shows if a Prekey Profile is present or not. If present, set it
to one; otherwise, to zero.
Prekey Profiles (PREKEY-PROF)
All 'J' Prekey Profiles created as described in the section "Creating a Prekey
Profile" of the OTRv4 specification.
Prekey Profile (PREKEY-PROF)
The Prekey Profile created as described in the section "Creating a Prekey
Profile" of the OTRv4 specification. This value is optional.
Prekey MAC (MAC)
The MAC with the appropriate MAC key of everything: from the message type to
......@@ -1090,11 +1089,9 @@ By client we mean each device a user has.
1. Client creates the Client Profile, as defined in the OTRv4 specification. See
the [Client Profile](https://github.com/otrv4/otrv4/blob/master/otrv4.md#client-profile)
section of the OTRv4 specification for details.
1. Client creates Prekey Profiles, as defined in OTRv4 specification. See
1. Client creates the Prekey Profile, as defined in OTRv4 specification. See
the [Prekey Profile](https://github.com/otrv4/otrv4/blob/master/otrv4.md#prekey-profile)
section of the OTRv4 specification for details. It must create a Prekey
Profile for each local long-term public key it has, and sign the Prekey
Profile with the respective key.
section of the OTRv4 specification for details.
1. Client creates Prekey Messages, as defined in OTRv4 specification. See
the [Prekey message](https://github.com/otrv4/otrv4/blob/master/otrv4.md#prekey-message)
section of the OTRv4 specification for details.
......@@ -1113,11 +1110,11 @@ By client we mean each device a user has.
1. Validate the Prekey Publication message, as defined in its section
[Prekey Publication Message](#prekey-publication-message).
1. For every value, check the integrity of it.
1. If Client and Prekey Profiles are present:
1. If Client and Prekey Profile are present:
1. Validate the Client Profile as defined in the
[Validating a Client Profile](https://github.com/otrv4/otrv4/blob/master/otrv4.md#validating-a-client-profile)
section of the OTRv4 specification.
1. Validate the Prekey Profiles as defined in the
1. Validate the Prekey Profile as defined in the
[Validating a Prekey Profile](https://github.com/otrv4/otrv4/blob/master/otrv4.md#validating-a-prekey-profile)
section of the OTRv4 specification.
1. If Prekey Messages are present:
......@@ -1125,7 +1122,7 @@ By client we mean each device a user has.
[Prekey Message](https://github.com/otrv4/otrv4/blob/master/otrv4.md#prekey-message)
section of the OTRv4 specification.
1. Discard any invalid or duplicated values.
1. The Prekey Server stores the Client Profile, Prekey Profiles and Prekey
1. The Prekey Server stores the Client Profile, Prekey Profile and Prekey
Messages by associating them with the identity. This identity is the one used
by the network, for example, 'alice@xmpp.org' for XMPP.
1. The Prekey Server sends an acknowledgment that the operation succeeded in the
......@@ -1165,26 +1162,19 @@ Ensemble from the participant they want to start a conversation with:
1. The Prekey Server selects Prekey Ensembles for each requested versions
consisting of:
* A valid Client Profile for every instance tag for the identity.
* A valid Prekey Profile for every instance tag and long-term public key for
the identity. That is, different Prekey Profiles if they have the same
instance tag but different long-term public keys. It always selects
the Prekey Profiles with the latest expiry date.
* A valid Prekey Profile for every instance tag for the identity.
* One Prekey Message for every Client Profile and Prekey Profile selected.
This Prekey Messages must have the same instance tag as the Client and
Prekey Profiles.
* Builds Prekey Ensembles with the selected values, for example:
```
Identity || Client Profile (with instance tag 0x01, and (long-term public key 1 && 2)) ||
Identity || Client Profile (with instance tag 0x01, and long-term public key 1) ||
Prekey Profile (with instance tag 0x01 and long-term public key 1) ||
Prekey Message (with instance tag 0x01).
Identity || Client Profile (with instance tag 0x01, and (long-term public key 1 && 2)) ||
Prekey Profile (with instance tag 0x01 and long-term public key 2) ||
Prekey Message (with instance tag 0x01).
Identity || Client Profile (with instance tag 0x02, and (long-term public key 3)) ||
Prekey Profile (with instance tag 0x02 and long-term public key 3) ||
Identity || Client Profile (with instance tag 0x02, and long-term public key 2) ||
Prekey Profile (with instance tag 0x02 and long-term public key 2) ||
Prekey Message (with instance tag 0x02).
```
......@@ -1210,8 +1200,8 @@ Ensemble from the participant they want to start a conversation with:
the same.
1. [Validates the Client Profile](https://github.com/otrv4/otrv4/blob/master/otrv4.md#validating-a-client-profile).
1. [Validates the Prekey Profile](https://github.com/otrv4/otrv4/blob/master/otrv4.md#validating-a-prekey-profile).
1. Checks that the Prekey Profile is signed by one of the long-term public
keys stated in it and in the Client Profile.
1. Checks that the Prekey Profile is signed by the long-term public stated
in the Client Profile.
1. Verifies the Prekey Message as stated in the
[Prekey Message](https://github.com/otrv4/otrv4/blob/master/otrv4.md#prekey-message)
section.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment