Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Olm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
Olm
Commits
39a08733
Commit
39a08733
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
This field isn't being used anywhere so don't bother including it in the messages
parent
3f475ab2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/axolotl/message.hh
+0
-4
0 additions, 4 deletions
include/axolotl/message.hh
src/message.cpp
+0
-10
0 additions, 10 deletions
src/message.cpp
src/session.cpp
+0
-5
0 additions, 5 deletions
src/session.cpp
with
0 additions
and
19 deletions
include/axolotl/message.hh
+
0
−
4
View file @
39a08733
...
...
@@ -79,9 +79,7 @@ struct PreKeyMessageWriter {
struct
PreKeyMessageReader
{
std
::
uint8_t
version
;
bool
has_registration_id
;
bool
has_one_time_key_id
;
std
::
uint32_t
registration_id
;
std
::
uint32_t
one_time_key_id
;
std
::
uint8_t
const
*
identity_key
;
std
::
size_t
identity_key_length
;
std
::
uint8_t
const
*
base_key
;
std
::
size_t
base_key_length
;
...
...
@@ -93,7 +91,6 @@ struct PreKeyMessageReader {
* The length of the buffer needed to hold a message.
*/
std
::
size_t
encode_one_time_key_message_length
(
std
::
uint32_t
registration_id
,
std
::
uint32_t
one_time_key_id
,
std
::
size_t
identity_key_length
,
std
::
size_t
base_key_length
,
...
...
@@ -108,7 +105,6 @@ std::size_t encode_one_time_key_message_length(
void
encode_one_time_key_message
(
PreKeyMessageWriter
&
writer
,
std
::
uint8_t
version
,
std
::
uint32_t
registration_id
,
std
::
uint32_t
one_time_key_id
,
std
::
size_t
identity_key_length
,
std
::
size_t
base_key_length
,
...
...
This diff is collapsed.
Click to expand it.
src/message.cpp
+
0
−
10
View file @
39a08733
...
...
@@ -231,7 +231,6 @@ void axolotl::decode_message(
namespace
{
static
std
::
uint8_t
const
REGISTRATION_ID_TAG
=
050
;
static
std
::
uint8_t
const
ONE_TIME_KEY_ID_TAG
=
010
;
static
std
::
uint8_t
const
BASE_KEY_TAG
=
022
;
static
std
::
uint8_t
const
IDENTITY_KEY_TAG
=
032
;
...
...
@@ -241,14 +240,12 @@ static std::uint8_t const MESSAGE_TAG = 042;
std
::
size_t
axolotl
::
encode_one_time_key_message_length
(
std
::
uint32_t
registration_id
,
std
::
uint32_t
one_time_key_id
,
std
::
size_t
identity_key_length
,
std
::
size_t
base_key_length
,
std
::
size_t
message_length
)
{
std
::
size_t
length
=
VERSION_LENGTH
;
length
+=
1
+
varint_length
(
registration_id
);
length
+=
1
+
varint_length
(
one_time_key_id
);
length
+=
1
+
varstring_length
(
identity_key_length
);
length
+=
1
+
varstring_length
(
base_key_length
);
...
...
@@ -260,7 +257,6 @@ std::size_t axolotl::encode_one_time_key_message_length(
void
axolotl
::
encode_one_time_key_message
(
axolotl
::
PreKeyMessageWriter
&
writer
,
std
::
uint8_t
version
,
std
::
uint32_t
registration_id
,
std
::
uint32_t
one_time_key_id
,
std
::
size_t
identity_key_length
,
std
::
size_t
base_key_length
,
...
...
@@ -269,7 +265,6 @@ void axolotl::encode_one_time_key_message(
)
{
std
::
uint8_t
*
pos
=
output
;
*
(
pos
++
)
=
version
;
pos
=
encode
(
pos
,
REGISTRATION_ID_TAG
,
registration_id
);
pos
=
encode
(
pos
,
ONE_TIME_KEY_ID_TAG
,
one_time_key_id
);
pos
=
encode
(
pos
,
BASE_KEY_TAG
,
writer
.
base_key
,
base_key_length
);
pos
=
encode
(
pos
,
IDENTITY_KEY_TAG
,
writer
.
identity_key
,
identity_key_length
);
...
...
@@ -287,17 +282,12 @@ void axolotl::decode_one_time_key_message(
if
(
pos
==
end
)
return
;
reader
.
version
=
*
(
pos
++
);
reader
.
has_registration_id
=
false
;
reader
.
has_one_time_key_id
=
false
;
reader
.
identity_key
=
nullptr
;
reader
.
base_key
=
nullptr
;
reader
.
message
=
nullptr
;
while
(
pos
!=
end
)
{
pos
=
decode
(
pos
,
end
,
REGISTRATION_ID_TAG
,
reader
.
registration_id
,
reader
.
has_registration_id
);
pos
=
decode
(
pos
,
end
,
ONE_TIME_KEY_ID_TAG
,
reader
.
one_time_key_id
,
reader
.
has_one_time_key_id
...
...
This diff is collapsed.
Click to expand it.
src/session.cpp
+
0
−
5
View file @
39a08733
...
...
@@ -112,7 +112,6 @@ bool check_message_fields(
ok
=
ok
&&
reader
.
base_key
;
ok
=
ok
&&
reader
.
base_key_length
==
KEY_LENGTH
;
ok
=
ok
&&
reader
.
has_one_time_key_id
;
ok
=
ok
&&
reader
.
has_registration_id
;
return
ok
;
}
...
...
@@ -143,7 +142,6 @@ std::size_t axolotl::Session::new_inbound_session(
return
std
::
size_t
(
-
1
);
}
alice_identity_key
.
id
=
reader
.
registration_id
;
std
::
memcpy
(
alice_identity_key
.
key
.
public_key
,
reader
.
identity_key
,
32
);
std
::
memcpy
(
alice_base_key
.
public_key
,
reader
.
base_key
,
32
);
bob_one_time_key_id
=
reader
.
one_time_key_id
;
...
...
@@ -195,7 +193,6 @@ bool axolotl::Session::matches_inbound_session(
reader
.
base_key
,
alice_base_key
.
public_key
,
KEY_LENGTH
);
same
=
same
&&
reader
.
one_time_key_id
==
bob_one_time_key_id
;
same
=
same
&&
reader
.
registration_id
==
alice_identity_key
.
id
;
return
same
;
}
...
...
@@ -221,7 +218,6 @@ std::size_t axolotl::Session::encrypt_message_length(
}
return
encode_one_time_key_message_length
(
alice_identity_key
.
id
,
bob_one_time_key_id
,
KEY_LENGTH
,
KEY_LENGTH
,
...
...
@@ -256,7 +252,6 @@ std::size_t axolotl::Session::encrypt(
encode_one_time_key_message
(
writer
,
PROTOCOL_VERSION
,
alice_identity_key
.
id
,
bob_one_time_key_id
,
KEY_LENGTH
,
KEY_LENGTH
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment