aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keygen.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* g10: More card key generation change.NIIBE Yutaka2016-10-211-39/+24
| | | | | | | | | | | | * g10/keygen.c (gen_card_key): Add back ALGO as the second argument. Don't get ALGO by KEY-ATTR by this function. It's caller to provide ALGO. Don't do that by both of caller and callee. (generate_keypair): Only put paramerters needed. Use parameters for ALGO to call gen_card_key. (generate_card_subkeypair): Get ALGO and call gen_card_key with it. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* g10,scd: Fix ECC keygen.NIIBE Yutaka2016-10-211-7/+53
| | | | | | | | | | | | * g10/keygen.c (generate_keypair): For card key generation, fill parameters by KEY-ATTR. * scd/app-openpgp.c (ecc_read_pubkey): OID should be freed at last, after its reference by OIDBUF is finished. (ecc_writekey): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Support ECC for gen_card_key.NIIBE Yutaka2016-10-211-15/+17
| | | | | | | | | | | * g10/keygen.c (gen_card_key): Remove the first argument of ALGO. (do_generate_keypair, generate_card_subkeypair): Follow the change. -- ALGO is determined by the key attribute of the card. Co-authored-by: Arnaud Fontaine <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix use cases of snprintf.NIIBE Yutaka2016-10-211-1/+0
| | | | | | | | | | | * agent/call-pinentry.c, agent/call-scd.c, agent/command.c, build-aux/speedo/w32/g4wihelp.c, common/get-passphrase.c, dirmngr/dirmngr.c, g10/call-agent.c, g10/cpr.c, g10/keygen.c, g10/openfile.c, g10/passphrase.c, scd/app-openpgp.c, scd/scdaemon.c, sm/call-agent.c, sm/call-dirmngr.c, sm/certreqgen.c: Fix assuming C99. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* agent, g10: Fix keygen.NIIBE Yutaka2016-10-201-1/+1
| | | | | | | | | * agent/command.c (cmd_readkey): Get length after card_readkey. * g10/keygen.c (gen_card_key): Fix off-by-one error. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: smartcard keygen change.NIIBE Yutaka2016-10-201-23/+31
| | | | | | | | | | | | | | | | | | | * g10/call-agent.c (scd_genkey_cb_append_savedbytes): Remove. (scd_genkey_cb): Only handle KEY-CREATED-AT and PROGRESS. (agent_scd_genkey): Remove INFO argument. CREATETIME is now in/out argument. (agent_readkey): Use READKEY --card instead of SCD READKEY. * g10/keygen.c (gen_card_key): Use READKEY --card command of the agent to retrieve public key information from card and let the agent make a file for private key with shadow info. -- This change removes gpg's KEY-DATA handling for SCD GENKEY. Information with KEY-DATA is simply not used. Instead, it is read by READKEY --card command of gpg-agent. This can consolidate public key handling in a single method by READKEY. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Allow use of "default" algo for--quick-addkey.Werner Koch2016-09-141-0/+3
| | | | | | | * g10/keygen.c (quick_generate_keypair): Write a status error. (parse_algo_usage_expire): Set a default curve. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve usability of --quick-gen-key.Werner Koch2016-09-131-23/+63
| | | | | | | | | | | | | | | * g10/keygen.c (FUTURE_STD_): New constants. (parse_expire_string): Handle special keywords. (parse_algo_usage_expire): Allow "future-default". Simplify call to parse_expire_string. (quick_generate_keypair): Always allow an expiration date. Replace former "test-default" by "future-default". -- Using an expiration date is pretty common, thus we now allow the creation of a standard key with expiration date. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make sure a user ID packet has always a terminating Nul in memory.Werner Koch2016-07-011-1/+1
| | | | | | | | * 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.
* 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]>
* 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]>
* gpg: Add hack to --quick-gen-key to create Curve25519 keys.Werner Koch2016-06-281-1/+7
| | | | | | | | | | | | | * g10/keygen.c (quick_generate_keypair): Add special algo string "test-default". -- Well, this is a hack to quickly create keys with the algorithms we will eventually use as defaults. Usage: gpg -v --quick-gen-key --passphrase '' --batch USERID test-default Signed-off-by: Werner Koch <[email protected]>
* gpg: Do not print the validity after key generation.Werner Koch2016-06-231-1/+5
| | | | | | | | | | | | | | * g10/keylist.c (struct keylist_context): Add field NO_VALIDITY. (list_keyblock_print): Take care of it. (list_keyblock_direct): Add arg NO_VALIDITY. * g10/keygen.c (do_generate_keypair): Merge keyblock and print w/o validity. -- It will always be ultimate and by not printing it we avoid a lot of garbage output due to the trustdb re-calculation. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove C-99ism, re-indent, and simplify one function.Werner Koch2016-06-111-4/+8
| | | | | | | | | | | | | * g10/call-agent.c (struct keyinfo_data): Rename to keyinfo_data_parm_s. (agent_get_keyinfo): Replace C-99 style init. (keyinfo_status_cb): Use new fucntion split_fields. * g10/export.c (match_curve_skey_pk): Add missings returns error cases. (cleartext_secret_key_to_openpgp): Better clear PK->PKEY first. -- Signed-off-by: Werner Koch <[email protected]>
* g10: Allow receiving cleartext secret keys from agentDaniel Kahn Gillmor2016-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | * g10/export.c (match_curve_skey_pk): New function, testing whether an OpenPGP public key and an S-expression use the same curve. * g10/export.c (cleartext_secret_key_to_openpgp): New function, filling in the secret key parameters of a PKT_public_key object from a corresponding cleartext S-expression. * g10/export.c, g10/main.h (receive_seckey_from_agent): Add cleartext parameter, enabling retrieval of the secret key, unlocked. * g10/export.c (do_export_stream): Send cleartext as 0, keeping current behavior. * g10/keygen.c (card_store_key_with_backup): Use cleartext=0 to ensure that smartcard backups are all passphrase-locked. -- This sets up internal functionality to be capable of exporting cleartext secret keys, but does not change any existing behavior. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* g10: report whether key in agent is passphrase-protected or notDaniel Kahn Gillmor2016-06-111-1/+1
| | | | | | | | | | | | | | | * g10/call-agent.c, g10/call-agent.h (agent_get_keyinfo): add r_cleartext parameter to report whether a key is stored without passphrase protection. * g10/gpgv.c, g10/test-stubs.c: augment dummy agent_get_keyinfo to match new API. * g10/export.c, g10/keyedit.c, g10/keygen.c, g10/keylist.c, g10/sign.c: pass NULL to agent_get_keyinfo since we do not yet need to know whether agent is passphrase-protected. -- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Replace use of opt.homedir by accessor functions.Werner Koch2016-06-071-1/+2
| | | | | | | | | | | | | | | | | | | * common/homedir.c (the_gnupg_homedir): New var. (gnupg_set_homedir): New. (gnupg_homedir): New. * g10/options.h (struct opt): Remove 'homedir' and replace all users by the new accessor functions. * g13/g13-common.h (struct opt): Ditto. * scd/scdaemon.h (struct opt): Ditto. * sm/gpgsm.h (struct opt): Ditto. * dirmngr/dirmngr.h (struct opt): Ditto. * agent/preset-passphrase.c (opt_homedir): Ditto. * agent/protect-tool.c (opt_homedir): Ditto. -- This will make detection of a non-default homedir easier. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add the fingerprint to KEY_CREATED for subkeys.Werner Koch2016-06-021-9/+12
| | | | | | | | | * g10/keygen.c (print_status_key_created): Make more robust by allowing a NULL for PK. (generate_subkeypair): Use print_status_key_created. (generate_card_subkeypair): Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpg: Try to use the passphrase from the primary for --quick-addkey.Werner Koch2016-06-021-27/+74
| | | | | | | | | | | | | | | * agent/command.c (cmd_genkey): Add option --passwd-nonce. (cmd_passwd): Return a PASSWD_NONCE in verify mode. * g10/call-agent.c (agent_genkey): Add arg 'passwd_nonce_addr' and do not send a RESET if given. (agent_passwd): Add arg 'verify'. * g10/keygen.c (common_gen): Add optional arg 'passwd_nonce_addr'. (gen_elg, gen_dsa, gen_ecc, gen_rsa, do_create): Ditto. (generate_subkeypair): Use sepeare hexgrip var for the to be created for hexgrip feature. Verify primary key first. Make use of the passwd nonce. Allow for a static passphrase. Signed-off-by: Werner Koch <[email protected]>
* gpg: Extend the --quick-gen-key command.Werner Koch2016-06-021-15/+59
| | | | | | | | | | * g10/keygen.c (quickgen_set_para): Add arg 'use'. (quick_generate_keypair): Add args 'algostr', 'usagestr', and 'expirestr'. Implement primary only key mode. (parse_algo_usage_expire): Set NBITS for the default algo. * g10/gpg.c (main): Extend --quick-gen-key command. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve the new parse_subkey_algostr_usagestr fucntion.Werner Koch2016-06-021-28/+34
| | | | | | | | | | * g10/keygen.c (parse_usagestr): Allow "cert". (generate_subkeypair): Factor expire parsing out to ... (parse_subkey_algostr_usagestr): here. Rename to ... (parse_algo_usage_expire): this. Add arg 'for_subkey'. Set CERT for primary key and check that it is not set for subkeys. Signed-off-by: Werner Koch <[email protected]>
* gpg: New command --quick-addkey.Werner Koch2016-06-021-110/+314
| | | | | | | | | | | | | | | | | | | * g10/keygen.c (DEFAULT_STD_SUBKEYUSE): New. (ask_keysize): Factor code out to ... (get_keysize_range, fixup_keysize): new. (parse_parameter_usage): Factor parsing out to ... (parse_usagestr): new. Allow use of "encr" as alias for "encrypt". (parse_subkey_algostr_usagestr): New. (generate_subkeypair): Add new args. Implement unattended mode. * g10/keyedit.c (keyedit_quick_sign): Factor some code out to ... (find_by_primary_fpr): new. (keyedit_quick_addkey): New. * g10/gpg.c (aQuickAddKey): New. (opts): Add --quick-addkey. (main): Implement. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-291-13/+12
| | | | Signed-off-by: Werner Koch <[email protected]>
* Now build "gpg" binary but install as "gpg2"Werner Koch2016-04-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (USE_GPG2_HACK): New ac_define am_conditional. * common/homedir.c (gnupg_module_name): Replace use of macro NAME_OF_INSTALLED_GPG. * g10/keygen.c (generate_keypair): Ditto. * g10/Makefile.am (bin_PROGRAMS): Remove. (noinst_PROGRAMS): Add gpg or gpg2 and gpgv or gpg2. (gpg2_hack_list): New. (use_gpg2_hack): New. (gpg2_SOURCES): Rename to gpg_SOURCES. (gpgv2_SOURCES): Rename to gpgv_SOURCES. (gpg2_LDADD): Rename to gpg_LDADD. (gpgv2_LDADD): Rename to gpgv_LDADD. (gpg2_LDFLAGS): Rename to gpg_LDFLAGS. (gpgv2_LDFLAGS): Rename to gpgv2_LDFLAGS. (install-exec-hook): Remove WinCE specific rules and add new rules. (uninstall-local): Uninstall gpg/gpg2 and gpgv/gpgv2. * tests/openpgp/Makefile.am (required_pgms): s/gpg2/gpg/. * tests/openpgp/defs.inc: Ditto. * tests/openpgp/gpgtar.test: Ditto. * tests/openpgp/mkdemodirs: Ditto. * tests/openpgp/signdemokey: Ditto. * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Remove obsolete --enable-mailto, add --enable-gpg2-is-gpg. -- Although we need to duplicate some automake generated code this method allows to easily switch the name of the installed target using the configure option "--enable-gpg2-is-gpg". Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve message when asking for key capabilities.Werner Koch2016-03-221-5/+7
| | | | | | | | | | | | * g10/keygen.c (ask_key_flags): Improve message. -- Because the curve is only selected after the capabilities are queried we do not know whether ECDSA or EdDSA will eventually be used. When printing the possible capabilities we now use print "ECDSA/EdDSA" for the algorithm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove the extra prompt for Curve25519.Werner Koch2016-03-221-34/+30
| | | | | | | | | | | | | | * g10/keygen.c (MY_USE_ECDSADH): New macro local to ask_curve. (ask_curve): Use a fixed table of curve names and reserve a slot for Curve448. Simplify CurveNNNN/EdNNNN switching. (ask_curve): Remove the Curve25519 is non-standard prompt. -- Given that ECC generation is only available in export mode and that gpg will in any case support our current ed2559/cv25519 definition the extra prompt does not make anymore sense. Signed-off-by: Werner Koch <[email protected]>
* g10: Guard code against errors.Justus Winter2016-03-041-7/+8
| | | | | | | | * g10/keygen.c (do_generate_keypair): Check for errors, in which case 'pri_psk' is NULL. Fixes-commit: bf9d1248 Signed-off-by: Justus Winter <[email protected]>
* gpg: Use format_keyid rather than manually formatting the keyid.Neal H. Walfield2016-02-191-3/+3
| | | | | | | | | * g10/keyedit.c (menu_addrevoker): Use format_keyid rather than manually formatting the keyid. * g10/keygen.c (card_write_key_to_backup_file): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Initialize the primary key when generating a key.Neal H. Walfield2016-02-191-0/+7
| | | | | | | | * g10/keygen.c (do_generate_keypair): Initialize pri_psk->flags.primary, pri_psk->keyid and pri_psk->main_keyid. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Add hidden key-edit subcommand "change-usage".Werner Koch2016-02-141-10/+26
| | | | | | | | | | | | * g10/keyedit.c (cmdCHANGEUSAGE): New. (cmds): Add command "change-usage". (keyedit_menu): Handle that command. (menu_changeusage): New. * g10/keygen.c (keygen_add_key_flags): New. (ask_key_flags): Add optional arg current. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Allow new user ids with only the mail address.Werner Koch2016-01-221-6/+18
| | | | | | | | | | | * g10/keygen.c (ask_user_id): Allow empty name. -- The --quick-gen-key command allows this and further some mail providers require that a key has only the mail address to allow for anonymous accounts. Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid warnings about possible NULL deref.Werner Koch2016-01-071-1/+1
| | | | | | | | | | | | | * g10/getkey.c (cache_public_key): Protect deref of CE which actually can't happen. * g10/keygen.c (quickgen_set_para): s/sprintf/snprintf/. * g10/tofu.c (end_transaction, rollback_transaction): Allow NULL for DB. * g10/trustdb.c (update_min_ownertrust): Remove useless clearling of ERR. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix warnings about useless assignments.Werner Koch2016-01-071-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/armor.c (parse_hash_header): Remove duplicate var assignment. * g10/getkey.c (cache_user_id): Ditto. * g10/keygen.c (ask_curve): Ditto. This also fixes a small memory leak. * g10/keygen.c (proc_parameter_file): Remove useless assignment or pointer increment. (generate_keypair): Ditto. * g10/getkey.c (finish_lookup, lookup): Ditto. * g10/card-util.c (change_pin): Ditto. * g10/gpg.c (main) <aVerify>: Ditto. * g10/import.c (import): Ditto. (print_import_check): Ditto * g10/keyring.c (do_copy): Ditto. * g10/tdbio.c (tdbio_read_record): Ditto. * g10/trustdb.c (tdb_update_ownertrust): Ditto. (update_validity): Ditto. * g10/server.c (cmd_passwd): Remove useless call to skip_options. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Align notes about minimal keysize with actual checks.Werner Koch2016-01-051-10/+6
| | | | | | | | | * g10/keygen.c (ask_keysize): Use 768 for the minimal value for DSA in export mode. Improve readability. -- GnuPG-bug-id: 2209 Signed-off-by: Werner Koch <[email protected]>
* gpg: Simplify status message code from commit b30c15bf.Werner Koch2015-12-231-17/+2
| | | | | | | | | | | | * g10/keygen.c (card_write_key_to_backup_file): Simplify by using hexfingerprint. -- Note that the extra blank added to FPRBUF in the old code was not needed because write_status_text_and_buffer already ensures that there will be a space. Signed-off-by: Werner Koch <[email protected]>
* scd: Fix commit b30c15bf (again).NIIBE Yutaka2015-12-231-0/+1
| | | | | | | | * g10/keygen.c (do_generate_keypair): Clear the variable S. -- GnuPG-bug-id: 2201
* gpg: Fix type.Neal H. Walfield2015-12-221-1/+1
| | | | | | | * g10/keygen.c (card_write_key_to_backup_file): Change n to a size_t. -- Signed-off-by: Neal H. Walfield <[email protected]>
* g10: Remove deprecated internal functions.NIIBE Yutaka2015-12-181-404/+0
| | | | | | | | | | | * g10/keygen.c (do_ask_passphrase, generate_raw_key) (gen_card_key_with_backup, save_unprotected_key_to_card): Remove. -- Now, key generation is done by gpg-agent. Asking passphrase is done through pinentry invoked by gpg-agent. It is done by new internal function of card_store_key_with_backup.
* g10: Fix a regression for generating card key with backup.NIIBE Yutaka2015-12-181-20/+167
| | | | | | | | | | | | * g10/main.h (receive_seckey_from_agent): Declare. * g10/keygen.c (card_write_key_to_backup_file): New. (card_store_key_with_backup): New. (do_generate_keypair): Create a key on host for encryption key when backup is requested. Then, call card_store_key_with_backup. -- GnuPG-bug-id: 2169
* gpg: Take care of keydb_new returning NULL.Werner Koch2015-12-031-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (keydb_new): Print an error message if needed. Also use xtrycalloc because we return an error anyway. * g10/delkey.c (do_delete_key): Handle error retruned by keydb_new. * g10/export.c (do_export_stream): Ditto. * g10/getkey.c (get_pubkey): Ditto. (get_pubkey_fast): Ditto. (get_pubkeyblock): Ditto. (get_seckey): Ditto. (key_byname): Ditto. (get_pubkey_byfprint): Ditto. (get_pubkey_byfprint_fast): Ditto. (parse_def_secret_key): Ditto. (have_secret_key_with_kid): Ditto. * g10/import.c (import_one): Ditto. (import_revoke_cert): Ditto. * g10/keyedit.c (keyedit_quick_adduid): Ditto. * g10/keygen.c (quick_generate_keypair): Ditto. (do_generate_keypair): Ditto. * g10/trustdb.c (validate_keys): Ditto. * g10/keyserver.c (keyidlist): Ditto. * g10/revoke.c (gen_desig_revoke): Ditto. (gen_revoke): Ditto. * g10/gpg.c (check_user_ids): Ditto. (main): Do not print an error message for keydb_new error. * g10/keylist.c (list_all): Use actual error code returned by keydb_new. * g10/t-keydb-get-keyblock.c (do_test): Abort on keydb_new error. * g10/t-keydb.c (do_test): Ditto. * g10/keyring.c (keyring_new): Actually return an error so that the existing keydb_new error checking makes sense for a keyring resource. (keyring_rebuild_cache): Take care of keyring_new returning an error. -- Commit 04a6b903 changed keydb_new to return an error. However the error was not checked at most places which we fix with this patch. To make things easier keydb_new prints an error message itself. Signed-off-by: Werner Koch <[email protected]>
* gpg: Change some error messages.Werner Koch2015-12-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/getkey.c (parse_def_secret_key): Change error message. Replace log_debug by log_info. * g10/gpg.c (check_user_ids): Make function static. Change error messages. (main): Change error messages. * g10/revoke.c (gen_revoke): Ditto. -- There are other smaller changes not described above. This change tries to avoid new error messages so not to increase the the number of translated strings or break too many existing translations. It also tries to use existing strings and changes the quoting to the most common style used in gpg. Key specifications should in general use double quotes. Other values should use single quotes. However. sometimes it is not easy to distinguish between values given on the command line and key specifications. According to old GNU coding standards diagnostics should not start capitalized - whether this is a good idea is a different thing but we used this rules for most strings. However, strings which are used interactively should be properly capitalized and end with a dot. Signed-off-by: Werner Koch <[email protected]>
* Fix typos found using codespell.Justus Winter2015-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/cache.c: Fix typos. * agent/call-pinentry.c: Likewise. * agent/call-scd.c: Likewise. * agent/command-ssh.c: Likewise. * agent/command.c: Likewise. * agent/divert-scd.c: Likewise. * agent/findkey.c: Likewise. * agent/gpg-agent.c: Likewise. * agent/w32main.c: Likewise. * common/argparse.c: Likewise. * common/audit.c: Likewise. * common/audit.h: Likewise. * common/convert.c: Likewise. * common/dotlock.c: Likewise. * common/exechelp-posix.c: Likewise. * common/exechelp-w32.c: Likewise. * common/exechelp-w32ce.c: Likewise. * common/exechelp.h: Likewise. * common/helpfile.c: Likewise. * common/i18n.h: Likewise. * common/iobuf.c: Likewise. * common/iobuf.h: Likewise. * common/localename.c: Likewise. * common/logging.c: Likewise. * common/openpgp-oid.c: Likewise. * common/session-env.c: Likewise. * common/sexputil.c: Likewise. * common/sysutils.c: Likewise. * common/t-sexputil.c: Likewise. * common/ttyio.c: Likewise. * common/util.h: Likewise. * dirmngr/cdblib.c: Likewise. * dirmngr/certcache.c: Likewise. * dirmngr/crlcache.c: Likewise. * dirmngr/dirmngr-client.c: Likewise. * dirmngr/dirmngr.c: Likewise. * dirmngr/dirmngr_ldap.c: Likewise. * dirmngr/dns-stuff.c: Likewise. * dirmngr/http.c: Likewise. * dirmngr/ks-engine-hkp.c: Likewise. * dirmngr/ks-engine-ldap.c: Likewise. * dirmngr/ldap-wrapper.c: Likewise. * dirmngr/ldap.c: Likewise. * dirmngr/misc.c: Likewise. * dirmngr/ocsp.c: Likewise. * dirmngr/validate.c: Likewise. * g10/encrypt.c: Likewise. * g10/getkey.c: Likewise. * g10/gpg.c: Likewise. * g10/gpgv.c: Likewise. * g10/import.c: Likewise. * g10/keydb.c: Likewise. * g10/keydb.h: Likewise. * g10/keygen.c: Likewise. * g10/keyid.c: Likewise. * g10/keylist.c: Likewise. * g10/keyring.c: Likewise. * g10/mainproc.c: Likewise. * g10/misc.c: Likewise. * g10/options.h: Likewise. * g10/packet.h: Likewise. * g10/parse-packet.c: Likewise. * g10/pkclist.c: Likewise. * g10/pkglue.c: Likewise. * g10/plaintext.c: Likewise. * g10/server.c: Likewise. * g10/sig-check.c: Likewise. * g10/sqlite.c: Likewise. * g10/tdbio.c: Likewise. * g10/test-stubs.c: Likewise. * g10/tofu.c: Likewise. * g10/trust.c: Likewise. * g10/trustdb.c: Likewise. * g13/create.c: Likewise. * g13/mountinfo.c: Likewise. * kbx/keybox-blob.c: Likewise. * kbx/keybox-file.c: Likewise. * kbx/keybox-init.c: Likewise. * kbx/keybox-search-desc.h: Likewise. * kbx/keybox-search.c: Likewise. * kbx/keybox-update.c: Likewise. * scd/apdu.c: Likewise. * scd/app-openpgp.c: Likewise. * scd/app-p15.c: Likewise. * scd/app.c: Likewise. * scd/ccid-driver.c: Likewise. * scd/command.c: Likewise. * scd/iso7816.c: Likewise. * sm/base64.c: Likewise. * sm/call-agent.c: Likewise. * sm/call-dirmngr.c: Likewise. * sm/certchain.c: Likewise. * sm/gpgsm.c: Likewise. * sm/import.c: Likewise. * sm/keydb.c: Likewise. * sm/minip12.c: Likewise. * sm/qualified.c: Likewise. * sm/server.c: Likewise. * tools/gpg-check-pattern.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgkey2ssh.c: Likewise. * tools/gpgparsemail.c: Likewise. * tools/gpgtar.c: Likewise. * tools/rfc822parse.c: Likewise. * tools/symcryptrun.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpg: Indicate which characters are invalid.Neal H. Walfield2015-11-051-0/+3
| | | | | | | | * g10/keygen.c (ask_user_id): Indicate which characters are invalid. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1143
* gpg: Pass CTRL parameter to all key listing functions.Werner Koch2015-10-081-13/+13
| | | | | | | | | | | | | | | | | | | | | * g10/keylist.c (public_key_list): Add arg CTRL. (secret_key_list): Ditto. (list_all, list_one): Ditto. (locate_one): Ditto. (list_keyblock_pka): Ditto. (list_keyblock): Ditto. (list_keyblock_direct): Ditto. * g10/keygen.c (proc_parameter_file): Add arg CTRL. (read_parameter_file): Ditto. (quick_generate_keypair): Ditto. (do_generate_keypair): Ditto. (generate_keypair): Pass arg CTRL. * g10/gpg.c (main): Pass arg CTRL to quick_generate_keypair. -- This will help use to implement the --server mode. Signed-off-by: Werner Koch <[email protected]>
* g10: Remove unused parameter.Neal H. Walfield2015-08-311-1/+1
| | | | | | | | * g10/keydb.h (keydb_locate_writable): Remove unused parameter reserved. Update users. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* Curve25519 support.NIIBE Yutaka2015-08-061-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | * agent/cvt-openpgp.c (get_keygrip): Handle Curve25519. (convert_secret_key, convert_transfer_key): Ditto. * common/openpgp-oid.c (oidtable): Add Curve25519. (oid_crv25519, openpgp_oid_is_crv25519): New. * common/util.h (openpgp_oid_is_crv25519): New. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Handle the case with Montgomery curve which uses x-only coordinate. * g10/keygen.c (gen_ecc): Handle Curve25519. (ask_curve): Change the API and second arg is to return subkey algo. (generate_keypair, generate_subkeypair): Follow chage of ask_curve. * g10/keyid.c (keygrip_from_pk): Handle Curve25519. * g10/pkglue.c (pk_encrypt): Handle Curve25519. * g10/pubkey-enc.c (get_it): Handle the case with Montgomery curve. * scd/app-openpgp.c (ECC_FLAG_DJB_TWEAK): New. (send_key_attr): Work with general ECC, Ed25519, and Curve25519. (get_public_key): Likewise. (ecc_writekey): Handle flag_djb_tweak. -- When libgcrypt has Curve25519, GnuPG now supports Curve25519.
* doc: Updated HACKING.Werner Koch2015-06-301-1/+1
| | | | | | | -- Added used commit keywords. Add some comments to the list of files.
* gpg: New command --quick-adduid.Werner Koch2015-05-081-17/+45
| | | | | | | | | | | | | | | * g10/keygen.c (ask_user_id): Factor some code out to ... (uid_already_in_keyblock): new. (generate_user_id): Add arg UIDSTR. Fix leaked P. * g10/keyedit.c (menu_adduid): Add new arg uidstring. Adjust caller. (keyedit_quick_adduid): New. * g10/gpg.c (aQuickAddUid): New. (opts): Add command --quick-adduid. (main): Implement that. -- GnuPG-bug-id: 1956 Signed-off-by: Werner Koch <[email protected]>
* gpg: Prepare to pass additional context to the list functions.Werner Koch2015-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | * g10/keylist.c (struct sig_stats): Rename to keylist_context and add field check_sigs. (keylist_context_release): New. (list_all): Set listctx.check_sigs and call release func. (list_one): Ditto. (locate_one): Ditto. (list_keyblock_print): Use .check_sigs field. Repalce arg opaque by listctx. (list_keyblock): Ditto. Make static. (list_keyblock_direct): New. * g10/keygen.c (do_generate_keypair): Replace list_keyblock by list_keyblock_direct. -- This is in preparation for the server mode and for a patch to speed up --list-sigs. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix keytocard.NIIBE Yutaka2015-04-031-1/+1
| | | | | | | | | | | | | | | | g10/call-agent.h (agent_scd_learn): Add FORCE option. g10/call-agent.c (agent_scd_learn): Implement FORCE option. g10/keygen.c (gen_card_key): Follow the change of option. g10/card-util.c (change_pin, card_status, factory_reset): Likewise. g10/keyedit.c (keyedit_menu): Update private key storage by agent_scd_learn. -- This is not a perfect solution since there is a possibility user unplug card before quitting 'gpg --keyedit' session. Usually, it works well. GnuPG-bug-id: 1846