aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Show private DO information in the card status.Werner Koch2014-12-161-0/+16
| | | | | | | | | | * g10/call-agent.c (agent_release_card_info): Free private_do. (learn_status_cb): Parse PRIVATE-DO-n stati. -- Reported-by: Damien Goutte-Gattat <[email protected]> Provided patch extended to release the memory.
* gpg: Add sub-command "factory-reset" to --card-edit.Werner Koch2014-12-153-6/+239
| | | | | | | | | | | | | | | | | | * common/util.h (GPG_ERR_OBJ_TERM_STATE): New. * scd/iso7816.c (map_sw): Add this error code. * scd/app-openpgp.c (do_getattr): Return the life cycle indicator. * scd/app.c (select_application): Allow a return value of GPG_ERR_OBJ_TERM_STATE. * scd/scdaemon.c (set_debug): Print the DBG_READER value. * g10/call-agent.c (start_agent): Print a status line for the termination state. (agent_scd_learn): Make arg "info" optional. (agent_scd_apdu): New. * g10/card-util.c (send_apdu): New. (factory_reset): New. (card_edit): Add command factory-reset. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix regression in notation data regression.Werner Koch2014-12-152-11/+14
| | | | | | | | | | | * g10/misc.c (pct_expando): Reorder conditions for clarity. * g10/sign.c (write_signature_packets): Fix notation data creation. -- Also re-added the check for signature version > 3. Reported-by: MFPA Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid extra LF in notaion data listing.Werner Koch2014-12-151-1/+6
| | | | * g10/keylist.c (show_notation): Use log_printf.
* gpg: Let --card--status create a shadow key (card key stub).Werner Koch2014-12-123-28/+9
| | | | | | | | | | | | | | | | | | * agent/command.c (cmd_learn): Add option --sendinfo. * agent/learncard.c (agent_handle_learn): Add arg "send" andsend certifciate only if that is set. * g10/call-agent.c (agent_scd_learn): Use --sendinfo. Make INFO optional. (agent_learn): Remove. * g10/keygen.c (gen_card_key): Replace agent_learn by agent_scd_learn. -- The requirement of using --card-status on the first use of card on a new box is a bit annoying but the alternative of always checking whether a card is available before a decryption starts does not sound promising either. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix possible read of unallocated memoryWerner Koch2014-12-121-4/+6
| | | | | | | | | | | | | | | | | * g10/parse-packet.c (can_handle_critical): Check content length before calling can_handle_critical_notation. -- The problem was found by Jan Bee and gniibe proposed the used fix. Thanks. This bug can't be exploited: Only if the announced length of the notation is 21 or 32 a memcmp against fixed strings using that length would be done. The compared data is followed by the actual signature and thus it is highly likely that not even read of unallocated memory will happen. Nevertheless such a bug needs to be fixed. Signed-off-by: Werner Koch <[email protected]>
* gpg: Obsolete some keyserver helper options.Werner Koch2014-12-083-34/+24
| | | | | | | | | | | | | | | | | | * g10/options.h (opt): Remove keyserver_options.other. * g10/gpg.c (main): Obsolete option --honor-http-proxt. * g10/keyserver.c (add_canonical_option): Replace by ... (warn_kshelper_option): New. (parse_keyserver_uri): Obsolete "x-broken-http". -- Some of these options are deprecated for 10 years and they do not make any sense without the keyserver helpers. For one we print a hint on how to replace it: gpg: keyserver option 'ca-cert-file' is obsolete; \ please use 'hkp-cacert' in dirmngr.conf Signed-off-by: Werner Koch <[email protected]>
* gpg: Add OpenPGP card vendor 0x1337.Werner Koch2014-12-081-0/+2
| | | | --
* gpg: Write a status line for a failed --send-keys.Werner Koch2014-12-081-1/+4
| | | | * g10/keyserver.c (keyserver_put): Write an status error.
* scd: Fix for NIST P-256.NIIBE Yutaka2014-12-051-1/+1
| | | | | | * g10/card-util.c (card_store_subkey): Error check. * scd/app-opengpg.c (ecc_writekey): Support NIST P-256. (do_writekey): Error check.
* gpg: Allow import of large keys.Werner Koch2014-12-041-3/+13
| | | | | | | | | | | | | * g10/import.c (import): Skip too large keys. * kbx/keybox-file.c (IMAGELEN_LIMIT): Change limit from 2MB to 5MB. -- The key which triggered the problem was 0x57930DAB0B86B067. With this patch it can be imported. Keys larger than the now increased limit of 5MB will are skipped and the already existing not_imported counter is bumped up. Signed-off-by: Werner Koch <[email protected]>
* indentation: Update g10/import.cWerner Koch2014-12-041-1067/+1161
| | | | --
* gpg: Remove option aliases --[no-]throw-keyid and --notation-data.Werner Koch2014-12-033-8/+5
| | | | | | | | | * g10/gpg.c (opts): Remove them. * g10/options.h (opt): s/throw_keyid/throw_keyids/ and change users. -- See mails starting http://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029128.html
* gpg: Fix export bug using exact search with only one key in the keybox.Werner Koch2014-12-013-1/+7
| | | | | | | | * g10/export.c (do_export_stream): Disable caching. * g10/keyserver.c (keyidlist): Ditto. -- GnuPG-bug-id: 1774
* gpg: Change another BUG() call to a regular error message.Werner Koch2014-11-281-6/+11
| | | | | | * g10/mainproc.c (proc_tree): Replace BUG by a proper error messages. Signed-off-by: Werner Koch <[email protected]>
* Add option --no-autostart.Werner Koch2014-11-284-4/+30
| | | | | | | | | | | | | | * g10/gpg.c: Add option --no-autostart. * sm/gpgsm.c: Ditto. * g10/options.h (opt): Add field autostart. * sm/gpgsm.h (opt): Ditto. * g10/call-agent.c (start_agent): Print note if agent was not autostarted. * sm/call-agent.c (start_agent): Ditto. * g10/call-dirmngr.c (create_context): Likewise. * sm/call-dirmngr.c (start_dirmngr_ext): Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpg: Change a bug() call to a regular error message.Werner Koch2014-11-261-1/+6
| | | | | | | | | * g10/decrypt-data.c (decrypt_data): Return an error code instead of calling BUG(). -- This code path can be triggered by fuzzing gpg and thus with some likeness also by corrupt messages for other reasons.
* gpg: Fix use of uninit.value in listing sig subpkts.Werner Koch2014-11-241-1/+5
| | | | | | | | | | | | | * g10/parse-packet.c (dump_sig_subpkt): Print regex subpacket sanitized. -- We may not use "%s" to print an arbitrary buffer. At least "%.*s" should have been used. However, it is in general preferable to escape control characters while printf user data. Reported-by: Hanno Böck Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix off-by-one read in the attribute subpacket parser.Werner Koch2014-11-241-2/+10
| | | | | | | | | * g10/parse-packet.c (parse_attribute_subpkts): Check that the attribute packet is large enough for the subpacket type. -- Reported-by: Hanno Böck Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix batch generation of ECC keys.Werner Koch2014-11-241-0/+8
| | | | | | | | | | | | * g10/keygen.c (get_parameter_algo): Map ECC algorithm strings directly. -- Interactive generation of the keys uses the OpenPGP algorithms numbers but batch generation allows the use of strings. Reported-by: Gaetan Bisson. Signed-off-by: Werner Koch <[email protected]>
* gpg: Refer to --throw-keyids instead of --throw-keyidDaniel Kahn Gillmor2014-11-241-1/+1
| | | | | | | | * g10/encrypt.c: adjust error message -- The full option name is --throw-keyids, so we should refer to it consistently.
* gpg: Track number of skipped v3 keys on import.Werner Koch2014-11-211-15/+52
| | | | | | | | | * g10/import.c (stats_s): Add field v3keys. (import): Update this field. (import_print_stats): Print v3 key count. (read_block): Skip v3 keys and return a count for them. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix regression in parse_key.Werner Koch2014-11-211-3/+6
| | | | | | | * g10/parse-packet.c (parse): Better return just the gpg_err_code. (parse_key): Return the error code. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix hash detection for ECDSA.Werner Koch2014-11-201-4/+3
| | | | | | | | | | | | | * g10/sign.c (sign_file): Use DSA or ECDSA and not DSA|EdDSA. -- This error was introduced with commit b7f8dec6325f1c80640f878ed3080bbc194fbc78 while separating EdDSA from ECDSA. Found due to a related bug report from Brian Minton. Signed-off-by: Werner Koch <[email protected]>
* Comment typo fixes.Werner Koch2014-11-192-3/+3
| | | | --
* Add "gpgconf --kill dirmngr" and avoid useless launch before a kill.Werner Koch2014-11-192-2/+2
| | | | | | | | | | | | | | * common/asshelp.c (start_new_gpg_agent): Add arg autostart. Change all callers to use 1 for it. (start_new_dirmngr): Ditto. * tools/gpg-connect-agent.c: Add option --no-autostart. (main): Default autostart to 1. (start_agent): Implement no-autostart. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Use --no-autostart. (scdaemon_runtime_change): Ditto. (dirmngr_runtime_change): New. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix a NULL-deref for invalid input data.Werner Koch2014-11-171-3/+8
| | | | | | | | | * g10/mainproc.c (proc_encrypted): Take care of canceled passpharse entry. -- GnuPG-bug-id: 1761 Signed-off-by: Werner Koch <[email protected]>
* gpg: Make the use of "--verify FILE" for detached sigs harder.Werner Koch2014-11-134-41/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/openfile.c (open_sigfile): Factor some code out to ... (get_matching_datafile): new function. * g10/plaintext.c (hash_datafiles): Do not try to find matching file in batch mode. * g10/mainproc.c (check_sig_and_print): Print a warning if a possibly matching data file is not used by a standard signatures. -- Allowing to use the abbreviated form for detached signatures is a long standing bug which has only been noticed by the public with the release of 2.1.0. :-( What we do is to remove the ability to check detached signature in --batch using the one file abbreviated mode. This should exhibit problems in scripts which use this insecure practice. We also print a warning if a matching data file exists but was not considered because the detached signature was actually a standard signature: gpgv: Good signature from "Werner Koch (dist sig)" gpgv: WARNING: not a detached signature; \ file 'gnupg-2.1.0.tar.bz2' was NOT verified! We can only print a warning because it is possible that a standard signature is indeed to be verified but by coincidence a file with a matching name is stored alongside the standard signature. Reported-by: Simon Nicolussi (to gnupg-users on Nov 7) Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix a missing LF in debug output.Werner Koch2014-11-131-0/+2
| | | | | | * g10/kbnode.c (dump_kbnode): Print a LF. Signed-off-by: Werner Koch <[email protected]>
* gpg: Re-indent two files.Werner Koch2014-11-132-1051/+1153
| | | | --
* gpg: Remove PGP-2 related cruft.Werner Koch2014-11-136-52/+11
| | | | | | | | | | | | | | | | | | | | * g10/armor.c (parse_hash_header,carmor_filter): Ignore MD5 in hash header. (fake_packet): Remove pgp-2 workaround for white space stripping. * g10/filter.h (armor_filter_context_t): Remove field pgp2mode. * g10/options.h (opt): Remove field pgp2_workarounds. * g10/gpg.c (main): Do not set this field. * g10/gpgv.c (main): Ditto. * g10/mainproc.c (proc_encrypted): Use SHA-1 as fallback s2k hash algo. Using MD5 here is useless. (proc_plaintext): Remove PGP-2 related woraround (proc_tree): Remove another workaround but keep the one for PGP-5. -- The removed code was either not anymore used or its use would have caused an error message later anyway. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve perceived speed of secret key listings.Werner Koch2014-11-121-0/+2
| | | | | | * g10/keylist.c (list_keyblock): Flush stdout for secret keys. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix regression in --refresh-keysWerner Koch2014-11-122-20/+89
| | | | | | | | | | | | | | | | * g10/keyserver.c (keyserver_get): Factor all code out to ... (keyserver_get_chunk): new. Extimate line length. (keyserver_get): Split up requests into chunks. -- Note that refreshing all keys still requires way to much memory because we build an in-memory list of all keys first. It is required to first get a list of all keys to avoid conflicts while updating the key store in the process of receiving keys. A better strategy would be a background process and tracking the last update in the key store. GnuPG-bug-id: 1755 Signed-off-by: Werner Koch <[email protected]>
* gpg: Add import options "keep-ownertrust".Werner Koch2014-11-122-2/+13
| | | | | | | | | | | | * g10/options.h (IMPORT_KEEP_OWNERTTRUST): New. * g10/import.c (parse_import_options): Add "keep-ownertrust". (import_one): Act upon new option. -- This option is in particular useful to convert from a pubring.gpg to the new pubring.kbx in GnuPG 2.1 or vice versa: gpg1 --export | gpg2 --import-options keep-ownertrust --import
* Remove use of gnulib (part 2)Werner Koch2014-11-111-1/+2
| | | | | | | | | | | | | | | | * configure.ac (strpbrk): Add to AC_CHECK_FUNCS. (gl_EARLY): Remove. * common/stringhelp.c (strpbrk) [!HAVE_STRPBRK]: New. * common/sysutils.c (gnupg_mkdtemp): New. Based on code from glibc-2.6. (gnupg_setenv): Rewrite. (gnupg_unsetenv): Rewrite. * g10/exec.c: Include sysutils.h and replace mkdtemp by gnupg_mkdtemp. * g13/be-encfs.c: Ditto. * g13/mount.c: Ditto. * tools/symcryptrun.c (confucius_mktmpdir): Ditto. Signed-off-by: Werner Koch <[email protected]>
* Remove use of gnulib (part 1)Werner Koch2014-11-112-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gl/: Remove entire tree. * configure.ac: Remove gnulib tests and the gl/ Makefile. (setenv): Add to AC_CHECK_FUNCS. * autogen.rc (extra_aclocal_flags): Set to empty. * Makefile.am (ACLOCAL_AMFLAGS): Remove -I gl/m4 (SUBDIRS): Remove gl/. * agent/Makefile.am (common_libs): Remove ../gl/gnulib.a * common/Makefile.am (t_common_ldadd): Ditto. * dirmngr/Makefile.am (dirmngr_LDADD): Ditto. (dirmngr_ldap_LDADD, dirmngr_client_LDADD): Ditto. * g10/Makefile.am (needed_libs): Ditto. * g13/Makefile.am (g13_LDADD): Ditto. * kbx/Makefile.am (kbxutil_LDADD): Ditto. ($(PROGRAMS)): Ditto. * scd/Makefile.am (scdaemon_LDADD): Ditto. * sm/Makefile.am (common_libs): Ditto. * tools/Makefile.am (common_libs, commonpth_libs): Ditto. * agent/gpg-agent.c: Remove "mkdtemp.h" * g10/exec.c: Ditto. * scd/scdaemon.c: Ditto. * tools/symcryptrun.c: Ditto. * common/sysutils.c: Remove "setenv.h" * common/t-timestuff.c: Use putenv if setenv is not available. -- gnulib has always been a cause of trouble in GnuPG because we used only a very few functions and the complex include machinery of gnulib is quite complex and the cause for many build problems for example on OS X. This is not gnulib's fault but due to our limited use of gnulib and that we only rarely update the gnulib code to avoid regressions. In part two we will address the functions mkdtemp setenv unsetenv strpbrk which may bot be implemented on all platforms. They are not required on a libc based system. Signed-off-by: Werner Koch <[email protected]>
* Avoid sign extension when shifting the MSB.Werner Koch2014-11-051-2/+4
| | | | | | | | * sm/fingerprint.c (gpgsm_get_short_fingerprint): Cast MSB before shifting. * g10/build-packet.c (delete_sig_subpkt): Ditto. Signed-off-by: Werner Koch <[email protected]>
* Add open card manufacturer 0x0008.Werner Koch2014-11-041-0/+1
| | | | --
* Change a couple of files to use abbreviated copyright notes.Werner Koch2014-11-043-6/+6
| | | | | | | | | -- Also fixed some of my own copyright notices due to the termination of my assignment. The one displayed by --version is kept at FSF because we had contributors in 2014 with FSF assignments and it gives the FSF some visibility.
* gpg: Print use --full-gen-key note using the installed name of gpg.Werner Koch2014-11-041-1/+1
| | | | --
* gpg: Avoid extra pinentries for each subkey in --export-secret-keys.Werner Koch2014-11-022-3/+9
| | | | | | | | * agent/command.c (cmd_export_key): Actually implement the cache_nonce feature. * g10/export.c (do_export_stream): Make use of a cache_nonce. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix endless loop in keylisting with fingerprint.Werner Koch2014-11-021-0/+6
| | | | | | | * g10/getkey.c (getkey_next): Disable cache. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Minor cleanup for key listing related code.Werner Koch2014-11-022-21/+19
| | | | | | | | | * g10/getkey.c (get_pubkey_next): Divert to getkey_next. (get_pubkey_end): Move code to getkey_end. * g10/keydb.c (keydb_search_reset): Add a debug statement. (dump_search_desc): Add arg HD and print the handle. Signed-off-by: Werner Koch <[email protected]>
* gpg: Do not show an useless passphrase prompt in batch mode.Werner Koch2014-11-021-78/+4
| | | | | | | | | * g10/keygen.c: Remove unused PASSPHRASE related code. (proc_parameter_file): Remove useless asking for a passphrase in batch mode. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove superfluous check for Libgcrypt >= 1.4.0.Werner Koch2014-10-311-9/+0
| | | | | | | * g10/gpg.c (main): Remove check. -- We require 1.6.0 anyway.
* Add more signing keys.Werner Koch2014-10-311-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | -- The keys which may be used to sign GnuPG packages are: rsa2048/4F25E3B6 2011-01-12 [expires: 2019-12-31] D869 2123 C406 5DEA 5E0F 3AB5 249B 39D2 4F25 E3B6 Werner Koch (dist sig) rsa2048/E0856959 2014-10-29 [expires: 2019-12-31] 46CC 7308 65BB 5C78 EBAB ADCF 0437 6F3E E085 6959 David Shaw (GnuPG Release Signing Key) <[email protected]> rsa2048/33BD3F06 2014-10-29 [expires: 2016-10-28] 031E C253 6E58 0D8E A286 A9F2 2071 B08A 33BD 3F06 NIIBE Yutaka (GnuPG Release Key) <[email protected]> rsa2048/7EFD60D9 2014-10-19 [expires: 2020-12-31] D238 EA65 D64C 67ED 4C30 73F2 8A86 1B1C 7EFD 60D9 Werner Koch (Release Signing Key) These keys are all created and used on tokens. 7EFD60D9 is currently not used but ready to replace 4F25E3B6 in case the former token break.
* kbx: Let keydb_search skip unwanted blobs.Werner Koch2014-10-311-1/+2
| | | | | | | | | | | | | | | * kbx/keybox.h (keybox_blobtype_t): New. * kbx/keybox-defs.h (BLOBTYPE_*): Replace by KEYBOX_BLOBTYPE_*. * kbx/keybox-search.c (keybox_search): Add arg want_blobtype and skip non-matching blobs. * sm/keydb.c (keydb_search): Pass KEYBOX_BLOBTYPE_X509 to keybox_search. * g10/keydb.c (keydb_search): Pass KEYBOX_BLOBTYPE_PGP to keybox_search. -- Without this fix a listing of all keys would fail because the wrong blob type would be returned for the gpg or gpgsm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix --rebuild-keydb-caches.Werner Koch2014-10-312-27/+39
| | | | | | | | | | | | | | * g10/parse-packet.c (parse_key): Store even unsupported packet versions. * g10/keyring.c (keyring_rebuild_cache): Do not copy keys with versions less than 4. -- That function, which is implicitly called while checking the keydb, led to corruption of v3 key packets in the keyring which would later spit out "packet(6)too short" messages. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix testing for secret key availability.Werner Koch2014-10-311-1/+0
| | | | | | | | | | | | * g10/getkey.c (have_secret_key_with_kid): Do not change the search mode. -- The search mode was accidentally changed to search-next after finding the first keyblock. The intention was to look for a duplicate keyid in the keydb which works by not doing a keydb_search_reset. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove commented code.Werner Koch2014-10-311-143/+0
| | | | --