From 0ad32c9896864963d61f8c3723819295991a51d5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 1 Oct 2018 13:22:04 +0100 Subject: Call appropriate wrapper function Don't think this matters since there's no PkEncryption / PkDecryption object being passed, but for the sake of consistency --- javascript/olm_pk.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'javascript') diff --git a/javascript/olm_pk.js b/javascript/olm_pk.js index 2542707..25db29a 100644 --- a/javascript/olm_pk.js +++ b/javascript/olm_pk.js @@ -123,7 +123,7 @@ PkDecryption.prototype['generate_key'] = restore_stack(function () { Module['_olm_pk_generate_key_random_length'] )(); var random_buffer = random_stack(random_length); - var pubkey_length = pk_encryption_method( + var pubkey_length = pk_decryption_method( Module['_olm_pk_key_length'] )(); var pubkey_buffer = stack(pubkey_length + NULL_BYTE_PADDING_LENGTH); -- cgit v1.2.3 From 8520168e0b4c8172847a051e532ca4deaec46a95 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Mon, 9 Jul 2018 23:21:55 -0400 Subject: fix some code style issues and typos --- javascript/olm_pk.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'javascript') diff --git a/javascript/olm_pk.js b/javascript/olm_pk.js index 25db29a..407eaf1 100644 --- a/javascript/olm_pk.js +++ b/javascript/olm_pk.js @@ -51,7 +51,7 @@ PkEncryption.prototype['encrypt'] = restore_stack(function( )(this.ptr); var mac_buffer = stack(mac_length + NULL_BYTE_PADDING_LENGTH); Module['setValue']( - mac_buffer+mac_length, + mac_buffer + mac_length, 0, "i8" ); var ephemeral_length = pk_encryption_method( @@ -59,7 +59,7 @@ PkEncryption.prototype['encrypt'] = restore_stack(function( )(); var ephemeral_buffer = stack(ephemeral_length + NULL_BYTE_PADDING_LENGTH); Module['setValue']( - ephemeral_buffer+ephemeral_length, + ephemeral_buffer + ephemeral_length, 0, "i8" ); pk_encryption_method(Module['_olm_pk_encrypt'])( @@ -73,7 +73,7 @@ PkEncryption.prototype['encrypt'] = restore_stack(function( // UTF8ToString requires a null-terminated argument, so add the // null terminator. Module['setValue']( - ciphertext_buffer+ciphertext_length, + ciphertext_buffer + ciphertext_length, 0, "i8" ); return { @@ -191,7 +191,7 @@ PkDecryption.prototype['decrypt'] = restore_stack(function ( // UTF8ToString requires a null-terminated argument, so add the // null terminator. Module['setValue']( - plaintext_buffer+plaintext_length, + plaintext_buffer + plaintext_length, 0, "i8" ); return Module['UTF8ToString'](plaintext_buffer); -- cgit v1.2.3 From bad14db8dadac46fef2c1c7094c92831b4bed0fb Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Mon, 9 Jul 2018 23:35:40 -0400 Subject: remove unneeded polyfill --- javascript/test/pk.spec.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'javascript') diff --git a/javascript/test/pk.spec.js b/javascript/test/pk.spec.js index aec90ac..0b27470 100644 --- a/javascript/test/pk.spec.js +++ b/javascript/test/pk.spec.js @@ -18,14 +18,6 @@ limitations under the License. var Olm = require('../olm'); -if (!Object.keys) { - Object.keys = function(o) { - var k=[], p; - for (p in o) if (Object.prototype.hasOwnProperty.call(o,p)) k.push(p); - return k; - } -} - describe("pk", function() { var encryption, decryption; -- cgit v1.2.3