aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/BrowserTestExtension/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* js: changed verify signature result infosjavascript-bindingMaximilian Krambach2018-08-221-19/+24
| | | | | | | -- * the resulting information of verify now are as documented, and the same as in a decrypt callback
* js: update decrypt/verify resultsMaximilian Krambach2018-08-212-2/+36
| | | | | | | | | | -- * src/gpgmejs.js: Decrypt now parses additional optional dec_info information, as well as any verify information, if present * src/permittedOperations: Now decrypt also expect the new return object dec_inf (containing info such as is_mime and file_name)
* js: add and apply eslint rulesMaximilian Krambach2018-08-2010-67/+67
| | | | | | -- * mainly spacing, see .eslintrc.json for details
* js: decode arriving gpg message stringsMaximilian Krambach2018-08-172-2/+46
| | | | | | | | | -- * Arriving strings (i.e. user id names, error messages) are not always in javascript encoding. This is an attempt to go through the whole gpgme answer (with the exception of payload data) and to fix the encoding of these
* js: importKey feedback refactorMaximilian Krambach2018-08-161-15/+19
| | | | | | | -- * src/Keyring.js: An empty result should no longer cause an error, the import feedback summary has been refactored slightly * Browsertests to reflect import feedback change
* js: consistently return uppercase fingerprintMaximilian Krambach2018-08-162-0/+47
| | | | | | | | | -- * 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.
* js: make init export immutableMaximilian Krambach2018-08-012-0/+98
| | | | | | | | | | -- * 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
* js: Making objects inmutableMaximilian Krambach2018-07-301-1/+0
| | | | | | | | | | | -- * An Object.freeze should stop any malicious third party from changing objects' methods once the objects are instantiated (see unittest for an approach that would have worked before) - An initialized gpgmejs- object doesn't have a '_Keyring' property anymore (it still has its 'Keyring') - The internal expect='base64' needed to be turned into a method.
* js: change the write access for js class methodsMaximilian Krambach2018-07-272-24/+16
| | | | | | | | | | | | | | | | | | -- * src/ [Connection, Error, Key, Keyring, MEssage, Signature, gpgmejs]: Functions and values that are not meant to be overwritten are now moved into their constructors, thus eliminating the possibility of overwrites after initialization. * Key: The mode of use (synchronous cached, or async promises) ivs now determined at initialization of that Key. The property Key.isAsync reflects this state. * unittests: fixed old Key syntax for testing. * Message.js isComplete is now a method and not a getter anymore. * Added some startup tests.
* js: clean up test extensionMaximilian Krambach2018-07-277-453/+417
| | | | | | | | | | | -- Tests will now run with one instance of gpgmejs each block, which reduces overhead. Readability is (hopefully) improved), some negative tests are added. There is still a performance problem in base64 encoding/decoding, which causes some tests to fail due to time out.
* js: include armored Key in import callbackMaximilian Krambach2018-07-241-0/+26
| | | | | | | | | -- * The import answer now also directly contains the armored Key as Key property, without need to refresh the Key object created in the answer. This allows for direct comparision of input and output. * BrowserTestExtension: added test for that import callback
* js: repair BrowserTextExtension testMaximilian Krambach2018-07-201-8/+8
| | | | | | -- * the signed message to verify was signed by a wrong test key
* js: add with-sec-fprs to getKeysArmoredMaximilian Krambach2018-07-121-2/+27
| | | | | | | | | | | | | | -- * Reflects the changes made to gpgme-json in commit 6cc842c9aa76d19448141e5117ac59452d7a1ff3. - getKeysArmored now returns an object with property 'armored' being the exported armored block, and an (optional) array of fingerprint strings for those keys that can be used in sign/encrypt operations as property 'secret_fprs'. With this, extensions such as mailvelope will be able to bulk fetch all necessary key information in one request.
* js: fix verify result reportingMaximilian Krambach2018-07-091-0/+86
| | | | | | | | -- * src/Signature.js: searching for overall validity in the "summary" property * BrowsertestExtension: Added two verify tests
* js: reduce request spam at getKeys()Maximilian Krambach2018-07-091-2/+3
| | | | | | | | | | | | | | | | | | -- * Don't make a secret-Key request for each Key retrieved, use one request for all of them instead, and assemble the info later. This should reduce the traffic with large Keyrings. The bulk retrieval for the public armored Keys for each of these Keys is still up to discussion * unittests: disabled assertion for the armored key (as it currently doesn't work) * encryptTest: clarified the mechanism/reason of rejection for Messages >64 MB. This is still a TODO, as this error comes from a different place (the browser itself) and behaves different from the other errors.
* js: fixing Key import/export testMaximilian Krambach2018-07-031-12/+13
| | | | | | | | | | | | | | -- * BrowserTestExtension: - The KeyImport/Export test had some errors, which have now been fixed - The secret key used for the test examples is now placed more prominently, and a clarification added that decrypt tests will not work if this key is not imported. * permittedOperations.js: typo Thanks to [email protected] for the fixes
* js: removed configMaximilian Krambach2018-06-112-25/+0
| | | | | | | -- * There is no use for a configuration at the moment, and it seems improbable that this use will arise.
* js: change chunksize handling and decodingMaximilian Krambach2018-06-082-47/+22
| | | | | | | | | | -- * the nativeApp now sends all data in one base64-encoded string, which needs reassembly, but in a much easier way now. * there are some new performance problems now, especially with decrypting data
* js: code cleanup (eslint)Maximilian Krambach2018-06-067-149/+223
| | | | | | | | -- * trying to stick to eslint from now on for readability * As some attribution was lost in previous git confusions, I added my name into some of the licence headers
* js: implement import/delete Key, some fixesMaximilian Krambach2018-06-063-17/+176
| | | | | | | | | | | | | | | | | | | | | | | | | -- * 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
* js: Treat a connection as a gpgme ContextMaximilian Krambach2018-05-285-21/+0
| | | | | | | | | | | | | -- * After an operation a connection should be disconnected again. The "end of operation" is now assumed to be either an error as answer, or a message not including a "more" * GPGME, GPGME_Key, GPGME_Keyring don't require a connection anymore * Message.js: The Message.post() method will open a connection as required
* js: use version operation for connection checksMaximilian Krambach2018-05-252-3/+58
| | | | | | | | | | | -- * src/Connection.js: isConnected was renamed to checkConnection, that returns a promise with either version information or Boolean * Connection checks have been adapted to reflect that checkConnection returns a Promise * BrowsertestExtension: tests/signTest.js was missing from my last commit
* js: remove openpgp modeMaximilian Krambach2018-05-233-217/+0
| | | | | | | -- * After discussion, that mode is not required, and can result in being quite misleading and a maintenance hassle later on.
* js: transfer encoding changesMaximilian Krambach2018-05-223-64/+121
| | | | | | | | | | | | -- * Uint8Arrays are not supported for now there are unsolved issues in conversion, and they are lower priority * encrypt gains a new option to indicate that input values are base64 encoded * as decrypted values are always base64 encoded, the option base64 will not try to decode the result into utf, but leave it as it is
* js: Testing lare messagesMaximilian Krambach2018-05-143-29/+51
| | | | | | | | | | -- * Some assumption on messages were wrong. Now the tests use more reasonable sizes. * bigString now uses the full utf8-extent, with the exception of U+0000. This code gets dropped during the encryption-decryption process.
* js: Tests and improvements for openpgp modeMaximilian Krambach2018-05-145-124/+257
| | | | | | | | | | | | | -- * Added openpgp - Mode tests to the browsertest Extension. These tests require openpgp, which should not be a hard dependency for the main project. Packing openpgpjs into the extension is still TODO * Fixes: - openpgp mode API now correctly handles parameters as an object, similar to openpgpjs - proper check and parsing of openpgpjs Message Objects
* js: more testing of nativeMessaging connectionMaximilian Krambach2018-05-094-156/+209
| | | | | | | | | | | | | -- * 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.
* js: more testingMaximilian Krambach2018-05-083-13/+248
| | | | | | | | | | | | -- * Tests: Under certain circumstances, some data change during encrypt-decrypt. Committing the current state so the problem can be discussed. * Fixes: - disconnecting the test ports after tests are complete - fixed passing of the error message from gpgme-json
* js: fixing errors found by testing: encrypt/decryptMaximilian Krambach2018-05-073-14/+184
| | | | | | | | | | | | | | | | | -- * 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.
* js: Added browser testing for unit testsMaximilian Krambach2018-05-031-11/+3
| | | | | | | | | | | -- * 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.
* js: more testingMaximilian Krambach2018-04-273-25/+119
| | | | | | | | | | | | | | | -- * Tests: initialization of the two modes, encryption * gpgme.js: reintroduced message check before calling Connection.post() * gpgmejs_openpgp.js: Fixed openpgp mode not passing keys * index.js: fixed some confusion in parseconfig() * Inserted some TODO stubs for missing error handling
* js: created TestExtension and smaller fixesMaximilian Krambach2018-04-262-0/+79
-- * 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