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
Tulir Asokan
Olm
Commits
8519ce02
Commit
8519ce02
authored
Dec 10, 2021
by
Hubert Chathi
Browse files
clear out random arrays
parent
c23ce70f
Changes
2
Hide whitespace changes
Inline
Side-by-side
javascript/olm_outbound_group_session.js
View file @
8519ce02
...
...
@@ -67,9 +67,14 @@ OutboundGroupSession.prototype['create'] = restore_stack(function() {
Module
[
'
_olm_init_outbound_group_session_random_length
'
]
)(
this
.
ptr
);
var
random
=
random_stack
(
random_length
);
outbound_group_session_method
(
Module
[
'
_olm_init_outbound_group_session
'
])(
this
.
ptr
,
random
,
random_length
);
try
{
outbound_group_session_method
(
Module
[
'
_olm_init_outbound_group_session
'
])(
this
.
ptr
,
random
,
random_length
);
}
finally
{
// clear the random buffer
bzero
(
random
,
random_length
);
}
});
OutboundGroupSession
.
prototype
[
'
encrypt
'
]
=
function
(
plaintext
)
{
...
...
javascript/olm_post.js
View file @
8519ce02
...
...
@@ -73,9 +73,14 @@ Account.prototype['create'] = restore_stack(function() {
Module
[
'
_olm_create_account_random_length
'
]
)(
this
.
ptr
);
var
random
=
random_stack
(
random_length
);
account_method
(
Module
[
'
_olm_create_account
'
])(
this
.
ptr
,
random
,
random_length
);
try
{
account_method
(
Module
[
'
_olm_create_account
'
])(
this
.
ptr
,
random
,
random_length
);
}
finally
{
// clear the random buffer
bzero
(
random
,
random_length
);
}
});
Account
.
prototype
[
'
identity_keys
'
]
=
restore_stack
(
function
()
{
...
...
@@ -140,9 +145,14 @@ Account.prototype['generate_one_time_keys'] = restore_stack(function(
Module
[
'
_olm_account_generate_one_time_keys_random_length
'
]
)(
this
.
ptr
,
number_of_keys
);
var
random
=
random_stack
(
random_length
);
account_method
(
Module
[
'
_olm_account_generate_one_time_keys
'
])(
this
.
ptr
,
number_of_keys
,
random
,
random_length
);
try
{
account_method
(
Module
[
'
_olm_account_generate_one_time_keys
'
])(
this
.
ptr
,
number_of_keys
,
random
,
random_length
);
}
finally
{
// clear the random buffer
bzero
(
random
,
random_length
);
}
});
Account
.
prototype
[
'
remove_one_time_keys
'
]
=
restore_stack
(
function
(
session
)
{
...
...
@@ -156,9 +166,14 @@ Account.prototype['generate_fallback_key'] = restore_stack(function() {
Module
[
'
_olm_account_generate_fallback_key_random_length
'
]
)(
this
.
ptr
);
var
random
=
random_stack
(
random_length
);
account_method
(
Module
[
'
_olm_account_generate_fallback_key
'
])(
this
.
ptr
,
random
,
random_length
);
try
{
account_method
(
Module
[
'
_olm_account_generate_fallback_key
'
])(
this
.
ptr
,
random
,
random_length
);
}
finally
{
// clear the random buffer
bzero
(
random
,
random_length
);
}
});
Account
.
prototype
[
'
fallback_key
'
]
=
restore_stack
(
function
()
{
...
...
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