aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-08-16js: avoid async gettersMaximilian Krambach1-10/+5
-- * src/Key.js get armored was returning a promise on async keys. As getters should not do that, it returns an error in this case.
2018-08-16js: wrong object assumed in recent commitMaximilian Krambach1-2/+5
-- * src/Keyring.js I wrongly assumed an object to be a GPGME_Key, it was the raw answer from nativeMessaging instead. Now it returns a GPGME_Key again.
2018-08-16js: get default key fixesMaximilian Krambach1-7/+15
-- * src/Keyring.js: The answer was not parsed correctly, so a config was being ignored. * If no config is set, we return the first non-invalid key with a secret, instead of the first key (which may be e.g. an expired one)
2018-08-16js: simplify getDefaultKeyMaximilian Krambach1-11/+7
-- * src/Keyring.js: In case no default Key is set in configuration, only Keys reported as having a secret part should be considered for default Keys, avoiding some extra requests.
2018-08-16js: consistently return uppercase fingerprintMaximilian Krambach1-2/+3
-- * 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.
2018-08-01js: make init export immutableMaximilian Krambach1-4/+3
-- * 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
2018-07-31js: fix confusion about loop in last commitMaximilian Krambach1-2/+1
-- * The aim is to iterate through the results of the first request (all keys), and then add the propert 'hasSecret' to those that are in the second request (secret Keysring) as well. I messed this up in a recent change, and it escaped testing.
2018-07-31js: Fix Key.hasSecret answerMaximilian Krambach2-5/+7
-- * The comparision result between Keyring and Keyring with secrets was set to the wrong Object which was not returned at all.
2018-07-30js: Making objects inmutableMaximilian Krambach7-23/+31
-- * 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.
2018-07-27js: fix indentaionMaximilian Krambach6-1138/+1150
-- * doing the indentation changes that became neccesary in the last commit.
2018-07-27js: change the write access for js class methodsMaximilian Krambach7-352/+372
-- * 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.
2018-07-24js: include armored Key in import callbackMaximilian Krambach1-3/+6
-- * 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
2018-07-24js: Fix wrong encoding in received error messagesMaximilian Krambach1-1/+2
-- * The libgpg error strings arrive in the browser in a different encoding than used by browsers. Escaping and then decoding it should cover most languages in the supported browsers.
2018-07-18js: typo in commentMaximilian Krambach1-1/+1
-- * Documentation typo that caused jsdoc to exit with an error
2018-07-17js: fix getkeys with locate optionMaximilian Krambach1-2/+4
-- * src/Keyring.js: As locate will not work with the "secret" option, the first message cannot be reused, thus a new one must be created here
2018-07-12js: allow optional Key retrieve pattern to be nullMaximilian Krambach1-2/+2
-- * src/Keyring.js: If the optional "pattern" parameter is not to be used, but another, following parameter is, null is more of a convention in javascript, thus both null and undefined are interpreted as "this parameter is not meant to be set".
2018-07-12js: add with-sec-fprs to getKeysArmoredMaximilian Krambach2-13/+33
-- * 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.
2018-07-10js: documentationMaximilian Krambach10-223/+438
-- * Fixed errors: - src/Message.js post(): Set chunksize to defined default value instead of hardcoded - src/Keys.js: added getHasSecret() to refreshKey operation. * Reviewed and updated the documentation * non-documentation changes which do not affect functionality: - src/Errors: disabled a console.warn that is only useful for debugging - helpers.js: renamed "string" to "value" in isFingerprint and isLongId to avoid confusion - src/Keyring: prepare_sync, search are both explicitly set to false by default
2018-07-09js: fix verify result reportingMaximilian Krambach1-2/+1
-- * src/Signature.js: searching for overall validity in the "summary" property * BrowsertestExtension: Added two verify tests
2018-07-09js: reduce request spam at getKeys()Maximilian Krambach1-17/+35
-- * 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.
2018-07-04js: properly reject pgp message without signatureMaximilian Krambach1-1/+1
-- * A verify at gpgme-json does not fail if there is a valid pgp message that does not include a signature. Instead, the answer will be devoid of signatures. In javascript, the SIG_NO_SIG error should be reported here, but wasn't.
2018-07-04js: Add jsdoc, update webpack-cli dependencyMaximilian Krambach2-6/+7
-- * package.json: - the old webpack-cli version depended on two packages with vulnerabilities, set to minimum version 3.0.8 to fix this (nodesecurity.io/advisories/157, nodesecurity.io/advisories/612) - added License identifier * README: Updated documentation * jsdoc.conf: Added a configuration file for jsdoc * some minor documentation changes, indentations
2018-07-04js: add Key lookupMaximilian Krambach2-1/+9
-- * src/Keyring.js: getKeys() now has the option "search", which will trigger a remote lookup (as configured in gpg) for the string given as pattern. * src/permittedOperations: make use of the new 'locate' option in keylist * DemoExtension: Add a button for lookup, to demonstrate the functionality
2018-07-03js: fixing Key import/export testMaximilian Krambach1-1/+1
-- * 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
2018-06-20js: Demoextension updateMaximilian Krambach2-5/+7
-- * src/Signature: typo * src/gpgmejs.js: fixed wrong scope in verification * right now verify does not succeed in the DemoExtension. This is probably a problem in conversion or line ending.
2018-06-19Prepare build system for gpgme-js and dist itAndre Heinecke1-0/+30
* configure.ac: Add js as language. * lang/Makefile.am: Add js as dist language. * lang/js/BrowserTestExtension/Makefile.am, lang/js/DemoExtension/Makefile.am, lang/js/Makefile.am, lang/js/src/Makefile.am: Populate EXTRA_DIST variables. -- There is no actual build done yet as there seems to be no way to build it with debian stable tools. This needs clarification.
2018-06-19js: getDefaultKey and GenerateKey improvementsMaximilian Krambach2-35/+18
-- * src/Keyring.js: added more options for key generation. * src/Key.js: GetDefaultKey now relies on the info associated with the key, as the approach of relying on a secret subkey did not work as intended * DemoExtension: Added a button for retrieval of the subkey, to test this functionality.
2018-06-14js: import result feedbackMaximilian Krambach1-18/+36
-- * src/Keyring.js: Changed and documented the import result feedback towards the javascript side
2018-06-14js: add verify and signature parsingMaximilian Krambach4-10/+331
-- * src/gpgmejs.js: - Added verify method - Added verification results in decrypt (if signatures are present in the message) - Added a base64 option to decrypt * src/Signature.js: Convenience class for verification results. Used for e.g. converting timestamps to javascript time, quick overall validity checks * src/Keyring.js: removed debug code * src/Errors.js add two new Signature errors
2018-06-13js: getDefaultKey and verify fixMaximilian Krambach4-2/+121
-- * DemoExtension/maindemo.js - added a Demo for retrieving the default signing key * src/Errors.js - add a new Error if no default key can be determined * src/Key.js added documentation and a TODO marker for hasSecret. * src/Keyring.js implemented getDefaultKey * src/permittedOperations.js: Added missing entry for verify, added config_opt
2018-06-11js: removed configMaximilian Krambach3-77/+7
-- * There is no use for a configuration at the moment, and it seems improbable that this use will arise.
2018-06-11js: Add key creation to KeyringMaximilian Krambach2-3/+80
-- * src/Keyring.js: Added method generateKey for new Keys Still TODO: Key length and some further testing. Automated testing does not work in this case, and gpgmejs will not be able to delete test keys again. * src/permittedOperations.js Added new method's definitions according to gpgme-json
2018-06-08js: change chunksize handling and decodingMaximilian Krambach4-149/+146
-- * 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
2018-06-06js: change Keyinfo timestamps into javascript dateMaximilian Krambach1-3/+14
-- * src/Key.js
2018-06-06js: code cleanup (eslint)Maximilian Krambach10-235/+270
-- * 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
2018-06-06js: implement import/delete Key, some fixesMaximilian Krambach5-34/+129
-- * 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
2018-05-30js: more Keyring/Key handlingMaximilian Krambach4-104/+227
-- * src/Keys.js - made setKeyData more consistent with other methods - added convenience methods (Key.armored, Key.hasSecret) - Added a Key delete function * src/Keyring.js: - added a getkeysArmored which allows for bulk export of public Keys gpgmejs: - removed deleteKey. It is now a method of the Key itself - Encrypt: Added some common options as parameter, and the possibility to set all allowed flags via an additional Object
2018-05-28js: Keyring listing keysMaximilian Krambach3-174/+215
-- * implementing Keyring methods: - Keyring.getKeys: has an additional option that retrieves the armor and secret state once at the beginning. This is power hungry, but allows for Keys to be used directly (without querying gpgme-json each call) * permittedOperations.js: reflect recent changes in the native counterpart, adding more options * Key: adding two methods for retrieving the armored Key block and for finding out if the Key includes a secret subkey.
2018-05-28js: Treat a connection as a gpgme ContextMaximilian Krambach6-93/+48
-- * 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
2018-05-25js: implement Key handling (1)Maximilian Krambach5-166/+379
-- * Keys can now be queried for information. Onne version queries gnug directly (asynchronous Promise in javascript terms), the cached version refreshes on demand. * Small fixes: src/Connection.js joins answers that stay json properly now
2018-05-25js: use version operation for connection checksMaximilian Krambach5-77/+75
-- * 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
2018-05-24js: adding sign methodMaximilian Krambach2-1/+81
-- * src/gpgmejs.js: method, update in src/permittedOperations * basic testing in BrowsertestExtension
2018-05-23js: remove openpgp modeMaximilian Krambach5-321/+7
-- * After discussion, that mode is not required, and can result in being quite misleading and a maintenance hassle later on.
2018-05-22js: transfer encoding changesMaximilian Krambach4-42/+52
-- * 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
2018-05-14js: Tests and improvements for openpgp modeMaximilian Krambach3-37/+59
-- * 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
2018-05-09js: more testing of nativeMessaging connectionMaximilian Krambach1-1/+18
-- * 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.
2018-05-08js: more testingMaximilian Krambach2-6/+7
-- * 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
2018-05-07js: fixing errors found by testing: encrypt/decryptMaximilian Krambach2-6/+26
-- * 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.
2018-05-04js: fixing errors found by testingMaximilian Krambach3-22/+65
-- * 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
2018-05-03js: Added browser testing for unit testsMaximilian Krambach3-4/+13
-- * 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.