aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: New export and import options "backup" and "restore".Werner Koch2017-01-233-5/+39
| | | | | | | | | | | | | | | | * g10/export.c (parse_export_options): Add "backup" and its alias "export-backup". (do_export_one_keyblock): Export ring trust packets in backup mode. * g10/import.c (parse_import_options): Add "restore" and its alias "import-restore". (read_block): Import ring trust packets. -- These options are intended to, well, backup and restore keys between GnuPG implementations. These options may eventually be enhanced to backup and restore all public key related information. Signed-off-by: Werner Koch <[email protected]>
* gpg: Allow to freeze faked system time.Damien Goutte-Gattat2017-01-191-2/+12
| | | | | | | | | | | | | | | | * g10/gpg.c (main): If the parameter for --faked-system-time ends with a '!', freeze time at the specified point. * common/gettime.c (gnupg_set_time): Allow to freeze the time at an arbitrary time instead of only the current time. * doc/gpg.texi: Update documentation for --faked-system-time. -- This patch allows the user to modify the behavior of the --faked-system-time option: by appending a '!' to the parameter, time in GnuPG will be frozen at the specified time, instead of advancing normally from that time onward. Signed-off-by: Damien Goutte-Gattat <[email protected]>
* gpg: Remove unused definitions.Werner Koch2017-01-181-22/+2
| | | | | | | * g10/keydb.h (rt_UNKNOWN, rt_RING): Remove constants. (keyblock_pos_struct, KBPOS): Remove struct and type. Signed-off-by: Werner Koch <[email protected]>
* gpg: Clean bogus subkey binding when cleaning a key.Werner Koch2017-01-172-7/+28
| | | | | | | | * g10/trust.c (clean_key): Also clean bogus subkey bindings. -- GnuPG-bug-id: 2922 Signed-off-by: Werner Koch <[email protected]>
* gpg: Sync print of additional sig data in --edit-key.Werner Koch2017-01-172-48/+45
| | | | | | | | | | | | | | | * g10/keylist.c (show_policy_url): Implement MODE -1. (show_keyserver_url): Ditto. (show_notation): Ditto. * g10/keyedit.c (print_one_sig): Print policy URL, keyserver URL and notation data to the tty. -- With this change the listing of signatures in the key edit menu does now include policy URLs et al in order and not possible after leaving the menu (it used to go to stdout and not the tty). Signed-off-by: Werner Koch <[email protected]>
* gpg: Prepare some key cleaning function for use with secret key packets.Werner Koch2017-01-171-7/+14
| | | | | | | | | | | | | | | | * g10/trust.c (mark_usable_uid_certs): Allow use of secret key packets. (clean_sigs_from_uid): Ditto. (clean_uid_from_key): Ditto. (clean_one_uid): Ditto. (clean_key): Ditto. -- Since 2.1 secret keys and public keys use identical data structure and thus we should not restrict those key cleaning functions to work only with public key packets. This change has no immediate effect but may come handy in the future. Signed-off-by: Werner Koch <[email protected]>
* gpg: Rename a var to avoid a shadowing warning.Werner Koch2017-01-121-3/+5
| | | | | | | | | * g10/keygen.c (keygen_set_std_prefs): Rename variable. -- I consider it better not to use the name of a commonly used function. Signed-off-by: Werner Koch <[email protected]>
* 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]>