aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cpr.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-06-24spelling: Fix "synchronize"Daniel Kahn Gillmor1-1/+1
Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2019-03-18gpg: Simplify an interactive import status line.Werner Koch1-5/+29
* g10/cpr.c (write_status_printf): Escape CR and LF. * g10/import.c (print_import_check): Simplify by using write_status_printf and hexfingerprint. Signed-off-by: Werner Koch <[email protected]> Fixed one conlict in a comment.
2018-04-06gpg: Emit FAILURE stati now in almost all cases.Werner Koch1-1/+5
* g10/cpr.c (write_status_failure): Make it print only once. * g10/gpg.c (wrong_args): Bump error counter. (g10_exit): Print a FAILURE status if we ever did a log_error etc. (main): Use log_error instead of log_fatal at one place. Print a FAILURE status for a bad option. Ditto for certain exit points so that we can see different error locations. -- This makes it easier to detect errors by tools which have no way to get the exit code (e.g. due to double forking). GnuPG-bug-id: 3872 Signed-off-by: Werner Koch <[email protected]>
2017-11-22gpg: Fix memory leaking for long inputs via --command-fd.Werner Koch1-1/+7
* g10/cpr.c (do_get_from_fd): Free the old buffer. -- If the received input is longer than 200 characters we used to leak the previous allocated buffer. GnuPG-bug-id: 3528 Signed-off-by: Werner Koch <[email protected]>
2017-05-30gpg: Fix typos.Justus Winter1-1/+1
-- Signed-off-by: Justus Winter <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-4/+4
* dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-02-08gpg,common: Make sure that all fd given are valid.Justus Winter1-0/+3
* common/sysutils.c (gnupg_fd_valid): New function. * common/sysutils.h (gnupg_fd_valid): New declaration. * common/logging.c (log_set_file): Use the new function. * g10/cpr.c (set_status_fd): Likewise. * g10/gpg.c (main): Likewise. * g10/keylist.c (read_sessionkey_from_fd): Likewise. * g10/passphrase.c (set_attrib_fd): Likewise. * tests/openpgp/Makefile.am (XTESTS): Add the new test. * tests/openpgp/issue2941.scm: New file. -- Consider a situation where the user passes "--status-fd 3" but file descriptor 3 is not open. During the course of executing the rest of the commands, it's possible that gpg itself will open some files, and file descriptor 3 will get allocated. In this situation, the status information will be appended directly to whatever file happens to have landed on fd 3 (the trustdb? the keyring?). This is a potential data destruction issue for all writable file descriptor options: --status-fd --attribute-fd --logger-fd It's also a potential issue for readable file descriptor options, but the risk is merely weird behavior, and not data corruption: --override-session-key-fd --passphrase-fd --command-fd Fixes this by checking whether the fd is valid early on before using it. GnuPG-bug-id: 2941 Signed-off-by: Justus Winter <[email protected]>
2016-11-29Improve some comments.Neal H. Walfield1-1/+1
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-10-21Fix use cases of snprintf.NIIBE Yutaka1-3/+3
* 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]>
2016-09-01gpg: Add new function write_status_printf.Werner Koch1-0/+27
* g10/cpr.c (write_status_printf): New. -- Signed-off-by: Werner Koch <[email protected]>
2015-08-25gpg: Print a new FAILURE status after most commands.Werner Koch1-1/+15
* common/status.h (STATUS_FAILURE): New. * g10/cpr.c (write_status_failure): New. * g10/gpg.c (main): Call write_status_failure for all commands which print an error message here. * g10/call-agent.c (start_agent): Print an STATUS_ERROR if we can't set the pinentry mode. -- This status line can be used similar to the error code returned by commands send over the Assuan interface in gpgsm. We don't emit them in gpgsm because there we already have that Assuan interface to return proper error code. This change helps GPGME to return better error codes. Signed-off-by: Werner Koch <[email protected]>
2014-07-23common: Add cpr_get_answer_is_yes_def()Werner Koch1-2/+8
* g10/cpr.c (cpr_get_answer_is_yes): Factor code out to .... (cpr_get_answer_is_yes_def): ...new.
2014-01-31gpg: Start using OpenPGP digest algo ids.Werner Koch1-12/+7
* g10/misc.c (print_pubkey_algo_note): Use enum typedef for the arg. (print_cipher_algo_note): Ditto. (print_digest_algo_note): Ditto. (map_md_openpgp_to_gcry): New. (openpgp_md_test_algo): Rewrite. (openpgp_md_algo_name): Rewrite to do without Libgcrypt. * g10/cpr.c (write_status_begin_signing): Remove hardwired list of algo ranges.
2014-01-29gpg: Remove cipher.h and put algo ids into a common file.Werner Koch1-1/+0
* common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t) (compress_algo_t): New. * agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h. * g10/cipher.h (DEK): Move to ... * g10/dek.h: new file. * g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA) (PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC) (PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT) (PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to * g10/packet.h: here. * g10/cipher.h: Remove. Remove from all files. * g10/filter.h, g10/packet.h: Include dek.h. * g10/Makefile.am (common_source): Remove cipher.h. Add dek.h. Signed-off-by: Werner Koch <[email protected]>
2013-12-11gpg: Change --show-session-key to print the session key earlier.Werner Koch1-8/+26
* g10/cpr.c (write_status_strings): New. (write_status_text): Replace code by a call to write_status_strings. * g10/mainproc.c (proc_encrypted): Remove show_session_key code. * g10/decrypt-data.c (decrypt_data): Add new show_session_key code. -- This feature can be used to return the session key for just a part of a file. For example to downloading just the first 32k of a huge file, decrypting that incomplete part and while ignoring all the errors break out the session key. The session key may then be used on the server to decrypt the entire file without the need to have the private key on the server. GnuPG-bug-id: 1389 Signed-off-by: Werner Koch <[email protected]>
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-33/+33
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2010-06-07use estream for status output.Werner Koch1-122/+145
2010-04-14./autogen.sh --build-w32ce does now succeed.Werner Koch1-1/+5
2010-01-08Add dummu option --passwd for gpg.Werner Koch1-2/+17
Collected changes.
2009-08-06Improved detection of bad/invalid signer keys.Werner Koch1-0/+6
2009-01-08Update spanish translation.Werner Koch1-32/+0
Cleanups. Allow utf-8 in email addresses.
2008-12-12Add rmd160.c.Werner Koch1-0/+13
Emit anotehr error code status line.
2008-12-09Minor fixes.Werner Koch1-1/+1
2008-10-20Marked all unused args on non-W32 platforms.Werner Koch1-0/+2
2007-11-19Started to implement the audit log feature.Werner Koch1-132/+38
Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-03-05Ported multiple-messages protection.Werner Koch1-0/+1
2007-01-30Added LIBINTL to more Makefile targets.Werner Koch1-0/+33
doc/ * com-certs.pem: Added the current root certifcates of D-Trust and S-Trust. g10/ * status.c (write_status_begin_signing): New. * sign.c (sign_file, sign_symencrypt_file): Call it. * textfilter.c (copy_clearsig_text): Call it. * call-agent.c (agent_scd_pksign): Pass --hash-rmd160 to SCD if required. * gpg.c (main): Let --no-use-agent and --gpg-agent-info print a warning. * misc.c (obsolete_option): New.
2006-10-05bug fixesWerner Koch1-12/+12
2006-04-28Merged recent changes from 1.4Werner Koch1-3/+4
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-101/+227
The gpg part does not yet build.
2006-04-03About to release 1.4.3gnupg-1.4.3Werner Koch1-0/+1
2005-12-20Finished PKA featureWerner Koch1-0/+2
2005-07-27Converted all m_free to xfree etc.Werner Koch1-12/+12
2005-07-22* gpg.sgml (http):Werner Koch1-2/+4
* g10.c, options.h: New option --exit-on-status-write-error. * status.c (write_status_text): Make use of this option.
2005-06-18(parse_signature): Use log_info for messagesWerner Koch1-1/+0
about missing timestamp or keyid. In case we don't use that key there won't be no further error and thus gpg does not need to return with an error.
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2005-03-14* cardglue.c (pin_cb): Disable debug output.Werner Koch1-1/+2
* mk-w32-dist: Check for patch files. * w32installer.nsi: Translated a few more strings. Print a warning if permssions are not suitable for the installation. Add Uninstaller entries.
2005-03-07* primegen.c (is_prime): Free A2. Noted by [email protected].Werner Koch1-0/+3
Fixes #423. * DETAILS: Document new status codes. * cardglue.c (agent_scd_pkdecrypt, agent_scd_pksign) (agent_scd_genkey, agent_scd_setattr, agent_scd_change_pin) (agent_scd_checkpin, agent_openpgp_storekey): Make sure to send a SC_OP_FAILURE after card operations which might change data. * card-util.c (change_pin): Send a SC_OP_SUCCESS after a PIN has been changed. (change_name): Removed a debug output. * status.h, status.c: New codes BAD_PASSPHRASE_PIN, SC_OP_FAILURE and SC_OP_SUCCESS. * de.po: Updated. Translation is still in the works, though.
2004-10-28* keylist.c (status_one_subpacket): New. Send the subpacket data to theDavid Shaw1-83/+83
--status interface. * card-util.c (card_edit): Show when admin is enabled or not. * status.h, status.c: New STATUS_SIG_SUBPACKET type. * build-packet.c (build_sig_subpkt): Multiple keyserver URLs are allowed.
2004-10-15* README: Mentioned --enable-selinux-support.Werner Koch1-0/+1
* status.h (STATUS_NEED_PASSPHRASE_PIN): New. * status.c (get_status_string): Added. * passphrase.c (ask_passphrase): Moved status printing to .. * cardglue.c (pin_cb): .. here and issue new status message. * keyedit.c (sign_uids): Don't include the leading LF in the translatable string but print them separately. * apdu.c (apdu_open_remote_reader) [_WIN32]: We don't have ENOSYS.
2004-10-13 * keygen.c (read_parameter_file): New keyword "Handle". This isWerner Koch1-0/+1
bug 287. (print_status_key_not_created): New. (print_status_key_created): Add new arg HANDLE. (do_generate_keypair): Print not created status. * status.c, tatus.h (STATUS_KEY_NOT_CREATED): New.
2004-08-08* plaintext.c (handle_plaintext): Bigger buffer for extra safety.David Shaw1-0/+3
* g10.c (main): New alias --throw-keyid for --throw-keyids, so that it continues to work in old configuration files. Noted by Jens Adam. * pkclist.c (algo_available): --pgp8 now allows blowfish, zlib, and bzip2. * status.c (do_get_from_fd): Flush stdout if status isn't flushing it for us. This guarantees that any menus that were displayed before the prompt don't get stuck in a buffer. Noted by Peter Palfrader. This is Debian bug #254072. * sign.c (update_keysig_packet): Revert change of 2004-05-18. It is not appropriate to strip policy and notations when remaking a sig. That should only happen when specifically requested by the user.
2004-07-15* g10.c (main): Alias --charset as --display-charset to help avoid theDavid Shaw1-1/+3
continuing confusion and make room for possible changes in devel. * parse-packet.c (parse_plaintext): Show the hex value for the literal packet mode since it may not be printable. * keygen.c (make_backsig): Make sure that the backsig was built successfully before we try and use it. * status.h, status.c (get_status_string), plaintext.c (handle_plaintext): New status tags PLAINTEXT and PLAINTEXT_LENGTH.
2004-05-22some late minor fixes.V1-3-6Werner Koch1-1/+1
2004-05-20* options.h (ctrl): New for member IN_AUTO_KEY_RETRIEVE.David Shaw1-5/+39
* mainproc.c (check_sig_and_print): track whether we are retrieving a key. * status.c (status_currently_allowed): New. (write_status_text, write_status_text_and_buffer): Use it here. * g10.c: New command --gpgconf-list. (gpgconf_list): New. From Werner on stable branch.
2004-04-27A bunch of changes for the openpgp card.Werner Koch1-0/+1
2003-10-29* cardglue.c (open_card): Ask for card insertion.Werner Koch1-0/+45
(check_card_serialno): New. (agent_scd_pksign, agent_scd_pkdecrypt): Use it here. * cardglue.c (open_card): Issue insertion status message. * status.h, status.c (STATUS_CARDCTRL): New. * status.c (cpr_get_answer_okay_cancel): New. * miscutil.c (answer_is_okay_cancel): New.
2003-09-23Merged most of David Shaw's changes in 1.3 since 2003-06-03.Werner Koch1-0/+1