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
8912d13b
Commit
8912d13b
authored
Sep 06, 2016
by
Richard van der Hoff
Committed by
GitHub
Sep 06, 2016
Browse files
Merge pull request #17 from matrix-org/rav/group_session_error_handling
Fix error handling for group sessions
parents
617f9b16
c2b51207
Changes
2
Show whitespace changes
Inline
Side-by-side
javascript/olm_inbound_group_session.js
View file @
8912d13b
...
...
@@ -66,14 +66,14 @@ InboundGroupSession.prototype['decrypt'] = restore_stack(function(
)
{
var
message_array
=
array_from_string
(
message
);
var
message_buffer
=
stack
(
message_array
);
var
max_plaintext_length
=
session_method
(
var
max_plaintext_length
=
inbound_group_
session_method
(
Module
[
'
_olm_group_decrypt_max_plaintext_length
'
]
)(
this
.
ptr
,
message_buffer
,
message_array
.
length
);
// caculating the length destroys the input buffer.
// So we copy the array to a new buffer
var
message_buffer
=
stack
(
message_array
);
var
plaintext_buffer
=
stack
(
max_plaintext_length
+
NULL_BYTE_PADDING_LENGTH
);
var
plaintext_length
=
session_method
(
Module
[
"
_olm_group_decrypt
"
])(
var
plaintext_length
=
inbound_group_
session_method
(
Module
[
"
_olm_group_decrypt
"
])(
this
.
ptr
,
message_buffer
,
message_array
.
length
,
plaintext_buffer
,
max_plaintext_length
...
...
javascript/olm_outbound_group_session.js
View file @
8912d13b
...
...
@@ -54,7 +54,7 @@ OutboundGroupSession.prototype['unpickle'] = restore_stack(function(key, pickle)
});
OutboundGroupSession
.
prototype
[
'
create
'
]
=
restore_stack
(
function
(
key
)
{
var
random_length
=
session_method
(
var
random_length
=
outbound_group_
session_method
(
Module
[
'
_olm_init_outbound_group_session_random_length
'
]
)(
this
.
ptr
);
var
random
=
random_stack
(
random_length
);
...
...
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