aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2018-10-05 14:54:29 -0400
committerGitHub <noreply@github.com>2018-10-05 14:54:29 -0400
commit2cbba061c3f0ce4d7f86c3dc2b7f7fd5f4f45ff7 (patch)
tree4f4b91087ce8eff6663da117b92db5fd282e2afc /javascript
parent031eb2dc7591b85937668513d44a08991f4b3d8e (diff)
parent173339ae9accddd184bc83f2c23c5ffae3b08d00 (diff)
Merge branch 'master' into dbkr/ci2
Diffstat (limited to 'javascript')
-rw-r--r--javascript/olm_pk.js10
-rw-r--r--javascript/test/pk.spec.js8
2 files changed, 5 insertions, 13 deletions
diff --git a/javascript/olm_pk.js b/javascript/olm_pk.js
index 25e0fee..5a2c7dc 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);
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);
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.
setValue(
- ciphertext_buffer+ciphertext_length,
+ ciphertext_buffer + ciphertext_length,
0, "i8"
);
return {
@@ -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);
@@ -191,7 +191,7 @@ PkDecryption.prototype['decrypt'] = restore_stack(function (
// UTF8ToString requires a null-terminated argument, so add the
// null terminator.
setValue(
- plaintext_buffer+plaintext_length,
+ plaintext_buffer + plaintext_length,
0, "i8"
);
return UTF8ToString(plaintext_buffer);
diff --git a/javascript/test/pk.spec.js b/javascript/test/pk.spec.js
index 007882f..34f7be5 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;