From 1f7b19512cfa7e1b153b99d6a2b40bad82a5496e Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 26 Apr 2018 17:13:34 +0200 Subject: js: created TestExtension and smaller fixes -- * Extensions: - Moved testapplication to Demoextension - Created BrowserTestExtension. Includes mocha and chai. For running tests that cannot be run outside a WebExtension Both Extensions can be found zipped in build/extensions after running build_extensions.sh * Code changes: - src/Config: Place for the configuration - small fixes raised during testing in Keyring.js, Message.js, - src/gpgmejs_openpgpjs.js don't offer direct GpgME object to the outside, as it only causes confusion - index.js init() now checks the config for validity * Tests: - Reordered tests in test/. - Input values are now in a separate file which may be of use for bulk testing * moved the build directory from dist to build --- lang/js/BrowserTestExtension/browsertest.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lang/js/BrowserTestExtension/browsertest.html (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html new file mode 100644 index 00000000..d2c6396f --- /dev/null +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -0,0 +1,23 @@ + + + + + + + +

Browsertest

+
+ + + + + + + + + + + + + + -- cgit v1.2.3 From c755287ba845c4cbbf1d50e5aafecb2e687c7ac9 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 3 May 2018 18:03:22 +0200 Subject: js: Added browser testing for unit tests -- * Added unittests to be run inside a Browser. To be able to access the non-exposed functions and classes, a testing bundle will be created, containing the tests (unittests.js) and the items to be tested. * src/Helpelpers, src/Key, src/Keyring: fixed some errors found during testing. --- lang/js/BrowserTestExtension/browsertest.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index d2c6396f..ce037a11 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -14,9 +14,11 @@ + + -- cgit v1.2.3 From 8f3d83e5f0903323ec92f588f60dcecb0ae96de4 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Mon, 7 May 2018 18:27:25 +0200 Subject: js: fixing errors found by testing: encrypt/decrypt -- * Key.js: Error code for wrong parameter in createKey should be "PARAM_WRONG" * Helpers.js: The property openpgpjs-like Objects were checked for in toKeyIdArray was not defined. * src/permittedOperations.js: updated more expectations and assumptions for the native API * new Problems: - There seems to be a message size limit of about 21 MB for nativeMessaging, much lower than the documented 4GB. - Some bytes are lost with random data in an encrypt-decrypt roundtrip. The culprit is unclear. --- lang/js/BrowserTestExtension/browsertest.html | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index ce037a11..d12e03cf 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -18,6 +18,7 @@ + -- cgit v1.2.3 From c92326cc257cf7c8b6c0ddc43ec81573c409bc64 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 9 May 2018 19:40:57 +0200 Subject: js: more testing of nativeMessaging connection -- * There were some inconsistencies between utf-8, transfer and browsers' utf16, which broke characters that were split between individual messages. src/Connection now contains a workaround that reassembles javascripts' format from passed base64 strings. This needs someone more experienced looking. * Added several new tests which were failing during initial debugging of this issue * reorganized BrowsertestExtension to avoid cluttering. --- lang/js/BrowserTestExtension/browsertest.html | 3 --- 1 file changed, 3 deletions(-) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index d12e03cf..c379ef53 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -12,14 +12,11 @@ - - - -- cgit v1.2.3 From a4ba80c553c2ac42f9e311344302c04ec9aa715b Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 24 May 2018 15:16:18 +0200 Subject: js: adding sign method -- * src/gpgmejs.js: method, update in src/permittedOperations * basic testing in BrowsertestExtension --- lang/js/BrowserTestExtension/browsertest.html | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index c379ef53..3d81a9ec 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -17,6 +17,7 @@ + -- cgit v1.2.3 From 0356a667c5a8b4fdb4404cebb57475ed3f39ade9 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 6 Jun 2018 11:57:41 +0200 Subject: js: implement import/delete Key, some fixes -- * Keyring.js - implemented importKey: importing one or more armored public key blocks. - implemented deleteKey: deleting a public Key from gpg. * Key.js renamed property Key.armor to Key.armored * Helpers.js: toKeyIDArray does not complain anymore if there are no keys. Not having Keys in e.g. signing keys in encrypt is legitimate and common, the complaints were getting spammy * Errors.js: gpgme_errors now always pass an optional additional message, for easier debugging in minified code * Connection.js: Fix in gpgme-json responses containing objects * eslintrc.json: Start using eslint. A cleanup to conform to it is not done yet * Added further tests for the new functionality --- lang/js/BrowserTestExtension/browsertest.html | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index 3d81a9ec..f3d7a406 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -18,6 +18,7 @@ + -- cgit v1.2.3 From 8964627f6ad7c407785a9fa5cb508c7c28be0d60 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Mon, 9 Jul 2018 11:57:01 +0200 Subject: js: fix verify result reporting -- * src/Signature.js: searching for overall validity in the "summary" property * BrowsertestExtension: Added two verify tests --- lang/js/BrowserTestExtension/browsertest.html | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index f3d7a406..de8cd41a 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -18,6 +18,7 @@ + -- cgit v1.2.3 From 68a012deb3b501d7417778be12c88bd475a37cb5 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 1 Aug 2018 12:51:12 +0200 Subject: js: make init export immutable -- * src/index.js: The export now uses a freezed Object, which does not allow for simply overwriting the init method by e.g. a third-party library. * BrowsertestExtension: Added some tests trying if decryption of bad data properly fails --- lang/js/BrowserTestExtension/browsertest.html | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index de8cd41a..a20cfe19 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -19,6 +19,7 @@ + -- cgit v1.2.3 From 622db0d1de665dfd93c991cd2d517078b04b3a13 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 16 Aug 2018 11:25:50 +0200 Subject: js: consistently return uppercase fingerprint -- * src/Key.js: the fingerprint returned by a Key is now always upper case hex, even if the constructor had lower case input. This is to be more consistent with gpgme and to be more readable and reliable in comparisions. --- lang/js/BrowserTestExtension/browsertest.html | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/js/BrowserTestExtension/browsertest.html') diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index a20cfe19..0d3e2936 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -15,6 +15,7 @@ + -- cgit v1.2.3