aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* js: Demoextension updateMaximilian Krambach2018-06-205-40/+99
| | | | | | | | | -- * 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.
* Prepare build system for gpgme-js and dist itAndre Heinecke2018-06-196-2/+160
| | | | | | | | | | | | | | * 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.
* js: getDefaultKey and GenerateKey improvementsMaximilian Krambach2018-06-193-36/+19
| | | | | | | | | | | | -- * 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.
* js: import result feedbackMaximilian Krambach2018-06-141-18/+36
| | | | | | | -- * src/Keyring.js: Changed and documented the import result feedback towards the javascript side
* js: add verify and signature parsingMaximilian Krambach2018-06-144-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
* js: getDefaultKey and verify fixMaximilian Krambach2018-06-137-6/+147
| | | | | | | | | | | | | | | | -- * 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
* js: less confusing icons for test/Demo extensionMaximilian Krambach2018-06-132-0/+0
| | | | | | | -- * The current test icon was just a generic pin. Changed that by the gnupg lock symbol with 'Demo'/'Tests' written on it. Original taken from gnupg artwork/icons/lock-wing.svg.
* js: removed configMaximilian Krambach2018-06-115-102/+7
| | | | | | | -- * There is no use for a configuration at the moment, and it seems improbable that this use will arise.
* js: Add key creation to KeyringMaximilian Krambach2018-06-112-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
* js: change chunksize handling and decodingMaximilian Krambach2018-06-087-197/+170
| | | | | | | | | | -- * 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: change Keyinfo timestamps into javascript dateMaximilian Krambach2018-06-061-3/+14
| | | | | -- * src/Key.js
* js: code cleanup (eslint)Maximilian Krambach2018-06-0627-498/+595
| | | | | | | | -- * 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-0612-94/+511
| | | | | | | | | | | | | | | | | | | | | | | | | -- * 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: more Keyring/Key handlingMaximilian Krambach2018-05-304-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
* js: Keyring listing keysMaximilian Krambach2018-05-286-185/+286
| | | | | | | | | | | | | | | -- * 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.
* js: Treat a connection as a gpgme ContextMaximilian Krambach2018-05-2812-171/+59
| | | | | | | | | | | | | -- * 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: implement Key handling (1)Maximilian Krambach2018-05-257-178/+448
| | | | | | | | | | | -- * 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
* js: use version operation for connection checksMaximilian Krambach2018-05-258-108/+162
| | | | | | | | | | | -- * 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: adding sign methodMaximilian Krambach2018-05-243-1/+82
| | | | | | | -- * src/gpgmejs.js: method, update in src/permittedOperations * basic testing in BrowsertestExtension
* Merge branch 'master' into javascript-bindingMaximilian Krambach2018-05-249-22/+479
|\
| * json: Put signature info before data outputAndre Heinecke2018-05-241-9/+9
| | | | | | | | | | | | | | | | * src/gpgme-json.c (op_decrypt): Move info before data. -- This should enable it to first parse signatures before handling very large chunks of data.
| * json: Add sign to helpAndre Heinecke2018-05-241-0/+1
| | | | | | | | * src/gpgme-json.c (hlp_help): Add sign.
| * json: Add op_signAndre Heinecke2018-05-241-0/+177
| | | | | | | | * src/gpgme-json.c (op_sign): New.
| * json: Fix invalid function callAndre Heinecke2018-05-241-1/+1
| | | | | | | | | | | | | | | | | | * src/gpgme-json.c (add_signatures_to_object): Fix call to xjson_CreateArray. -- That is what happens if you edit code while reviewing changes, without testing it again,..
| * json: Print signatures for decrypt/verifyAndre Heinecke2018-05-241-0/+211
| | | | | | | | | | | | | | | | | | * gpgme-json.c (xJSON_CreateArray), (add_summary_to_object, validity_to_string): New helpers. (add_signature_to_object, add_signatures_to_object) (add_signatures_object): New. (op_decrypt): Handle verify_result. (hlp_help): Mention decrypt.
| * json: Minor typo fixesAndre Heinecke2018-05-241-3/+3
| | | | | | | | * src/gpgme-json.c: Minor typo fixes.
| * docs and examples: python howtoBen McGinnes2018-05-232-8/+22
| | | | | | | | | | | | | | | | * Updated the decryption example code in the HOWTO and the corresponding decrypt-file.py script to gracefully handle a decryption failure. This error will always be triggered when GPGME is used to try to decrypt an old, MDC-less encrypted message or file.
| * cpp: Expose sessionKey and symkeyAlgoAndre Heinecke2018-05-223-0/+19
| | | | | | | | | | * lang/cpp/decryptionresult.cpp, lang/cpp/decryptionresult.h (DecryptionResult::symkeyAlgo, DecryptionResult::sessionKey): New.
| * core, w32: Add w64 handling for regkeysAndre Heinecke2018-05-171-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32-util.c (_gpgme_get_gpg_path): Use new defines. (GNUPG_REGKEY_2): x64 aware regkey as used by GnuPG in Gpg4win 2.x (GNUPG_REGKEY_3): x64 aware regkey as used by GnuPG in Gpg4win 3.x (_gpgme_get_gpgconf_path): Use new regkeys. Add another fallback. -- This should fix more "unsupported protocol" issues if Gpg4win / GnuPG is installed in a non standard path on 64bit systems. The regkey handling is similar to that of gpgex and gpgol. GnuPG-Bug-Id: T3988
| * core: Always fail if an OpenPG message is not integrity protected.Werner Koch2018-05-173-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/decrypt.c (struct op_data_t): Add field not_integrity_protected. (parse_decryption_info): Set this. Also rename mode to aead_algo for clarity. (_gpgme_decrypt_status_handler): Force failure in case of a missing MDC. -- This extra check makes sure that a missing or stripped MDC in - gpg < 2.1 - or gpg 2.2 with an old cipher algorithm will lead to a decryption failure. gpg 2.3 will always fail in this case. Implementing this check here and not backporting the 2.3 change to 2.2 has the benefit that all GPGME using applications are protected but scripts relying on rfc2440 (i.e. without MDC) will only break when migrating to 2.3. Note that S/MIME has no integrity protection mechanism but gpgsm neither emits a DECRYPTION_INFO status line, so an error will not be triggered. If in the future gpgsm supports authenticated encryption it may issue a DECRYPTION_INFO line to force a failure here but it will in that case also emit a DECRYPTION_FAILED anyway. GnuPG-bug-id: 3981 Signed-off-by: Werner Koch <[email protected]>
* | js: remove openpgp modeMaximilian Krambach2018-05-2312-578/+9
| | | | | | | | | | | | | | -- * 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-227-106/+173
| | | | | | | | | | | | | | | | | | | | | | | | -- * 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: remove non-browser testsMaximilian Krambach2018-05-146-264/+0
| | | | | | | | | | | | | | | | | | -- * The majority of tests needs to be run in a nativeMessaging context. Offering the few tests that don't need this context at two places introduces issues with maintainability. All tests now removed can be found in ./unittests.js
* | js: Tests and improvements for openpgp modeMaximilian Krambach2018-05-1410-161/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | -- * 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-0912-162/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | -- * 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.
* | Merge branch 'master' into javascript-bindingMaximilian Krambach2018-05-095-14/+35
|\|
| * json: Improve auto-base64 encoding to not split UTF-8 chars.Werner Koch2018-05-091-8/+14
| | | | | | | | | | | | | | * src/gpgme-json.c (make_data_object): Switch to Base64 also for UTF-8 characters. Signed-off-by: Werner Koch <[email protected]>
| * core: Make the status-fd monitor work for all gpgsm commands.Werner Koch2018-05-091-1/+10
| | | | | | | | | | | | | | * src/engine-gpgsm.c (status_handler): Call the status monitor also here. Signed-off-by: Werner Koch <[email protected]>
| * python: key expiration datetime stamp testsBen McGinnes2018-05-051-1/+1
| | | | | | | | | | | | | | | | | | * Changed the expiration date for the generated test key to NYE this century, rather than the NYE this millennium as originally suggested in job #3815. * This covers the lifetimes of current users (except, maybe, some very healthy millennials) as well as the 32-bit clock end date in 2038; without falling foul of OpenPGP's 2106 expiration.
| * qt: Respect --disable-gpg-test for testsAndre Heinecke2018-05-041-1/+7
| | | | | | | | | | | | | | * lang/qt/Makefile.am: Respect --disable-gpg-test -- This is similar to the core switch to disable the tests.
| * qt: Fix filename handling in cryptoconfigAndre Heinecke2018-04-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | * src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigEntry::urlValue): Build url from local file. (QGpgMENewCryptoConfigEntry::setURLValue): Set native seperated path. -- This fixes setting files through cryptoconfig on Windows. GnuPG-Bug-Id: T3939
* | js: more testingMaximilian Krambach2018-05-087-19/+342
| | | | | | | | | | | | | | | | | | | | | | | | -- * 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-077-23/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- * 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: fixing errors found by testingMaximilian Krambach2018-05-044-23/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | -- * 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
* | js: Added browser testing for unit testsMaximilian Krambach2018-05-0311-16/+436
| | | | | | | | | | | | | | | | | | | | | | -- * 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: changed Key class stubMaximilian Krambach2018-05-035-68/+110
| | | | | | | | | | | | | | | | -- * src/Key.js: A Key object cannot offer more than basic functionality outside a connection, so it now requires a connection to be present.
* | js: more testingMaximilian Krambach2018-04-2716-114/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- * 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: fixed empty operation setter in MessageMaximilian Krambach2018-04-271-2/+9
| | | | | | | | | | | | | | -- * src/Message.js Messages failed because they were not assigned operations
* | js: fixed wrong paths in DemoExtensionMaximilian Krambach2018-04-263-3/+3
| | | | | | | | | | | | -- * Some forgotten internal links after the move to a subdir and cleaning