aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* g10: avoid warning when --disable-tofuDaniel Kahn Gillmor2017-01-041-1/+1
| | | | | If configured with --disable-tofu, we see compiler warnings about an unused variable. This should remove those warnings.
* Replace use of variable-length-arrays.Werner Koch2017-01-023-15/+25
| | | | | | | | | | | | | * common/t-iobuf.c (main): Replace variable-length-array. * g10/gpgcompose.c (mksubpkt_callback): Ditto. (encrypted): Ditto. * g10/t-stutter.c (log_hexdump): Ditto. (oracle_test): Ditto. * g10/tofu.c (get_policy): Ditto. Use "%zu" for size_t. * scd/app-openpgp.c (ecc_writekey): Replace variable-length-array. Check for zero length OID_LEN. Signed-off-by: Werner Koch <[email protected]>
* build: Update distributed signature key.Werner Koch2016-12-201-0/+0
| | | | | | | | -- This update is required because gniibe prolonged his key. Signed-off-by: Werner Koch <[email protected]>
* typo: Fix a string in do_we_trust_pre.Werner Koch2016-12-191-1/+1
| | | | --
* Remove unused debug flags and add "dns" and "network".Werner Koch2016-12-192-3/+0
| | | | | | | | | | | | | | | | | | * g10/options.h (DBG_CARD_IO_VALUE, DBG_CARD_IO): Remove. * g10/gpg.c (debug_flags): Remove "cardio". * agent/agent.h (DBG_COMMAND_VALUE, DBG_COMMAND): Remove. * agent/gpg-agent.c (debug_flags): Remove "command". * scd/scdaemon.h (DBG_COMMAND_VALUE, DBG_COMMAND): Remove. * scd/scdaemon.c (debug_flags): Remove "command". * dirmngr/dirmngr.h (DBG_DNS_VALUE, DBG_DNS): New. (DBG_NETWORK_VALUE, DNG_NETWORK): New. * dirmngr/dirmngr.c (debug_flags): Add "dns" and "network". -- Note that "dns" and "network" are not yet used but will soon be added to dirmngr. Signed-off-by: Werner Koch <[email protected]>
* gpg,sm: A few more option for --gpgconf-list.Werner Koch2016-12-161-0/+2
| | | | | | | | | * g10/gpg.c (gpgconf_list): Add --compliance and --default-new-key-algo. (parse_compliance_option): * sm/gpgsm.c (main) <gpgconf-list>: Add --enable-crl-checks. Signed-off-by: Werner Koch <[email protected]>
* g10: Use total days, not total messages to compute TOFU validityNeal H. Walfield2016-12-161-12/+12
| | | | | | | | | | * g10/tofu.c (write_stats_status): Use the number of days with signatures / encryptions to compute the validity, not the total number of signatures / encryptions. (BASIC_TRUST_THRESHOLD): Adjust given the new semantics. (FULL_TRUST_THRESHOLD): Likewise. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Extend TOFU_STATS to emit <sign-days> and <encyrption-days>Neal H. Walfield2016-12-161-16/+63
| | | | | | | | | | | | | * doc/DETAILS: Add SIGN-DAYS and ENCRYPT-DAYS to the TOFU_STATS status line. * g10/tofu.c (write_stats_status): Take additional parameters signature_days and encryption_days. Update callers. Include them in the tfs record and TOFU status lines. (show_statistics): Compute the number of days on which we saw a message signed by FINGERPRINT, and the number of days on which we encrypted a message to it. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: On a TOFU conflict, write the conflicting keys to the status fdNeal H. Walfield2016-12-161-16/+36
| | | | | | | | | | | | * g10/tofu.c (ask_about_binding): Emit all of the conflicting keys and their statistics on the status fd. (get_trust): Likewise, if we don't call ask_about_binding. (show_statistics): Have the caller pass the policy as returned by get_policy. Add argument only_status_fd and don't emit any output on stdout if it is set. Update callers. -- Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Add missing space.Neal H. Walfield2016-12-161-1/+1
| | | | | | * g10/tofu.c (tofu_register_encryption): Add missing space. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Avoid translating simple error messages.Justus Winter2016-12-151-15/+15
| | | | | | | | | | | | * g10/gpg.c (main): Avoid translating arguments to 'wrong_args'. -- Translating these messages is a burden for translators, and we only have translations for very few of them as it is. If we want to localize these messages, I'd suggest to translate the placeholders (e.g. 'filename'). Signed-off-by: Justus Winter <[email protected]>
* g10: Rework the --quick-* interface.Justus Winter2016-12-151-7/+11
| | | | | | | | | | | | * g10/gpg.c (opts): Rename options. (main): Update errors. * doc/gpg.texi: Update accordingly. -- I decided not to keep the old versions as aliases in the documentation because the interface is a fairly recent addition. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Rename 'card-edit' to 'edit-card'.Justus Winter2016-12-152-2/+3
| | | | | | | | | | | | | | * g10/gpg.c (opts): Rename option. * g10/call-agent.c (agent_scd_learn): Update comment. * doc/gpg.texi: Update accordingly. -- This change has a surprising side effect. Previously, --edit was an alias for --edit-key, because the argument parser actually accepts unique prefixes of all options. With this change, however, --edit is ambiguous. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Spell out --desig-revoke.Justus Winter2016-12-151-1/+2
| | | | | | | | | | | | * g10/gpg.c (opts): Rename option. * doc/gpg.texi: Update accordingly. -- This is a rather long name, but I believe that this command is rarely used, and in places where it is used frequently, the process is likely automated. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Shorten unreasonably long option.Justus Winter2016-12-152-3/+3
| | | | | | | | | | | * g10/gpg.c (opts): Rename 'generate-revocation-certificate' to 'generate-revocation'. * doc/gpg.texi: Update accordingly. * po: Update translations. GnuPG-bug-id: 2700 Fixes-commit: ec1bd3ae685e95563e38077ab3c1655fd55dea07 Signed-off-by: Justus Winter <[email protected]>
* g10,sm: Spell out --passwd.Justus Winter2016-12-131-2/+3
| | | | | | | | | | * g10/gpg.c (opts): Spell out option. * sm/gpgsm.c (opts): Likewise. * doc/gpg.texi: Update accordingly. * doc/gpgsm.texi: Likewise. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Spell out --gen-revoke.Justus Winter2016-12-132-3/+6
| | | | | | | | | * g10/gpg.c (opts): Spell out option. * doc/gpg.texi: Update accordingly. * po: Update translations. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Spell out --full-gen-key.Justus Winter2016-12-132-4/+5
| | | | | | | | | | * g10/gpg.c (opts): Spell out option. (main): Likewise. * g10/keygen.c (generate_keypair): Likewise. * doc/gpg.texi: Update accordingly. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10,sm: Spell out --gen-key.Justus Winter2016-12-131-4/+5
| | | | | | | | | * g10/gpg.c (opts): Spell out option. * sm/gpgsm.c (opts): Likewise. * doc/gpg.texi: Update accordingly. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10,sm: Spell out --check-sigs.Justus Winter2016-12-131-1/+3
| | | | | | | | | * g10/gpg.c (opts): Spell out option. * sm/gpgsm.c (opts): Likewise. * doc/gpg.texi: Update accordingly. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10,sm: Spell out --list-sigs.Justus Winter2016-12-131-1/+2
| | | | | | | | | * g10/gpg.c (opts): Spell out option. * sm/gpgsm.c (opts): Likewise. * doc/gpg.texi: Update accordingly. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Hyphenate --clearsign.Justus Winter2016-12-131-5/+6
| | | | | | | | | | * g10/gpg.c (opts): Hyphenate option. * doc/gpg.texi: Update accordingly. * po: Update translations. * tests/openpgp: Update tests. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Spell out --recv-keys.Justus Winter2016-12-131-1/+2
| | | | | | | | * g10/gpg.c (opts): Spell out option. * doc/gpg.texi: Update accordingly. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Create expiring keys in quick key generation mode.Justus Winter2016-12-131-0/+2
| | | | | | | | | * doc/gpg.texi: Document that fact. * g10/keygen.c (quick_generate_keypair): Use a default value. * tests/openpgp/quick-key-manipulation.scm: Test that fact. GnuPG-bug-id: 2701 Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix memory leak in ecc key generation.Werner Koch2016-12-121-1/+2
| | | | | | * g10/keygen.c (ecckey_from_sexp): Release curve. Signed-off-by: Werner Koch <[email protected]>
* gpg: Do not use a fixed string for --gpgconf-list:default_pubkey_algo.Werner Koch2016-12-123-2/+20
| | | | | | | | | | | | | * g10/keygen.c (get_default_pubkey_algo): New. (parse_key_parameter_string): Use it. * g10/gpg.c (gpgconf_list): Take value from new function. -- Note that consumers of that gpgconf-list value may need to be adjusted to that new value. It should anyway only be used to display the default algorithm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix algo string parsing of --quick-addkey.Werner Koch2016-12-122-10/+19
| | | | | | | | | | | | | * g10/keygen.c (parse_key_parameter_string): Fix handling of PART==1. (parse_key_parameter_part): Use default key size if only "rsa", "dsa", or "elg" is given. -- The first change is the actual fix. The second change avoids the error "Invalid Curve" when only "rsa" instead of RSA2048 is given. Fixes-commit: ce29272e24e7b718b8fca9b84bc728e65f3dea24 Signed-off-by: Werner Koch <[email protected]>
* g10: Create keys that expire in simple key generation mode.Justus Winter2016-12-091-1/+6
| | | | | | | | | | | * g10/keygen.c (default_expiration_interval): New variable. (generate_keypair): Use the new default. -- Cursory discussion on gnupg-devel@ suggested two years as a good default expiration interval. GnuPG-bug-id: 2701 Signed-off-by: Justus Winter <[email protected]>
* g10: List compression algorithms using human-readable names.Justus Winter2016-12-091-0/+9
| | | | | | | * g10/gpg.c (list_config): List all enabled compression algorithms under the key 'compressname'. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2016-12-091-0/+2
| | | | | | * g10/sign.c (do_sign): Release old signature data. Signed-off-by: Justus Winter <[email protected]>
* Fix 2 compiler warnings.Werner Koch2016-12-081-1/+1
| | | | | | | | * dirmngr/loadswdb.c: Set ERR on malloc failure. * g10/passphrase.c (passphrase_to_dek): Initialize all fields of HELP_S2K. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix the fix out-of-bounds access.Werner Koch2016-12-081-2/+2
| | | | | | | | | | | | * g10/tofu.c (build_conflict_set): Revert to int* and fix calloc. -- The original code used an int array and thus better keep that and do not limit it to 128 entries. Fixes-commit: c3008bffac68b6f31e9ae9bad837cdce5de7c0db Fixes-commit: 3b5b94ceab7c0ed9501c5cf54b4efa17fcd7300a Signed-off-by: Werner Koch <[email protected]>
* g10: Fix out-of-bounds access.Justus Winter2016-12-081-1/+1
| | | | | | | * g10/tofu.c (build_conflict_set): Use 'char'. Fixes-commit: c3008bffac68b6f31e9ae9bad837cdce5de7c0db Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix portability problem.Werner Koch2016-12-081-2/+9
| | | | | | | | | | * g10/tofu.c (build_conflict_set): Replace variable dynamic array. -- Note that clang complained that CONFLICT_SET_COUNT could be negative. Thus I added an assert. Signed-off-by: Werner Koch <[email protected]>
* g10: Avoid a memory leak.Neal H. Walfield2016-12-061-0/+2
| | | | | | * g10/gpg.c (main): Free KB when we're done with it. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Remove dead code.Neal H. Walfield2016-12-062-22/+0
| | | | | | * g10/tofu.c (tofu_set_policy_by_keyid): Remove function. Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: New option --quick-set-expire.Werner Koch2016-12-054-26/+142
| | | | | | | | | | | | | * g10/gpg.c (aQuickSetExpire): New. (opts): New option --quick-set-expire. (main): Implement option. * g10/keyedit.c (menu_expire): Add args FORCE_MAINKEY and NEWEXPIRATION. Change semantics of the return value. Change caller. (keyedit_quick_set_expire): New. -- This patch partly solves GnuPG-bug-id: 2701
* gpg: Fix error code arg in ERRSIG status line.Werner Koch2016-12-031-1/+1
| | | | | | | | | * g10/mainproc.c (check_sig_and_print): Use gpg_err_code to return an error code in ERRSIG. -- Debian-bug-id: 846834 Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --default-new-key-algo.Werner Koch2016-12-024-130/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/openpgp-oid.c (openpgp_is_curve_supported): Add optional arg R_ALGO and change all callers. * common/util.h (GPG_ERR_UNKNOWN_FLAG): New error code. * g10/options.h (struct opt): Add field DEF_NEW_KEY_ALGO. * g10/gpg.c (oDefaultNewKeyAlgo): New enum. (opts): New option "--default-new-key-algo". (main): Set the option. * g10/keygen.c: Remove DEFAULT_STD_ FUTURE_STD_ constants and replace them by ... (DEFAULT_STD_KEY_PARAM, FUTURE_STD_KEY_PARAM): new string constants. (get_keysize_range): Remove arg R_DEF and return that value instead. Change all callers. (gen_rsa): Use get_keysize_range instead of the removed DEFAULT_STD_KEYSIZE. (parse_key_parameter_part): New function. (parse_key_parameter_string): New function. (quick_generate_keypair): Refactor using parse_key_parameter_string. (generate_keypair): Ditto. (parse_algo_usage_expire): Ditto. -- This new option is intended to be used in the forthcoming --set-profile command of gpgconf. It allows to provide a gpg configuration with custom defaults for a new key using the simple commands which use the default algorithm set. Signed-off-by: Werner Koch <[email protected]>
* g10: Improve debugging output.Neal H. Walfield2016-12-021-6/+12
| | | | | | | * g10/tofu.c (string_to_long): Improve debugging output. (string_to_ulong): Likewise. Signed-off-by: Neal H. Walfield <[email protected]>
* g10: In the TOFU module, make strings easier to translate.Neal H. Walfield2016-12-011-187/+144
| | | | | | | | | | | * g10/tofu.c: Remove dead code. (time_ago_str): Simplify implementation since we only want the most significant unit. (format_conflict_msg_part1): Use ngettext. (ask_about_binding): Likewise and only emit full sentences. (show_statistics): Likewise. Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Let only Dirmngr decide whether CERT is supported.Werner Koch2016-12-012-6/+0
| | | | | | | | | | * g10/getkey.c (parse_auto_key_locate): Do not build parts depending on USE_DNS_CERT. -- This also removes USE_DNS_SRV from commented code. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make --decrypt with output '-&nnnn' work.Werner Koch2016-11-291-3/+19
| | | | | | | | | * g10/plaintext.c (get_output_file): Check and open special filename before falling back to stdout. -- GnuPG-bug-id: 2677 Signed-off-by: Werner Koch <[email protected]>
* gpg,sm: Merge the two versions of check_special_filename.Werner Koch2016-11-292-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/gpgsm.c (check_special_filename): Move to .. * common/sysutils.c (check_special_filename): here. Add arg NOTRANSLATE. (allow_special_filenames): New local var. (enable_special_filenames): New public functions. * sm/gpgsm.c (allow_special_filenames): Remove var. (main): Call enable_special_filenames instead of setting the var. (open_read, open_es_fread, open_es_fwrite): Call check_special_filename with 0 for NOTRANSLATE. * common/iobuf.c (special_names_enabled): Remove var. (iobuf_enable_special_filenames): Remove func. (check_special_filename): Remove func. (iobuf_is_pipe_filename): Call new version of the function with NOTRANSLATE set. (do_open): Ditto. * g10/gpg.c (main): Call enable_special_filenames instead of iobuf_enable_special_filenames. * g10/gpgv.c (main): Ditto. -- Note that we keep the iobuf.c:translate_file_handle because it is a bit different (for whatever reasons) than the translate function from sysutils. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix memory leak.Justus Winter2016-11-291-4/+5
| | | | | | | * g10/decrypt.c (decrypt_messages): Properly decrease the reference count of the armor filters after pushing them. Signed-off-by: Justus Winter <[email protected]>
* Improve some comments.Neal H. Walfield2016-11-296-30/+51
|
* g10: Extend TOFU_STATS to always show the validityNeal H. Walfield2016-11-291-11/+19
| | | | | | | | | | | * doc/DETAILS (TOFU_STATS): Rename the VALIDITY field to SUMMARY. Add a new field called VALIDITY. * g10/tofu.c (write_stats_status): Update output accordingly. -- Signed-off-by: Neal H. Walfield <[email protected]> Change TOFU_STATS as discussed offline with Werner, Justus and Andre.
* g10: Fix iteration over getkey results.Justus Winter2016-11-281-1/+1
| | | | | | | | | * g10/getkey.c (getkey_next): Only ask 'lookup' for the exact match if our caller requested the key. Fixes a crash in 'lookup'. GnuPG-bug-id: 2848 Fixes-commit: 1d03cc77e1706f7da653153ad4b58c61e4fd2573 Signed-off-by: Justus Winter <[email protected]>
* g10: Avoid gratuitously loading a keyblock when it is already availableNeal H. Walfield2016-11-2311-50/+108
| | | | | | | | | | | * g10/trust.c (get_validity): Add new, optional parameter KB. Only load the keyblock if KB is NULL. Update callers. (get_validity): Likewise. * g10/trustdb.c (tdb_get_validity_core): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2812
* g10: Use es_fopen instead of open.Neal H. Walfield2016-11-221-11/+10
| | | | | | | | | | | * g10/tofu.c: Don't include <utime.h>, <fcntl.h> or <unistd.h>. (busy_handler): Replace use of open with es_fopen. -- Signed-off-by: Neal H. Walfield <[email protected]> Thanks for Werner for pointing this out: es_fopen is more portable than open.