aboutsummaryrefslogtreecommitdiff
path: root/javascript/olm_sas.js
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <s@saghul.net>2020-09-23 10:13:46 +0200
committerHubert Chathi <hubert@uhoreg.ca>2020-09-23 15:27:55 -0400
commit2ef1f6f4fc5bdc069483a527ab3a1b060c71fcad (patch)
tree40a3a0833442a59edc18378cc2aa0886eaa44b1a /javascript/olm_sas.js
parent4bae4134eb115859038de4e8eab11b22baf80b0c (diff)
SAS: add olm_sas_is_their_key_set
Also make olm_sas_generate_bytes fail if their key wasn't set.
Diffstat (limited to 'javascript/olm_sas.js')
-rw-r--r--javascript/olm_sas.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/javascript/olm_sas.js b/javascript/olm_sas.js
index 5cf3fb0..38535d5 100644
--- a/javascript/olm_sas.js
+++ b/javascript/olm_sas.js
@@ -42,6 +42,12 @@ SAS.prototype['set_their_key'] = restore_stack(function(their_key) {
);
});
+SAS.prototype['is_their_key_set'] = restore_stack(function() {
+ return sas_method(Module['_olm_sas_is_their_key_set'])(
+ this.ptr
+ ) ? true : false;
+});
+
SAS.prototype['generate_bytes'] = restore_stack(function(info, length) {
var info_array = array_from_string(info);
var info_buffer = stack(info_array);