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
Michael Telatynski
Olm
Commits
d1a53586
Commit
d1a53586
authored
Oct 21, 2016
by
Richard van der Hoff
Browse files
Merge branch 'rav/clear_random_bufs'
parents
5a98012c
21ce3491
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/olm/outbound_group_session.h
View file @
d1a53586
...
...
@@ -96,7 +96,7 @@ size_t olm_init_outbound_group_session_random_length(
*/
size_t
olm_init_outbound_group_session
(
OlmOutboundGroupSession
*
session
,
uint8_t
const
*
random
,
size_t
random_length
uint8_t
*
random
,
size_t
random_length
);
/**
...
...
src/outbound_group_session.c
View file @
d1a53586
...
...
@@ -154,20 +154,23 @@ size_t olm_init_outbound_group_session_random_length(
size_t
olm_init_outbound_group_session
(
OlmOutboundGroupSession
*
session
,
uint8_t
const
*
random
,
size_t
random_length
uint8_t
*
random
,
size_t
random_length
)
{
const
uint8_t
*
random_ptr
=
random
;
if
(
random_length
<
olm_init_outbound_group_session_random_length
(
session
))
{
/* Insufficient random data for new session */
session
->
last_error
=
OLM_NOT_ENOUGH_RANDOM
;
return
(
size_t
)
-
1
;
}
megolm_init
(
&
(
session
->
ratchet
),
random
,
0
);
random
+=
MEGOLM_RATCHET_LENGTH
;
megolm_init
(
&
(
session
->
ratchet
),
random
_ptr
,
0
);
random
_ptr
+=
MEGOLM_RATCHET_LENGTH
;
_olm_crypto_ed25519_generate_key
(
random
,
&
(
session
->
signing_key
));
random
+=
ED25519_RANDOM_LENGTH
;
_olm_crypto_ed25519_generate_key
(
random
_ptr
,
&
(
session
->
signing_key
));
random
_ptr
+=
ED25519_RANDOM_LENGTH
;
_olm_unset
(
random
,
random_length
);
return
0
;
}
...
...
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