aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* g10: Skip signing keys where no secret key is available.dkg/T1967Simon Arlott2017-04-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/getkey.c (finish_lookup): When requiring PUBKEY_USAGE_SIG, skip over keys where no signing key is available. -- This should only be relevant when gpg is required to choose which key to sign with -- if verifying signatures, we already know which subkey to look at, and indeed gpg doesn't seem to have a problem with this. This patch comes from https://bugs.gnupg.org/gnupg/file793/sign-fix.patch I (dkg) have reviewed and tested it with missing local keys, and it makes sense to me as the default behavior. If the user has the secret key for a signing-capable subkey available and the command is --sign, it should be used. If the user has explicitly specified a subkey that happens to be missing (e.g. with the trailing ! for --default-key 0x${FPR}!) then this does not override that behavior (the signature will still fail). GnuPG-bug-id: 1967 Debian-bug-id: 834922 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Fix aliasing problem in dns.c.NIIBE Yutaka2017-04-251-16/+18
| | | | | | | | | | * dirmngr/dns.c (dns_ai_setent): Care about aliasing. -- Co-authored-by: Tomas Mraz GnuPG-bug-id: 3105 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Remove *.conf.tmpl from Makefile.NIIBE Yutaka2017-04-251-1/+0
| | | | | | | | | | * tests/openpgp/Makefile.am (TEST_FILES): Remove gpg.conf.tmpl and gpg-agent.conf.tmpl. -- Fixes-commit: 06a177ceea529269a7404740c60416bd6a4567b1 Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: invalidate the fd cache for keyring.NIIBE Yutaka2017-04-241-1/+6
| | | | | | | | | | * g10/keyring.c (keyring_search_reset): Don't keep the FD cache. -- GnuPG-bug-id: 3096 Fixes-commit: 5556eca5acd46983bff0b38a1ffbc2f07fbaba9f Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Enable wildcard expansion with mingw-w64Andre Heinecke2017-04-241-0/+3
| | | | | | | | | | | * g10/gpg.c: Define _dowildcard = -1; -- If this value is defined wildcard support in the c runtime is enabled again. This fixes a regression caused by switching to mingw 3.0 Signed-off-by: Andre Heinecke <[email protected]>
* tests: Fix Python detection.Justus Winter2017-04-241-9/+11
| | | | | | | | | | | * tests/gpgme/gpgme-defs.scm (python): Fix Python detection. -- In 25e6444b3f4601c7821beab06bc4520deacb007b we changed the way GPGME creates the build directory for the Python bindings. We now use the basename of the interpreter as an identifier, that means we have to get the base name right, a link to the same binary is not sufficient. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Refactor cell finalization.Justus Winter2017-04-241-24/+41
| | | | | | | | * tests/gpgscm/scheme.c (finalize_cell): Use switch, return whether the cell may be freed. (gc): Update callsite. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Tweak error message display.Justus Winter2017-04-241-2/+7
| | | | | | | * tests/gpgscm/init.scm (throw'): If the first argument to the error is a string, display it as such. Signed-off-by: Justus Winter <[email protected]>
* tests: Deduplicate and simplify code.Justus Winter2017-04-245-33/+24
| | | | | | | | | | | * tests/gpgme/gpgme-defs.scm (create-file): Move... * tests/gpgsm/gpgsm-defs.scm (create-file): ... likewise... * tests/openpgp/defs.scm (create-file): Here. (create-gpghome): Use 'create-file'. * tests/openpgp/gpg-agent.conf.tmpl: Delete file. * tests/openpgp/gpg.conf.tmpl: Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix test.Justus Winter2017-04-241-2/+2
| | | | | | * tests/gpgscm/t-child.scm: Use 'string-length' on the string. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve syntax checking.Justus Winter2017-04-241-2/+5
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Make sure closure arguments are symbols. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Emit JUnit-style XML reports.Justus Winter2017-04-249-14/+256
| | | | | | | | | | | | | | | | | | * tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file. * tests/gpgscm/lib.scm (string-translate): New function. * tests/gpgscm/main.c (main): Load new file. * tests/gpgscm/tests.scm (dirname): New function. (test-pool): Record execution times, emit XML report. (test): Record execution times, record log file name, emit XML report. (run-tests-parallel): Write XML report. (run-tests-sequential): Likewise. * tests/gpgscm/xml.scm: New file. * tests/gpgme/Makefile.am (CLEANFILES): Add 'report.xml'. * tests/gpgsm/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make logging less verbose and more useful.Justus Winter2017-04-241-4/+5
| | | | | | | * tests/gpgscm/tests.scm (call-with-io): When being verbose, include the pid in the output, and avoid duplicating the command arguments. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make test framework less functional.Justus Winter2017-04-241-40/+35
| | | | | | | | | * tests/gpgscm/tests.scm (test-pool, tests): Previously, these methods updated objects by creating new updated copies of the object being manipulated. This made the code awkward without any benefit, therefore I change it to just update the object. Signed-off-by: Justus Winter <[email protected]>
* tests: Locate resources and scripts relative to top source dir.Justus Winter2017-04-2487-182/+208
| | | | | | | | | | | | -- Locate every resource and every script used in the tests using a path relative to the top of the source tree. This is a purely mechanical change, mostly done using regular expressions, with a few manual fixups here and there. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Move 'trace' and 'stringify'.Justus Winter2017-04-242-12/+12
| | | | | | | * tests/gpgscm/tests.scm (trace, stringify): Move... * tests/gpgscm/lib.scm: ... here. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Avoid fruitless garbage collection cycles.Justus Winter2017-04-242-8/+15
| | | | | | | | | * tests/gpgscm/scheme-private.h (CELL_MINRECOVER): New macro. * tests/gpgscm/scheme.c (_get_cell): Move the heuristic to get more cells... (gc): ... here where every caller benefits from the optimization. Signed-off-by: Justus Winter <[email protected]>
* g13: Fix for Solaris.NIIBE Yutaka2017-04-202-1/+4
| | | | | | | | | | * configure.ac: Check sys/mkdev.h. * g13/sh-dmcrypt.c: Include sys/mkdev.h. -- GnuPG-bug-id: 3098 Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix final close of LISTEN_FD.NIIBE Yutaka2017-04-181-3/+3
| | | | | | * dirmngr/dirmngr.c (handle_connections): Close LISTEN_FD. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix API difference for Windows.NIIBE Yutaka2017-04-181-9/+10
| | | | | | | | | * dirmngr/http.c (read_server, write_server): Use assuan_fd_t. (http_wait_response): Use FD2INT to get unsigned integer fd. (read_server, write_server): Likewise. (simple_cookie_read, simple_cookie_write): Use assuan_fd_t. Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: More minor change.NIIBE Yutaka2017-04-171-1/+0
| | | | | | * agent/command.c (cmd_pksign): Remove redundant assignment. Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Minor cleanup.NIIBE Yutaka2017-04-172-3/+0
| | | | | | | * agent/command-ssh.c (ssh_key_to_protected_buffer): Not touch ERR. * agent/command.c (cmd_genkey, cmd_import_key): Clean up. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Minor memory fix.NIIBE Yutaka2017-04-171-0/+2
| | | | | | * tests/openpgp/fake-pinentry.c (get_passphrase): Free the memory. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix parse_ring_trust.NIIBE Yutaka2017-04-171-1/+1
| | | | | | * g10/parse-packet.c (parse_ring_trust): Fix condition. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Minor fixes.NIIBE Yutaka2017-04-173-4/+5
| | | | | | | | | * g10/export.c (cleartext_secret_key_to_openpgp): No initialization. (do_export_one_keyblock): Initialize with GPG_ERR_NOT_FOUND. * g10/getkey.c (get_best_pubkey_byname): Add non-null check. * g10/tofu.c (tofu_set_policy): ERR initialize to 0. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix import/export filter property match.NIIBE Yutaka2017-04-171-1/+1
| | | | | | * g10/import.c (impex_filter_getval): Fix to "else if". Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Clean up error initialize/return.NIIBE Yutaka2017-04-144-6/+2
| | | | | | | | | | * agent/call-pinentry.c (start_pinentry): Return RC. * agent/command-ssh.c (ssh_handler_request_identities): Don't set ERR. * agent/findkey.c (try_unprotect_cb): Return ERR. (unprotect): Don't set RC. * agent/gpg-agent.c (handle_connections): Don't set fd. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: More fix for test program.NIIBE Yutaka2017-04-141-0/+4
| | | | | | * dirmngr/t-http.c (main): Care about no TLS. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: More fix for Windows.NIIBE Yutaka2017-04-131-6/+6
| | | | | | | | | * dirmngr/http.c (simple_cookie_read, simple_cookie_write): Only valid with HTTP_USE_NTBTLS. (_my_socket_new): Simply cast to int since it's for debug. (_my_socket_ref, _my_socket_unref): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix http.c for sockaddr_storage.NIIBE Yutaka2017-04-131-6/+7
| | | | | | | dirmngr/http.c (use_socks): Use sockaddr_storage. (my_sock_new_for_addr, connect_server): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix alignment of ADDR.NIIBE Yutaka2017-04-132-16/+19
| | | | | | | | | | | * dirmngr/dns-stuff.h (dns_addrinfo_s): Use struct sockaddr_storage for size and alignment. * dirmngr/dns-stuff.c (resolve_name_libdns): Follow the change. (resolve_dns_name): Use struct sockaddr_storage. (resolve_addr_standard, resolve_dns_addr): Likewise. (resolve_dns_addr): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix thread key type.NIIBE Yutaka2017-04-131-1/+1
| | | | | | * dirmngr/dirmngr.c (my_tlskey_current_fd): Use npth_key_t. Signed-off-by: NIIBE Yutaka <[email protected]>
* common, g10: Fix enumeration types.NIIBE Yutaka2017-04-132-14/+21
| | | | | | | | | | | | | | | | * common/openpgpdefs.h (CIPHER_ALGO_PRIVATE10, PUBKEY_ALGO_PRIVATE10) (DIGEST_ALGO_PRIVATE10, COMPRESS_ALGO_PRIVATE10): New. * g10/misc.c (map_pk_gcry_to_openpgp): Add type conversion. (map_cipher_openpgp_to_gcry, openpgp_cipher_algo_name) (openpgp_pk_test_algo2, map_md_openpgp_to_gcry) (pubkey_get_npkey): Add default handling. -- Compilers may emit code assuming the maximum value of enum type. According to OpenPGP specification, there are cases for private uses. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: More fix for Windows.NIIBE Yutaka2017-04-131-1/+5
| | | | | | | * dirmngr/dns.c (socket_fd_t, STDCALL): New. (dns_te_initname): Use. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix type of sock.NIIBE Yutaka2017-04-121-1/+1
| | | | | | * dirmngr/http.c (send_request): Use assuan_fd_t for SOCK. Signed-off-by: NIIBE Yutaka <[email protected]>
* tools: Fix condition for gpg-connect-agent.NIIBE Yutaka2017-04-121-1/+1
| | | | | | | | | | | * tools/gpg-connect-agent.c (start_agent): Add paren. -- The intention is comparing the error code depending opt.use_dirmngr. Considering C Operator Precedence, we should have paren here. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix possible null reference.NIIBE Yutaka2017-04-121-2/+3
| | | | | | * dirmngr/dns.c (dns_error_t dns_trace_fput): Check NULL. Signed-off-by: NIIBE Yutaka <[email protected]>
* common: Simplify format_text.NIIBE Yutaka2017-04-125-13/+12
| | | | | | | | | | | * common/stringhelp.c (format_text): Don't allow IN_PLACE formatting. * common/stringhelp.h: Change the API with no IN_PLACE. * common/t-stringhelp.c (test_format_text): Follow the change. * g10/gpgcompose.c (show_help): Likewise. * g10/tofu.c (format_conflict_msg_part1, ask_about_binding) (show_statistics, show_warning): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgscm: Fix test program.NIIBE Yutaka2017-04-121-2/+2
| | | | | | * tests/gpgscm/t-child.c (main): Fix for setmode. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix plus1_ns.NIIBE Yutaka2017-04-121-1/+4
| | | | | | | | | * dirmngr/dns.c (plus1_ns): Fix the initial implementation. -- Fixes-commit: 64904ce627b6b0661acf15b5b70103c4842bb0f3 Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Handle unexpected suspend/resume by CCID driver.NIIBE Yutaka2017-04-121-4/+16
| | | | | | | | | * scd/ccid-driver.c (bulk_in): Handle unexpected failure. -- GnuPG-bug-id: 3083 Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix dns-stuff.c in another way.NIIBE Yutaka2017-04-121-3/+2
| | | | | | | | | | * dirmngr/dns-stuff.c (T_CERT): Define our own. -- T_CERT may be defined by another enum type even if the value is same. Signed-off-by: NIIBE Yutaka <[email protected]>
* Revert "dirmngr: Fix dns-stuff.c."NIIBE Yutaka2017-04-121-0/+1
| | | | This reverts commit 1538523156be568046f632d1775eae30ea8bd556.
* dirmngr: Fix dns-stuff.c.NIIBE Yutaka2017-04-121-1/+0
| | | | | | | | | | | * dirmngr/dns-stuff.c: Don't include arpa/nameser.h. -- It is not needed at all. T_CERT may be defined by different type of ns_type. Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Simplify stream_read_cstring.NIIBE Yutaka2017-04-121-7/+1
| | | | | | | * agent/command-ssh.c (stream_read_cstring): Just call stream_read_string. Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Use a function to increment network short.NIIBE Yutaka2017-04-121-4/+13
| | | | | | | | | | | | | * dirmngr/dns.c (plus1_ns): New. (dns_p_push): Use it. -- On OpenBSD, htons and ntohs are expanded to GCC's statement expressions where local variable is allowed. Consecutive use of htons and ntohs causes problem of variable name. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Minor clean up for export.c.NIIBE Yutaka2017-04-111-19/+16
| | | | | | | | | | | | | | | | * g10/export.c (export_ssh_key): Check IDENTIFIER for error. Release base64 thing on error of get_membuf. -- Compiler (older) may misunderstand the variable IDENTIFIER is not initialized, while good one can do better analysys on the value for ERR (and thus, IDENTIFIER). On the error of get_membuf, still, b64enc_finish should be called, even if it lost the ERR value. Signed-off-by: NIIBE Yutaka <[email protected]>
* g13: Include sys/sysmacros.h if available.NIIBE Yutaka2017-04-112-1/+4
| | | | | | | * configure.ac: Add test for sys/sysmacros.h. * g13/sh-dmcrypt.c: Include sys/sysmacros.h. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Fix distcheck.Justus Winter2017-04-111-0/+1
| | | | | | | * tests/gpgscm/Makefile.am (EXTRA_DIST): Add 'gnupg.scm'. Fixes-commit: ccd2187212c12b84c86a10fd4417a16536243179 Signed-off-by: Justus Winter <[email protected]>
* tests: Avoid relying on implicit gpg commands.Justus Winter2017-04-1125-39/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/openpgp/armdetach.scm: Always use an explicit command instead of relying on gpg to guess what we want. * tests/openpgp/armdetachm.scm: Likewise. * tests/openpgp/armencrypt.scm: Likewise. * tests/openpgp/armencryptp.scm: Likewise. * tests/openpgp/armor.scm: Likewise. * tests/openpgp/armsignencrypt.scm: Likewise. * tests/openpgp/armsigs.scm: Likewise. * tests/openpgp/clearsig.scm: Likewise. * tests/openpgp/compression.scm: Likewise. * tests/openpgp/conventional-mdc.scm: Likewise. * tests/openpgp/conventional.scm: Likewise. * tests/openpgp/decrypt-dsa.scm: Likewise. * tests/openpgp/decrypt.scm: Likewise. * tests/openpgp/detach.scm: Likewise. * tests/openpgp/detachm.scm: Likewise. * tests/openpgp/ecc.scm: Likewise. * tests/openpgp/encrypt-dsa.scm: Likewise. * tests/openpgp/encrypt-multifile.scm: Likewise. * tests/openpgp/encrypt.scm: Likewise. * tests/openpgp/encryptp.scm: Likewise. * tests/openpgp/seat.scm: Likewise. * tests/openpgp/signencrypt-dsa.scm: Likewise. * tests/openpgp/signencrypt.scm: Likewise. * tests/openpgp/sigs-dsa.scm: Likewise. * tests/openpgp/sigs.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>