aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | js: created TestExtension and smaller fixesMaximilian Krambach2018-04-2628-143/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- * 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
* | js: First testing and improvementsMaximilian Krambach2018-04-2512-56/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- * Introduced Mocha/chai as testsuite. After development build 'npm test' should run the unit tests. Functionality exclusive to Browsers/WebExtensions cannot be run this way, so some other testing is still needed. - package.json: Added required development packages - .babelrc indirect configuration for mocha. ES6 transpiling needs some babel configuration, but mocha has no setting for it. - test/mocha.opts Vonfiguration for mocha runs * Fixed errors: - Helpers.js toKeyIdArray; isLongId is now exported - Key.js Key constructor failed - Message.js will not throw an Error during construction, a new message is now created with createMessage, which can return an Error or a GPGME_Message object * Tests: - test/Helpers: exports from Helpers.js, GPGME_Error handling - test/Message: first init test with bad parameters
* | js: Configuration and Error handlingMaximilian Krambach2018-04-2510-207/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- * gpgmejs_openpgpjs - unsuported values with no negative consequences can now reject, warn or be ignored, according to config.unconsidered_params - cleanup of unsupported/supported parameters and TODOS * A src/index.js init() now accepts a configuration object * Errors will now be derived from Error, offering more info and a stacktrace. * Fixed Connection.post() timeout triggering on wrong cases * Added comments in permittedOperations.js, which gpgme interactions are still unimplemented and should be added next
* | js: reactivate timeout on connectionMaximilian Krambach2018-04-254-12/+19
| | | | | | | | | | | | | | | | -- * A timeout of 5 seconds is activated for functions that do not require a pinentry. This definition is written to src/permittedOperations.js * testapplication.js now alerts the proper error codes and messages. * src/Errors.js fixed two typos in error handling
* | js: change in Error behaviourMaximilian Krambach2018-04-258-156/+132
| | | | | | | | | | | | | | | | -- * Error objects will now return the error code if defined as error type in src/Errors.js, or do a console.log if it is a warning. Errors from the native gpgme-json will be marked as GNUPG_ERROR.
* | js: allow openpgp-like Message objects as DataMaximilian Krambach2018-04-251-0/+7
| | | | | | | | | | | | | | -- * src/gpgmejs.js: If a message offers a getText, consider it as the message's content
* | js: Key object adjustments after discussionMaximilian Krambach2018-04-243-15/+64
| | | | | | | | | | | | | | | | | | | | | | | | -- * src/aKey.js changed fingerprint to setter (to avoid overwrites) * src/gpgmejs_openpgpjs.js - Added a class GPGME_Key_openpgpmode, which allows for renaming and deviation from GPGME. - renamed classes *_openPGPCompatibility to *_openpgpmode. They are not fully compatible, but only offer a subset of properties. Also, the name seems less clunky
* | js: change in initialization ancd connection handlingMaximilian Krambach2018-04-246-114/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | -- * The Connection will now be started before an object is created, to better account for failures. * index.js: now exposes an init(), which returns a Promise of configurable <GpgME | gpgmeGpgME_openPGPCompatibility> with an established connection. * TODO: There is currently no way to recover from a "connection lost" * Connection.js offers Connection.isConnected, which toggles on port closing.
* | js: don't allow message operation changesMaximilian Krambach2018-04-233-30/+24
| | | | | | | | | | | | | | -- Once an operation is changed, their set of allowed/required parameters will change. So we shouldn't set/change the operation later.
* | js: Key handling stubs, Error handling, refactoringMaximilian Krambach2018-04-238-131/+756
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- * Error handling: introduced GPGMEJS_Error class that handles errors at a more centralized and consistent position * src/Connection.js: The nativeMessaging port now opens per session instead of per message. Some methods were added that reflect this change - added methods disconnect() and reconnect() - added connection status query * src/gpgmejs.js - stub for key deletion - error handling - high level API for changing connection status * src/gpgmejs_openpgpjs.js - added stubs for Key/Keyring handling according to current state of discussion. It is still subject to change * src/Helpers.js - toKeyIdArray creates an array of KeyIds, now accepting fingerprints, GPGMEJS_Key objects and openpgp Key objects. * Key objects (src/Key.js) Querying information about a key directly from gnupg. Currently a stub, only the Key.fingerprint is functional. * Keyring queries (src/Keyring.js): Listing and searching keys. Currently a stub.
* | js: encrypt improvement and decrypt methodMaximilian Krambach2018-04-2018-306/+887
| | | | | | | | | | | | | | | | | | | | | | * Compatibility class gpgme_openpgpjs offers an API that should accept openpgpjs syntax, throwing errors if a parameter is unexpected/not implemented * tried to be more generic in methods * waiting for multiple answers if 'more' is in the answer * more consistency checking on sending and receiving * updated the example extension --
* | Merge branch 'master' into javascript-bindingMaximilian Krambach2018-04-2037-535/+1993
|\|
| * core: Do not modify args for ignored failuresAndre Heinecke2018-04-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/op-support.c (_gpgme_parse_failure): Ignore gpg-exit failures before modifying args. -- For op_decrypt_verify the status handler for both decrypt and verify would parse the failure when the first parser ignored the failure. This resulted in an ERR_INV_ENGINE as the first call to parse_failure modified the args. GnuPG-Bug-Id: T3919
| * Post release updatesWerner Koch2018-04-202-1/+5
| | | | | | | | --
| * Release 1.11.1gpgme-1.11.1Werner Koch2018-04-202-5/+12
| | | | | | | | | | | | | | * configure.ac: Bump LT version to C31/A20/R1. For cpp to C13/A7/R0. For qt to: C10/A3/R2. Signed-off-by: Werner Koch <[email protected]>
| * core: Remove another debug output leftover.Werner Koch2018-04-201-1/+0
| | | | | | | | | | | | * src/decrypt.c (_gpgme_decrypt_status_handler): Remove log debug. Signed-off-by: Werner Koch <[email protected]>
| * build: More release creation automation.Werner Koch2018-04-201-1/+58
| | | | | | | | | | | | * Makefile.am: Add release and sign-release targets. Signed-off-by: Werner Koch <[email protected]>
| * doc: Suggest the use of strconcat for recipient strings.Werner Koch2018-04-201-0/+55
| | | | | | | | | | | | | | -- GnuPG-bug-id: 3775 Signed-off-by: Werner Koch <[email protected]>
| * json: Remove the -noinstall flag used during development.Werner Koch2018-04-191-2/+0
| | | | | | | | | | | | | | | | * src/Makefile.am (gpgme-json_LDFLAGS): Remove. -- Reported-by: Alon Bar-Lev <[email protected]> Signed-off-by: Werner Koch <[email protected]>
| * cpp: Add origin and last_update to UserIDAndre Heinecke2018-04-193-19/+49
| | | | | | | | | | | | | | * NEWS: Mention it. * lang/cpp/src/key.cpp, lang/cpp/src/key.h (UserID::lastUpdate), (UserID::origin): New. (gpgme_origin_to_pp_origin): New helper.
| * cpp: Add origin and last_updateAndre Heinecke2018-04-193-0/+56
| | | | | | | | | | | | * NEWS: mention interface change. * lang/cpp/src/key.cpp (Key::origin, Key::lastUpdate): New. * lang/cpp/src/key.h (Key::Origin): New enum.
| * core: Remove leftover debug output.Werner Koch2018-04-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * src/verify.c (_gpgme_verify_status_handler): Remove debug output. -- Actually this is a real bug because it uses a debug function available only in the new libgpg-error versions. Time to call Jenkins back from vacation; there are rumors that he has been seen in the city looking for a new Ryzen tail coat. Signed-off-by: Werner Koch <[email protected]>
| * tests: Fix t-verify test for GnuPG < 2.2.7.Werner Koch2018-04-191-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpg/t-verify.c (check_result): Tweak for gnupg < 2.2.7. -- The not yet releases 2.2.7-beta may print a full fingerprint in the ERRSIG status. This is compliant with the dscription but the new t-verify test case did not took in account that older GnuPG versions print only a keyid. Fixes-commit: b99502274ae5efdf6df0d967900ec3d1e64373d7 GnUPG-bug-id: 3920 Signed-off-by: Werner Koch <[email protected]>
| * Post release updatesWerner Koch2018-04-182-3/+6
| | | | | | | | --
| * Release 1.11.0gpgme-1.11.0Werner Koch2018-04-182-9/+11
| | | | | | | | | | | | | | * configure.ac: Bump LT version to C31/A20/R0. For cpp to C12/A6/R0. For qt to: C10/A3/R1. Signed-off-by: Werner Koch <[email protected]>
| * json: Add stpcpy replacement.Werner Koch2018-04-181-0/+13
| | | | | | | | | | | | * src/gpgme-json.c [!HAVE_STPCPY](_my_stpcpy): New. Signed-off-by: Werner Koch <[email protected]>
| * doc: Update copyright years and change two URLs.Werner Koch2018-04-187-17/+17
| | | | | | | | | | | | -- Signed-off-by: Werner Koch <[email protected]>
| * doc: Unify comment style in gpgme.hWerner Koch2018-04-181-160/+175
| | | | | | | | | | | | -- Signed-off-by: Werner Koch <[email protected]>
| * core: New convenience constant GPGME_KEYLIST_MODE_LOCATE.Werner Koch2018-04-184-3/+48
| | | | | | | | | | | | * src/gpgme.h.in (GPGME_KEYLIST_MODE_LOCATE): New. Signed-off-by: Werner Koch <[email protected]>
| * json: Add command "decrypt" to gpgme-json.Werner Koch2018-04-181-7/+139
| | | | | | | | | | | | | | | | | | | | * src/gpgme-json.c (make_data_object): Enable auto-detection of base-64. (op_encrypt): Support a 'mime' flag. (op_decrypt): New. (process_request): Add command "encrypt". Signed-off-by: Werner Koch <[email protected]>
| * core: Add 'is_mime' flags to the verify and decrypt results.Werner Koch2018-04-189-26/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/op-support.c (_gpgme_parse_plaintext): Add arg r_mime. * src/decrypt.c (_gpgme_decrypt_status_handler): Ser mime flag. * src/verify.c (_gpgme_verify_status_handler): Ditto. * src/gpgme.h.in (gpgme_op_verify_result_t): Append fields 'is_mime' and '_unused'. (gpgme_op_decrypt_result_t): New field 'is_mime'. Shrink '_unused'. * tests/run-decrypt.c (print_result): Print MIME flag. * tests/run-verify.c (print_result): Ditto. -- Note that this flag (Liternal Data packet's 'm' mode) is only specified in RFC-4880bis. To use it you currently need to add "rfc4880bis" to the the gpg.conf. Signed-off-by: Werner Koch <[email protected]>
| * core: Fix possible compliance mode detection error.Werner Koch2018-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/verify.c (_gpgme_verify_status_handler): Insert missing break. -- Before the insertion of the compliance status checking the break in the default clause was used by the STATUS_PLAINTEXT code. That got lost. I don't see any actual harm due to different values currently in use for the compliance status. Fixes-commit: 05fa2a9c7764b28fdac35eb72631439df948ca0e Signed-off-by: Werner Koch <[email protected]>
| * json: Improve help meta command in gpgme-json.Werner Koch2018-04-181-7/+17
| | | | | | | | | | | | * src/gpgme-json.c (process_meta_commands): Add ",help CMD". Signed-off-by: Werner Koch <[email protected]>
| * json: Add command "getmore" to gpgme-json.Werner Koch2018-04-181-46/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme-json.c (MIN_REPLY_CHUNK_SIZE): New const. (DEF_REPLY_CHUNK_SIZE): New const. (MAX_REPLY_CHUNK_SIZE): New const. (pending_data): New var. (add_base64_to_object): Chnage to take a plain data pointer. (get_chunksize): New. (make_data_object): New. (op_encrypt): Get chunksize and use make_data_object. (op_getmore): New. (process_request): Release pending data for all commands but "getmore" and "help". -- Native messaging has a limit on the data it may receive in one request. Thus the caller needs to watch for the "more" flag and request the remaining data using "getmore" in a loop. Signed-off-by: Werner Koch <[email protected]>
| * json: Add meta command ,read to gpgme-json.Werner Koch2018-04-181-1/+58
| | | | | | | | | | | | | | | | * src/gpgme-json.c: Include stat.h. (get_file): New. (process_meta_commands): Implement ",read". Signed-off-by: Werner Koch <[email protected]>
| * core: Extend decryption result with symkey_algo.Werner Koch2018-04-177-11/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_decrypt_result_t): Add field 'symkey_algo'. * src/decrypt.c (release_op_data): Free SYMKEY_ALGO. (gpgme_op_decrypt_result): Make sure SYMKEY_ALGO is not NULL. (parse_decryption_info): New. (_gpgme_decrypt_status_handler): Parse DECRYPTION_INFO status. * src/conversion.c (_gpgme_cipher_algo_name): New. (_gpgme_cipher_mode_name): New. * tests/run-decrypt.c (print_result): Print SYMKEY_ALGO * src/util.h (_gpgme_map_gnupg_error): Remove obsolete prototype. -- Signed-off-by: Werner Koch <[email protected]>
| * core: New keyword --file for OpenPGP recpstring.Werner Koch2018-04-172-9/+43
| | | | | | | | | | | | | | | | | | | | * src/engine-gpg.c (append_args_from_recipients_string): Add new flags. -- Now you can use gpgme to encrypt without first importing a key. Signed-off-by: Werner Koch <[email protected]>
| * core: For OpenPGP let offline mode disable dirmngr.Werner Koch2018-04-172-17/+38
| | | | | | | | | | | | | | | | | | | | * src/engine-gpg.c (struct engine_gpg): New flag.offline. (gpg_set_engine_flags): Set it. Also fix setting of no_symkey_cache. (build_argv): Pass --disable-dirmngr in offline mode. -- GnuPG-bug-id: 3831 Signed-off-by: Werner Koch <[email protected]>
| * python: Fix crash by leaving struct members intactTobias Mueller2018-04-171-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/setup.py.in: Copy gpgme.h instead of parsing it. -- The python bindings tried to parse deprecated functions out of gpgme.h. This fails for the current gpgme.h in that it removes an entire field in the key sig struct (_obsolete_class). Hence, the fields were off by an int and the bindings accessed struct members via the wrong offset. That caused python program to crash. At least on 32bit platforms, the crash can be easily triggered by accessing key.uids[0].signatures. On 64bit platforms the compiler probably aligns the struct so that the missing 4 bytes are not noticed. With this change, the python bindings will expose all functions that gpgme exposes, including the deprecated ones. Credits go to Justus Winter for debugging and identying the issue. Signed-off-by: Tobias Mueller <[email protected]> GnuPG-bug-id: 3892
| * core: Allow for --hidden keyword in OpenPGP recpstrings.Werner Koch2018-04-172-5/+19
| | | | | | | | | | | | | | | | | | * src/engine-gpg.c (append_args_from_recipients_string): Add special keywords. -- GnuPG-bug-id: 3775 Signed-off-by: Werner Koch <[email protected]>
| * core: New encryption flag GPGME_ENCRYPT_WANT_ADDRESS.Werner Koch2018-04-175-10/+94
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_ENCRYPT_WANT_ADDRESS): New flag. * src/engine-gpg.c (add_arg_recipient): New. (add_arg_recipient_string): New. (append_args_from_recipients): Call new helper function. (append_args_from_recipients_string): Ditto. * src/gpgme-json.c (op_encrypt): Add flag "want-address". -- Signed-off-by: Werner Koch <[email protected]>
| * core: Add extended versions of the encrypt functions.Werner Koch2018-04-1715-145/+519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_encrypt_ext_start) New. (gpgme_op_encrypt_ext): New. (gpgme_op_encrypt_sign_ext_start): New. (gpgme_op_encrypt_sign_ext): New. * src/libgpgme.vers, tests/run-encrypt.c: Add them. * src/encrypt.c (encrypt_start): Add arg recpstring. (gpgme_op_encrypt): Factor code out to ... (gpgme_op_encrypt_ext): new function with new arg recpstring. (gpgme_op_encrypt_start): Factor code out to ... (gpgme_op_encrypt_ext_start): new function with new arg recpstring. * src/encrypt-sign.c (encrypt_sign_start): Add arg recpstring. (gpgme_op_encrypt_sign): Factor code out to ... (gpgme_op_encrypt_sign_ext): new function with new arg recpstring. (gpgme_op_encrypt_sign_start): Factor code out to ... (gpgme_op_encrypt_sign_ext_start): new function with new arg recpstring. * src/engine-backend.h (struct engine_ops): Change fields encrypt and encrypt_sign. * src/engine.c (_gpgme_engine_op_encrypt): Add arg recpstring and pass to engine. (_gpgme_engine_op_encrypt_sign): Ditto. * src/engine-gpg.c (append_args_from_recipients_string): New. (gpg_encrypt): Add arg recpstring and call new function as needed. (gpg_encrypt_sign): Ditto. * src/engine-gpgsm.c (set_recipients_from_string): New. (gpgsm_encrypt): Add arg recpstring and call new function as needed. * src/engine-uiserver.c (set_recipients_from_string): New. (uiserver_encrypt): Add arg recpstring and call new function as needed. * tests/run-encrypt.c (xstrdup): New. (main): Add option --keystring. * src/gpgme-json.c (get_keys): Simplify. (op_encrypt): Modify to make use of the extended encrypt function. -- This new feature can be used to avoid the need for a key lookup and thus several extra calls to the backend. Note that run-test uses a semicolon as delimiter because that make testing the feature on the command line much easier. Signed-off-by: Werner Koch <[email protected]>
| * core: Tweak STATUS_FAILURE handling.Werner Koch2018-04-122-4/+14
| | | | | | | | | | | | | | | | | | * src/op-support.c (_gpgme_parse_failure): Ignore failures with location "gpg-exit". * tests/gpg/t-verify.c (main): Adjust for the now working checking of the second key. Signed-off-by: Werner Koch <[email protected]>
| * core: For a failed verification return the sig's fingerprint.Werner Koch2018-04-121-2/+19
| | | | | | | | | | | | | | | | | | | | | | * src/verify.c (parse_new_sig): Parse the new ERRSIG fpr. -- This works only when the signatures features an ISSUER_FPR sub-packet and with GnuPG >= 2.2.7. If that is not the case the keyid is kept in the FPR field. Signed-off-by: Werner Koch <[email protected]>
| * tests: Avoid segv in run-verify due to Policy URLsWerner Koch2018-04-121-9/+16
| | | | | | | | | | | | * tests/run-verify.c (print_result): Take care of Policy URLs. Signed-off-by: Werner Koch <[email protected]>
| * tests: Add another check to gpg/t-verify.Werner Koch2018-04-121-52/+84
| | | | | | | | | | | | | | | | | | * tests/gpg/t-verify.c (PGM): New. Use it instead of __FILE__. (test_sig1_plus_unknown_key): New test signature. (check_result): Allow checking of several signatures. (main): Check a signature with a know and an unknown key. Signed-off-by: Werner Koch <[email protected]>
| * core: Add new context flag "no-symkey-cache".Werner Koch2018-04-127-14/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.c (gpgme_set_ctx_flag): Set flag. (gpgme_get_ctx_flag): Get flag. * src/context.h (struct gpgme_context): Add field no_symkey_cache. * src/engine-gpg.c (struct engine_gpg): Ditto. (gpg_set_engine_flags): Set flag. (build_argv): Pass option --no-symkey-cache to gpg. * tests/run-decrypt.c (print_result): Fix segv for symmetric messages. (main): New option --no-symkey-cache. * tests/run-encrypt.c (main): New option --no-symkey-cache. Signed-off-by: Werner Koch <[email protected]>
* | js: Initial commit for JavaScript Native Messaging API[email protected]2018-04-1014-1/+472
|/ | | | | | | | | -- Note this code misses all the legal boilerplate; please add this as soon as possible and provide a DCO so we can merge it into master. I also removed the dist/ directory because that was not source code.
* qt: Add test for resetting config valueAndre Heinecke2018-04-041-1/+33
| | | | | | | | * lang/qt/tests/t-config.cpp (CryptoConfigTest::testDefault): New. -- There is a bug around here somewhere. This test does not show it :-(
* Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgmeBen McGinnes2018-03-298-58/+548
|\ | | | | | | | | * Also fixed a small grammatical error highlighted by a merge conflict (in the python bindings howto).