summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* example: revoke UIDben/howto-update-02Ben McGinnes2018-03-291-0/+62
| | | | * Script to revoke a UID on an existing key.
* docs: python bindings howtoBen McGinnes2018-03-291-25/+53
| | | | * Added section on revoking UIDs.
* example: key signingBen McGinnes2018-03-291-0/+63
| | | | * Added script for signing or certifying keys.
* doc: python bindings howtoBen McGinnes2018-03-291-1/+1
| | | | * Fixed a typo.
* docs python bindings howtoBen McGinnes2018-03-291-16/+19
| | | | | * PEP8 compliance: a collection of minor edits across multiple example code snippets.
* example: add user IDBen McGinnes2018-03-291-0/+62
| | | | * Added script to add a UID to an existing key.
* doc: python bindings howtoBen McGinnes2018-03-271-6/+6
| | | | * Fixed some minor PEP8 compliance issues in the key creation examples.
* example: key creationBen McGinnes2018-03-271-0/+95
| | | | | | | | * Script to generate a new key with encryption subkey taking input from interactive prompts. * Will also take a passphrase via pinentry and uses passphrase caching of five minutes when used in conjunction with the temp homedir script.
* script: temp homedir configBen McGinnes2018-03-271-2/+9
| | | | * added passphrase caching of 5 minutes.
* doc: python bindings howtoBen McGinnes2018-03-251-0/+1
| | | | | | | | * Testing the addition of a HTML header set in org-mode in order to had RSS update links for files. * This should work with any [X]HTML export from current versions of Org-Mode, but if it also works on website generated pages then it'll tick off one of the wishlist itmes.
* script: temp homedirhowto-update-01Ben McGinnes2018-03-251-1/+1
| | | | * Fixed whitespace.
* doc: python bindings howtoBen McGinnes2018-03-251-0/+4
| | | | | * Added a reference to new script which will setup a temporary homedir for a user.
* script: temporary homedir creationBen McGinnes2018-03-251-0/+119
| | | | | | | | | | * Script to create a temporary gnupg homedir in the user's directory for testing or scripting purposes. * Creates a hidden directory on POSIX systems with the correct permissions (700). * Creates a gpg.conf in that directory containing the same configuration options as used in the "Danger Mouse" example in the HOWTO with the correct permissions (600).
* doc: python bindings howtoBen McGinnes2018-03-251-4/+4
| | | | | * Fixed the plaintext, result and verify_result references in the decryption section.
* core: Need to increase an array in the gpg engine.Werner Koch2018-03-231-1/+1
| | | | | | | * src/engine-gpg.c (build_argv): Allcate one slot more for ARGV. -- Fixes-commit: b9000bc293164ff62efa7e91e5cf6d5fc19d482f
* json: Use a request origin of "browser".Werner Koch2018-03-231-0/+1
| | | | | | * src/gpgme-json.c (_create_new_context): Set flag. Signed-off-by: Werner Koch <wk@gnupg.org>
* core: New gpgme_set_ctx_flag "request-origin".Werner Koch2018-03-2315-8/+176
| | | | | | | | | | | | | | | | | | | | | | | | * src/context.h (gpgme_context): Add 'request_origin'. * src/gpgme.c (gpgme_release): Free that field. (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add "request-origin". * src/engine-backend.h (engine_ops): Add 'set_engine_ops' func ptr and adjust all users. * src/engine.c (_gpgme_engine_set_engine_flags): New. * src/op-support.c (_gpgme_op_reset): Call that func. * src/engine-gpg.c (struct engine_gpg): Add 'request_origin'. (gpg_set_engine_flags): New. (_gpgme_engine_ops_gpg): Hook it. (build_argv): Use command line option --request-origin. * src/engine-gpgsm.c (struct engine_gpgsm): Add 'request_origin'. (gpgsm_set_engine_flags): New. (_gpgme_engine_ops_gpgsm): Hook it. (start): Send OPTION "request-origin". * src/engine-assuan.c (struct engine_llass): Add 'request_origin'. (gpgsm_set_engine_flags): New. (_gpgme_engine_ops_assuan): Hook it. (start): Send OPTION "pretend-request-origin". Signed-off-by: Werner Koch <wk@gnupg.org>
* build: Allow building with released libgpg-error.Werner Koch2018-03-231-0/+4
| | | | | | | * src/gpgme-json.c (add_base64_to_object): Return an error if building with an older libgpg-error. Signed-off-by: Werner Koch <wk@gnupg.org>
* Merge branch 'json-tool'Werner Koch2018-03-236-2/+3196
|\
| * json: Finish op:encrypt.Werner Koch2018-03-231-12/+171
| | | | | | | | | | | | | | | | | | | | * src/gpgme-json.c (add_base64_to_object): New. (data_from_base64_string): New. (op_encrypt): Employ them. (process_request): Print unformated json. -- Signed-off-by: Werner Koch <wk@gnupg.org>
| * json: Add a new function to cJSON.Werner Koch2018-03-232-0/+13
| | | | | | | | * src/cJSON.c (cJSON_CreateStringConvey): New.
| * json: Use gpgrt_argparse instead of argsparse.cjson-toolWerner Koch2018-03-212-10/+21
| | | | | | | | | | | | | | | | | | | | | | * src/gpgme-json.c: Remove header argparse.h. Define GPGRT_ENABLE_ARGPARSE_MACROS. (interactive_repl): Replace strusage by gpgrt_strusage. (my_strusage): Add SPDX level. (main): Switch to gpgrt_argparse stuff but keep very limited functionality when building with an older libgpg-error. Signed-off-by: Werner Koch <wk@gnupg.org>
| * json: Implement op:encryptWerner Koch2018-03-201-61/+393
| | | | | | | | Signed-off-by: Werner Koch <wk@gnupg.org>
| * Merge branch 'master' into json-toolWerner Koch2018-03-209-12/+39
| |\
| * | json: Add framework for the gpgme-json toolWerner Koch2018-03-163-2/+833
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme-json.c: New. * src/Makefile.am (bin_PROGRAMS): Add gpgme-json. (gpgme_json_SOURCES, gpgme_json_LDADD): New. Signed-off-by: Werner Koch <wk@gnupg.org>
| * | core: Adjust cJSON code for use in GPGME.Werner Koch2018-03-162-36/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/cJSON.c: Remove util.h. Use gpgrt alloc functions. (cJSON_Delete): Do not clobber ERRNO. (cJSON_AddItemToObject): Return OBJECT or NULL. (cJSON_AddNullToObject): New. (cJSON_AddTrueToObject): New. (cJSON_AddFalseToObject): New. (cJSON_AddBoolToObject): New. (cJSON_AddNumberToObject): New. (cJSON_AddStringToObject): New. * src/cJSON.h (cJSON__h): Replace macro by cJSON_h for C compliance. (cJSON_AddNullToObject): Remove macro. (cJSON_AddTrueToObject): Remove macro. (cJSON_AddFalseToObject): Remove macro. (cJSON_AddBoolToObject): Remove macro. (cJSON_AddNumberToObject): Remove macro. (cJSON_AddStringToObject): Remove macro. -- The gpgrt malloc functions are used so that we can easily mix memory returned by gpgrt (e.g. es_read_line) with memory returned from the JSON function. In general that is not needed but on Windows it makes a difference if the gpgme DLL is linked to a different C runtime than the application. The macros have been replaced to allow error checking (i.e out of core) for these functions. More error checking should be implemented instead of silently creating objects which are not as requested. Signed-off-by: Werner Koch <wk@gnupg.org>
| * | core: Import cJSON code from the payproc project.Werner Koch2018-03-143-0/+1734
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/cJSON.c: New. * src/cJSON.h: New. * src/cJSON.readme: New. -- This is a copy of the code from the payproc commit af5d6b4f820ee19e246a2cab6f56465fe91f1233. The code was originally added to payproc with the commit below. Signed-off-by: Werner Koch <wk@gnupg.org> =============================================== commit 7ae7ef29bc5ec19e005e6a5a739233d655f3f05f Author: Werner Koch <wk@gnupg.org> AuthorDate: Wed Apr 2 09:01:42 2014 +0200 Commit: Werner Koch <wk@gnupg.org> CommitDate: Wed Apr 2 09:12:02 2014 +0200 Simplify cJSON and add new macros. * src/cJSON.h: Re-indented. (cjson_t): New. (cjson_is_): New macros. * src/cJSON.c: Re-indented. Include errno.h and our util.h. (ep): Remove global var. (cJSON_GetErrorPtr): Remove. (cJSON_strcasecmp): Cast args for use with tolower. (cJSON_malloc, cJSON_free): Remove. Change callers to use xtrymalloc and xfree. (cJSON_InitHooks): Remove. (cJSON_strdup): Remove. Change callers to use xtrystrdup. (cJSON_New_Item): Simplify. (cJSON_ParseWithOpts, cJSON_Parse): Add arg R_ERROFF. (parse_string, parse_value, parse_array, parse_object): Add arg EP. -- cJSON has been taken from cjson-code-58.zip. The README file has been renamed to cJSON.readme and the files have been changed to GNU coding standards. Because that parser is small enough to be source copied it does not make sense to treat it as a library and I changed the memory allocation functions to the usual xmalloc ones. The only external dependency now is out util.h which declares those functions. The lowercase cjson_t better fits into our coding style as well as the new macros. Thanks to Dave Gamble for this nice parser. ===============================================
* | | doc: python bindings howtoBen McGinnes2018-03-221-1/+1
| | | | | | | | | | | | * Fixed table.
* | | doc and examples: python bindings HOWTOBen McGinnes2018-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added GPGME Python bindings HOWTO in Australian/British English. ** en-US "translation" still to be done. * Added several example scripts comprised of the "Basic Functions" section of the HOWTO (plus the work-around at the end). ** As these scripts are very basic examples they are released under both the GPLv2+ and the LGPLv2.1+ (just like GPGME itself). Signed-off-by: Ben McGinnes <ben@adversary.org>
* | | Merge branch 'ben/docs/2018-03' of ssh+git://playfair.gnupg.org/git/gpgme ↵Ben McGinnes2018-03-2217-42/+2209
|\ \ \ | |_|/ |/| | | | | into ben/docs/2018-03
| * | examples: multi-key selection operationsben/docs/2018-03Ben McGinnes2018-03-223-190/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Temporarily removing multi-key selection based examples. * There are a few issues with getting the key selections to play nicely with gpg.Context().keylist object types. * Will troubleshoot them separately and restore them when that's worked out, but I don't want these more complicated examples to delay merging the HOWTO with master.
| * | example: group encryptionBen McGinnes2018-03-221-1/+1
| | | | | | | | | | | | * Troubleshooting.
| * | examples: encryptionBen McGinnes2018-03-222-2/+2
| | | | | | | | | | | | * Fixed two incorrect Context() objects.
| * | example: key selectionBen McGinnes2018-03-221-1/+0
| | | | | | | | | | | | * Removed extraneous blank line.
| * | example: key selectionBen McGinnes2018-03-221-0/+52
| | | | | | | | | | | | | | | | | | * Similar to group-key-selection.py, but does not use an existing group from gpg.conf; instead takes multiple key IDs, fingerprints or patterns on the command line and adds them to a keylist object.
| * | example: sign and encrypt to groupBen McGinnes2018-03-221-0/+83
| | | | | | | | | | | | | | | | | | | | | * Begins to string together some of the simpler examples to do more useful things. * Signs and encrypts a file while encrypting to every key in a group specified in the gpg.conf file.
| * | example: group key selectionBen McGinnes2018-03-221-0/+56
| | | | | | | | | | | | | | | * Example of preparing a keylist object using an existing group line from the gpg.conf file.
| * | example groups work aroundBen McGinnes2018-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | * Updated usage so it only references importing the final list of lists produced. Trying to use some of the mid-points can have unpredictable results (this is part of the problem with work arounds).
| * | example: groupsBen McGinnes2018-03-221-0/+6
| | | | | | | | | | | | * Added a docstring.
| * | example: verify signaturesBen McGinnes2018-03-221-0/+64
| | | | | | | | | | | | | | | * Added example for verifying detached signatures against the files they're the signatures for.
| * | example: verify signed fileBen McGinnes2018-03-221-0/+61
| | | | | | | | | | | | * Added example to verify normal and clearsigned files.
| * | doc: python bindings howtoBen McGinnes2018-03-221-1/+1
| | | | | | | | | | | | * Fixed minor error in one of the verification examples.
| * | example: detach sign fileBen McGinnes2018-03-221-0/+64
| | | | | | | | | | | | * Added example to make detached signatures of a file with key selection.
| * | example: encrypt-sign-file.pyBen McGinnes2018-03-221-2/+2
| | | | | | | | | | | | * Adjusted the doc string.
| * | examples: doc stringsBen McGinnes2018-03-222-2/+4
| | | | | | | | | | | | * Fixed minor errors in two doc strings.
| * | example: clear signingBen McGinnes2018-03-221-0/+56
| | | | | | | | | | | | * Added example to clear sign a file with signing key selection.
| * | doc: python bindings howtoBen McGinnes2018-03-221-15/+12
| | | | | | | | | | | | * deconstructed and fixed all three signing methods.
| * | example: sign fileBen McGinnes2018-03-211-0/+63
| | | | | | | | | | | | | | | | | | | | | * Similar to encrypt file except for signing a file in normal mode. * Noticed additional changes to be made to the howto to match this, but they will have to wait due to a power outage (currently running on battery and a mobile connection, but that won't last).
| * | doc: python bindings howtoBen McGinnes2018-03-201-2/+2
| | | | | | | | | | | | * Fixed typos in examples.
| * | example: keycountBen McGinnes2018-03-201-1/+1
| | | | | | | | | | | | * Fixed missing parenthesis.