Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
ec5ff1e0
Commit
ec5ff1e0
authored
Sep 23, 2020
by
Hubert Chathi
Browse files
also check that the pubkey is set when calculating the MAC
parent
78d9cbab
Changes
1
Show whitespace changes
Inline
Side-by-side
src/sas.c
View file @
ec5ff1e0
...
...
@@ -141,6 +141,10 @@ size_t olm_sas_calculate_mac(
sas
->
last_error
=
OLM_OUTPUT_BUFFER_TOO_SMALL
;
return
(
size_t
)
-
1
;
}
if
(
!
sas
->
their_key_set
)
{
sas
->
last_error
=
OLM_SAS_THEIR_KEY_NOT_SET
;
return
(
size_t
)
-
1
;
}
uint8_t
key
[
32
];
_olm_crypto_hkdf_sha256
(
sas
->
secret
,
sizeof
(
sas
->
secret
),
...
...
@@ -164,6 +168,10 @@ size_t olm_sas_calculate_mac_long_kdf(
sas
->
last_error
=
OLM_OUTPUT_BUFFER_TOO_SMALL
;
return
(
size_t
)
-
1
;
}
if
(
!
sas
->
their_key_set
)
{
sas
->
last_error
=
OLM_SAS_THEIR_KEY_NOT_SET
;
return
(
size_t
)
-
1
;
}
uint8_t
key
[
256
];
_olm_crypto_hkdf_sha256
(
sas
->
secret
,
sizeof
(
sas
->
secret
),
...
...
Write
Preview
Supports
Markdown
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