aboutsummaryrefslogtreecommitdiff
path: root/javascript/olm_outbound_group_session.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/olm_outbound_group_session.js')
-rw-r--r--javascript/olm_outbound_group_session.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/javascript/olm_outbound_group_session.js b/javascript/olm_outbound_group_session.js
index f1ccd3d..e4852c1 100644
--- a/javascript/olm_outbound_group_session.js
+++ b/javascript/olm_outbound_group_session.js
@@ -8,7 +8,7 @@ function outbound_group_session_method(wrapped) {
return function() {
var result = wrapped.apply(this, arguments);
if (result === OLM_ERROR) {
- var message = Pointer_stringify(
+ var message = UTF8ToString(
Module['_olm_outbound_group_session_last_error'](arguments[0])
);
throw new Error("OLM." + message);
@@ -40,7 +40,7 @@ OutboundGroupSession.prototype['pickle'] = restore_stack(function(key) {
key_array[i] = 0;
}
}
- return Pointer_stringify(pickle_buffer);
+ return UTF8ToString(pickle_buffer, pickle_length);
});
OutboundGroupSession.prototype['unpickle'] = restore_stack(function(key, pickle) {
@@ -100,7 +100,7 @@ OutboundGroupSession.prototype['encrypt'] = function(plaintext) {
0, "i8"
);
- return UTF8ToString(message_buffer);
+ return UTF8ToString(message_buffer, message_length);
} finally {
if (plaintext_buffer !== undefined) {
// don't leave a copy of the plaintext in the heap.
@@ -121,7 +121,7 @@ OutboundGroupSession.prototype['session_id'] = restore_stack(function() {
outbound_group_session_method(Module['_olm_outbound_group_session_id'])(
this.ptr, session_id, length
);
- return Pointer_stringify(session_id);
+ return UTF8ToString(session_id, length);
});
OutboundGroupSession.prototype['session_key'] = restore_stack(function() {
@@ -132,7 +132,7 @@ OutboundGroupSession.prototype['session_key'] = restore_stack(function() {
outbound_group_session_method(Module['_olm_outbound_group_session_key'])(
this.ptr, key, key_length
);
- var key_str = Pointer_stringify(key);
+ var key_str = UTF8ToString(key, key_length);
bzero(key, key_length); // clear out our copy of the key
return key_str;
});