Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
OTRv4
otrv4-prekey-server
Commits
dc1072ef
Unverified
Commit
dc1072ef
authored
Jul 17, 2018
by
Sofia Celi
⛸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add verification of Prekey publication message
parent
245e25a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
otrv4-prekey-server.md
otrv4-prekey-server.md
+27
-4
No files found.
otrv4-prekey-server.md
View file @
dc1072ef
...
...
@@ -360,7 +360,7 @@ the same reasons as stated in the
section of the OTRv4 specification. It is used to authenticate contexts to
prevent attacks that rebind the DAKE transcript into different contexts.
Note that varible length fields are encoded as DATA. If
`phi`
is a string, it
Note that vari
a
ble length fields are encoded as DATA. If
`phi`
is a string, it
will be encoded in UTF-8.
To make sure both participants has the same phi during DAKE, sort the instance
...
...
@@ -859,7 +859,7 @@ A valid Prekey Publication Message is generated as follows:
1.
Concatenate the Prekey Profile, if it needs to be published. Assign
`J`
to 0x01. If there is no Prekey Profile, assign 0x00 to
`J`
.
1.
Calculate the
`Prekey MAC`
:
*
If
c
lient
p
rofile
s
and Prekey
p
rofile
s
are present:
*
If
a C
lient
P
rofile and
a
Prekey
P
rofile are present:
`KDF(usage_preMAC, prekey_mac_k || message type || N ||
KDF(usage_prekey_message, Prekey Messages, 64) || K ||
KDF(usage_client_profile, Client Profile, 64) || J ||
...
...
@@ -869,6 +869,29 @@ A valid Prekey Publication Message is generated as follows:
KDF(usage_prekey_message, Prekey Messages, 64) ||
K || J, 64)`
.
`K`
and
`J`
should be set to zero.
To verify a Prekey Publication message:
1.
Verify that the message type is
`0x08`
.
1.
Verify that the protocol version of the message is
`0x0004`
or a higher
version of the protocol. Abort if it is not.
1.
Verify that there are
`N`
number of Prekey messages.
1.
Verify that:
*
If there is a Client Profile, that
`K`
is assign to 0x01.
*
If there is a Prekey Profile, that
`J`
is assign to 0x01.
*
Otherwise, that they are assigned to 0x00.
1.
Calculate the
`Prekey MAC`
:
*
If a Client Profile and a Prekey Profile are present:
`KDF(usage_preMAC, prekey_mac_k || message type || N ||
KDF(usage_prekey_message, Prekey Messages, 64) || K ||
KDF(usage_client_profile, Client Profile, 64) || J ||
KDF(usage_prekey_profile, Prekey Profile, 64), 64)`
.
*
If only Prekey Messages are present:
`KDF(usage_preMAC, prekey_mac_k || message type || N ||
KDF(usage_prekey_message, Prekey Messages, 64) ||
K || J, 64)`
.
`K`
and
`J`
should be set to zero.
1.
Verify that this calculated
`Prekey MAC`
is equal to the received one. Abort
if it is not.
The encoding looks like this:
```
...
...
@@ -893,8 +916,8 @@ Client Profile (CLIENT-PROF)
Profile" of the OTRv4 specification. This value is optional.
J (BYTE)
A number that shows if a Prekey Profile is present or not. If present, set it
to one; otherwise, to zero.
A number that shows if a Prekey Profile is present or not. If present, set it
to one; otherwise, to zero.
Prekey Profile (PREKEY-PROF)
The Prekey Profile created as described in the section "Creating a Prekey
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment