aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Add export options "export-pka" and "export-dane".Werner Koch2016-07-074-15/+179
| | | | | | | | | | | | * g10/options.h (EXPORT_PKA_FORMAT): New. * g10/keylist.c (list_keyblock_pka): Do not use DANE flag. * g10/export.c: Include zb32.h. (parse_export_options): Add options "export-pka" and "export-dane". (do_export): Do not armor if either of these option is set. (print_pka_or_dane_records): New. (do_export_stream): Implement new options. Signed-off-by: Werner Koch <[email protected]>
* gpg: Split a too large export function.Werner Koch2016-07-071-271/+290
| | | | | | | * g10/export.c (do_export_stream): Factor some code out to ... (do_export_one_keyblock): new. Signed-off-by: Werner Koch <[email protected]>
* gpgscm: Capture output of spawned processes.Justus Winter2016-07-072-6/+8
| | | | | | | | | * tests/gpgscm/tests.scm (call-check): Capture stdout and stderr, and return stdout if the child exited successfully, or include stderr in the error. * tests/openpgp/version.scm: Demonstrate this by checking the stdout. Signed-off-by: Justus Winter <[email protected]>
* doc: Escape file names in generated macros.Werner Koch2016-07-061-11/+31
| | | | | | | | | | * doc/mkdefsinc.c (print_filename): New. (main): Use it here. -- Our Jenkins uses an @ in directory names and thus our builds break. Signed-off-by: Werner Koch <[email protected]>
* wks: Let the server take the encrytion key from the file.Werner Koch2016-07-061-15/+27
| | | | | | | | | | * tools/gpg-wks-server.c (encrypt_stream): Change arg 'fingerprint' to 'keyfile'. (store_key_as_pending): Add arg 'r_fname' to make of the keyfile. (send_confirmation_request): Add arg 'keyfile'. (process_new_key): Pass on the name of the keyfile. Signed-off-by: Werner Koch <[email protected]>
* gpg: New options --recipient-file and --hidden-recipient-file.Werner Koch2016-07-0613-81/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oRecipientFile, oHiddenRecipientFile): New. (opts): Add options --recipient-file and --hidden-recipient-file. (main): Implement them. Also remove duplicate code from similar options. * g10/keydb.h (PK_LIST_FROM_FILE): New. (PK_LIST_SHIFT): Bump up. * g10/pkclist.c (expand_group): Take care of PK_LIST_FROM_FILE. (find_and_check_key): Add and implement arg FROM_FILE. (build_pk_list): Pass new value for new arg. * g10/getkey.c (get_pubkey_fromfile): New. * g10/gpgv.c (read_key_from_file): New stub. * g10/test-stubs.c (read_key_from_file): New stub. * g10/server.c (cmd_recipient): Add flag --file. * g10/import.c (read_key_from_file): New. * tests/openpgp/defs.scm (key-file1): New. (key-file2): New. * tests/openpgp/setup.scm: Add their private keys and import the key-file1. * tests/openpgp/encrypt.scm: Add new test. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --no-keyring.Werner Koch2016-07-062-8/+27
| | | | | | | | * g10/gpg.c (oNoKeyring): New. (opts): Add "--no-keyring". (main): Do not register any keyring if the option is used. Signed-off-by: Werner Koch <[email protected]>
* gpg: Document use of node flags in import.c and remove unused args.Werner Koch2016-07-061-117/+104
| | | | | | | | | | | | | | | | | * g10/import.c (NODE_GOOD_SELFSIG): New. Use instead of 1. (NODE_BAD_SELFSIG): New. Use instead of 2. (NODE_DELETION_MARK): New. Use instead of 4. (NODE_FLAG_A): New. Use to mark new nodes in merge_blocks. (chk_self_sigs): Remove unused args FNAME and PK. (import_one): Adjust call. Simplify error return because chk_self_sigs does not return an error code. (append_uid, append_key, merge_sigs, merge_keysigs): Remove unsued args FNAME and KEYID. (merge_blocks, import_one, import_secret_one) (import_revoke_cert): Remove unused arg FNAME. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Get rid of an unused arg in a function in getkey.c.Werner Koch2016-07-061-10/+7
| | | | | | | * g10/getkey.c (pk_from_block): Remove unused arg CTX. Change all callers. Signed-off-by: Werner Koch <[email protected]>
* gpg: Change calling convention for a function in getkey.cWerner Koch2016-07-061-37/+40
| | | | | | | | | * g10/getkey.c (merge_selfsigs): Remove arg CTX. Add args REQ_USAGE and WANT_EXACT. (finish_lookup): Adjust caller. Set LOOKUP_NOT_SELECTED here... (lookup): and not here. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix possible out-of-bounds read in is_armored.Werner Koch2016-07-051-5/+11
| | | | | | | | | * g10/armor.c (check_input): Call is_armored only if LEN >= 2. (unarmor_pump): Use a 2 byte buffer for is_armored. -- Fixes-commit: 605276ef8cd449bfd574ae6c498fa5d7d265c5c7 Signed-off-by: Werner Koch <[email protected]>
* tests: Honor environment variable 'TMP'.Justus Winter2016-07-053-4/+22
| | | | | | | | | | | | | | This fixes problems with long socket names, e.g. when doing distcheck. * tests/gpgscm/tests.scm (path-join): New function. (with-temporary-working-directory): Honor 'TMP'. (make-temporary-file): Likewise. * tests/migrations/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. * tests/openpgp/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve robustness and compatibility.Justus Winter2016-07-051-2/+8
| | | | | | | * tests/gpgscm/ffi.c (do_getenv): Avoid gccism. (do_mkdtemp): Handle errors. Signed-off-by: Justus Winter <[email protected]>
* tests/migrations: Fix distcheck.Justus Winter2016-07-0514-324/+442
| | | | | | | | | | | | | | | | | * tests/migrations/Makefile.am (TESTS): Rename test. (TEST_FILES): Update list. (EXTRA_DIST): Add common.scm. * tests/migrations/common.scm (GPGTAR): New variable. (dearmor): Rename and untar archive. * tests/migrations/extended-private-key-format.scm: Rename. (setup): Update. * tests/migrations/extended-pkf.tar.asc: New file. * tests/migrations/extended-private-key-format.gpghome: Delete. * tests/migrations/from-classic.gpghome: Likewise. * tests/migrations/from-classic.scm (setup): Update. * tests/migrations/from-classic.tar.asc: New file. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Provide --create and --extract.Justus Winter2016-07-052-10/+28
| | | | | | | | | * tools/gpgtar.c (cmd_and_opt_values): New values. (opts): New actions. (parse_arguments): Handle new actions. * tests/openpgp/gpgtar.scm: Test new interface. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix out-of-bounds read.Justus Winter2016-07-051-2/+4
| | | | | | * g10/armor.c (use_armor_filter): We need two bytes for 'is_armored'. Signed-off-by: Justus Winter <[email protected]>
* wks: Add command --read to gpg-wks-client.Werner Koch2016-07-041-2/+15
| | | | | | | | | | | | | | | | | | | * tools/gpg-wks-client.c (aRead): New. (opts): Add command "--read". (main): Implement that. -- This command allows to process alread decrypted Web Key Service messages. It can for example be used in /etc/mailcap --8<---------------cut here---------------start------------->8--- application/vnd.gnupg.wks; gpg-wks-client -v --read --send;\ needsterminal; description=Web Key Service message --8<---------------cut here---------------end--------------->8--- to allow Mutt to process confirmation requests. Signed-off-by: Werner Koch <[email protected]>
* tests: Add a gettime test for sizeof (time_t) > 4.Werner Koch2016-07-041-0/+6
| | | | | | * common/t-gettime.c (test_isotime2epoch): Add 4 more tests. Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid spurious failures on keyblocks with no or only deleted nodes.Werner Koch2016-07-031-0/+1
| | | | | | | * g10/import.c (write_keyblock_to_output): Clear ERR on success. -- Signed-off-by: Werner Koch <[email protected]>
* wks: Let the client only export the requested UID.Werner Koch2016-07-032-6/+17
| | | | | | * tools/gpg-wks-client.c (get_key): Export only the requested uid. Signed-off-by: Werner Koch <[email protected]>
* tools: Call sendmail directly from the wks tools.Werner Koch2016-07-027-17/+279
| | | | | | | | | | | | | | | | | | | | * tools/send-mail.c, tools/send-mail.h: New. * tools/wks-util.c: New. * tools/Makefile.am (gpg_wks_server_SOURCES): Add them. (gpg_wks_client_SOURCES): Ditto. * tools/gpg-wks.h (opt): Add fields use_sendmail and output. * tools/gpg-wks-client.c: Add options --send and --output. Rename command --send to --create. (command_send, send_confirmation_response): Output via wks_send_mime. * tools/gpg-wks-server.c: Add options --send and --output. (send_confirmation_request): Output via wks_send_mime. (check_and_publish): Add hack for name-value bug. -- With this code, a dedicated user on the server along with a procmail script, it was possible to run a basic test. Signed-off-by: Werner Koch <[email protected]>
* tools: Add options to gpg-wks-server.Werner Koch2016-07-022-7/+135
| | | | | | | | | | | | * tools/gpg-wks.h (opt): Add 'default_from' and 'extra_headers'. * tools/gpg-wks-server.c (oFrom, oHeader): New. (parse_arguments): Set them and check args. (get_submission_address): New. (send_confirmation_request): Set correct From address. Add extra headers. (process_new_key): Return an error code. Signed-off-by: Werner Koch <[email protected]>
* tools: Extend mime-maker.c:mime_maker_add_header.Werner Koch2016-07-021-11/+54
| | | | | | | | * tools/mime-maker.c (add_header): Check header name and allow name-value syntax. (mime_maker_add_header): Add mode for a syntax check. Signed-off-by: Werner Koch <[email protected]>
* doc: Describe filter expressions.Werner Koch2016-07-022-9/+124
| | | | | | | * doc/gpg.texi: Remove some superfluous .E. (FILTER EXPRESSIONS): New. Signed-off-by: Werner Koch <[email protected]>
* yat2m: Fix table formatting.Werner Koch2016-07-021-1/+3
| | | | | | | * doc/yat2m.c (proc_texi_cmd): Use .TQ for @itemx. Print a .P at the end of a level 0 table. Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --export-filterWerner Koch2016-07-014-5/+141
| | | | | | | | | | | | | | | * g10/gpg.c (oExportFilter): New. (opts): Add --export-filter. (main): Handle option. * g10/export.c: Include recsel.h, init.h, and mbox-util.h. (export_keep_uid): New global var. (cleanup_export_globals): New. (parse_and_set_export_filter): New. (filter_getval): New. (apply_keep_uid_filter): New. (do_export_stream): Apply filter if set. Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --import-filterWerner Koch2016-07-014-1/+182
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oImportFilter): New. (opts): Add --import-filter. (main): Handle option. * g10/import.c: Include recsel.h, init.h, and mbox-util.h. (import_keep_uid): New global var. (cleanup_import_globals): New. (parse_and_set_import_filter): New. (filter_getval): New. (apply_keep_uid_filter): New. (import_one): Apply filter if set. -- Funny new option. It can for example be used to export a key with only one user id: gpg --no-options --import --import-options import-export \ --import-filter keep-uid='[email protected]' \ < full-key.pub > key-with-one-uid.pub More features will eventually be added. Signed-off-by: Werner Koch <[email protected]>
* gpg: Allow to cache the mbox in a user id struct.Werner Koch2016-07-012-0/+2
| | | | | | | | | | * g10/packet.h (PKT_user_id): Add field 'mbox'. * g10/free-packet.c (free_user_id): Free that. -- This will be required by the coming import filter. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make sure a user ID packet has always a terminating Nul in memory.Werner Koch2016-07-012-2/+2
| | | | | | | | * g10/keygen.c (write_uid): Avoid overflow. -- Also the actual length if the user ID is given by LEN, using NAME diretcly is often more convenient.
* common: Add function to select records etc.Werner Koch2016-07-014-2/+1023
| | | | | | | * common/recsel.c, common/recsel.h: New. * common/t-recsel.c: New. Signed-off-by: Werner Koch <[email protected]>
* common: Smart up register_mem_cleanup_func.Werner Koch2016-07-011-0/+4
| | | | | | * common/init.c (register_mem_cleanup_func): Avoid double registration. Signed-off-by: Werner Koch <[email protected]>
* common: Annotate semi-static allocation.Justus Winter2016-07-011-0/+2
| | | | | | * common/argparse.c (optfile_parse): Allow string arguments to leak. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-07-011-2/+4
| | | | | | * g10/keyserver.c (parse_keyserver_uri): Free URI. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Annotate semi-static allocation.Justus Winter2016-07-011-1/+6
| | | | | | | * tools/gpgtar.c (shell_parse_argv): Annotate argument vector as leaked. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-07-011-0/+1
| | | | | | | * g10/import.c (transfer_secret_keys): Release curve from the previous iteration. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix build with disabled kbnode cache.Justus Winter2016-07-011-2/+2
| | | | | | | * g10/kbnode.c (release_unused_nodes): Fix build with disabled kbnode cache. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-07-011-4/+6
| | | | | | * g10/trustdb.c (tdb_get_validity_core): Fix kbnode leak. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-07-011-3/+3
| | | | | | * g10/keygen.c (keygen_set_std_prefs): Fix memory leak. Signed-off-by: Justus Winter <[email protected]>
* Fix trivial memory leaks in tests.Justus Winter2016-07-012-0/+3
| | | | | | | * dirmngr/t-ldap-parse-uri.c (check_ldap_escape_filter): Free result. * g10/t-stutter.c (main): Free file name. Signed-off-by: Justus Winter <[email protected]>
* tools: Fix trivial memory leak.Justus Winter2016-06-301-0/+10
| | | | | | * tools/gpg-connect-agent.c (main): Fix trivial memory leak. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-06-301-0/+9
| | | | | | * g10/export.c (do_export_stream): Free secret parameters. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-06-301-0/+1
| | | | | | * g10/keygen.c (read_parameter_file): Free 'line'. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-06-301-0/+1
| | | | | | * g10/sign.c (mk_notation_policy_etc): Free 'mbox'. Signed-off-by: Justus Winter <[email protected]>
* common: Fix memory leak.Justus Winter2016-06-301-0/+1
| | | | | | * g10/textfilter.c (copy_clearsig_text): Free buffer. Signed-off-by: Justus Winter <[email protected]>
* common: Fix memory leak.Justus Winter2016-06-301-3/+2
| | | | | | | * common/iobuf.c (iobuf_set_partial_body_length_mode): Only create context if necessary. Signed-off-by: Justus Winter <[email protected]>
* common: Fix memory leak.Justus Winter2016-06-301-1/+5
| | | | | | * common/simple-pwquery.c (agent_open): Free socket path. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix keybox-related memory leaks.Justus Winter2016-06-302-7/+25
| | | | | | | | | | | | | * g10/keydb.c (keydb_release): Clear keyblock cache. (keydb_get_keyblock): Revert previous change. * kbx/keybox-blob.c (create_blob_finish): Free previous buffer, free fixups after applying them. (_keybox_release_blob): Free buffer. Currently, the buffer has been extracted before the keybox is released, but this is the right thing to do here. Fixes-commit: c57501cc Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-06-301-0/+4
| | | | | | * g10/compress.c (release_context): Free buffers. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-06-301-0/+1
| | | | | | * g10/sign.c (write_plaintext_packet): Free packet. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-06-301-2/+0
| | | | | | | * g10/mainproc.c (release_list): Do not exit early if list is NULL, there are other resources that must be released. Signed-off-by: Justus Winter <[email protected]>