aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-05-17gpg: Fix using --decrypt along with --use-embedded-filename.Werner Koch1-1/+2
* g10/options.h (opt): Add flags.dummy_outfile. * g10/decrypt.c (decrypt_message): Set this global flag instead of the fucntion local flag. * g10/plaintext.c (get_output_file): Ignore opt.output if that was used as a dummy option aslong with --use-embedded-filename. -- The problem here was that an explicit specified --decrypt, as meanwhile suggested, did not work with that dangerous --use-embedded-filename. In contrast it worked when gpg decrypted as a side-effect of parsing the data. GnuPG-bug-id: 4500 Signed-off-by: Werner Koch <[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]>
2016-11-29gpg: Make --decrypt with output '-&nnnn' work.Werner Koch1-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]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-07-13gpg: New option --mimemode.Werner Koch1-4/+11
* g10/gpg.c (oMimemode): New. (opts): Add --mimemode. (main): Use --mimemode only in rfc4880bis compliance mode. * g10/options.h (struct opt): Add field "mimemode". * g10/build-packet.c (do_plaintext): Allow for mode 'm'. * g10/encrypt.c (encrypt_simple, encrypt_crypt): Use 'm' if requested. * g10/plaintext.c (handle_plaintext): Handle 'm' mode. * g10/sign.c (write_plaintext_packet): Handle 'm' mode. (sign_file, sign_symencrypt_file): Use 'm' if requested. -- Thsi patch prepares for a proposed change in RFC4880bis to support a MIME flag. A literal data packet with the mime flag set is handled like a 't' or 'u' but CR are not removed. The PLAINTEXT status line will also indicate a MIME content. If --mimemode is used without --rfc4880bis 't' will be used. Signed-off-by: Werner Koch <[email protected]>
2016-04-29gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch1-2/+1
Signed-off-by: Werner Koch <[email protected]>
2015-11-17Fix typos found using codespell.Justus Winter1-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]>
2015-11-05gpg: Add support for unwrapping the outer level of encryption.Neal H. Walfield1-47/+89
* g10/decrypt-data.c (decrypt_data): If OPT.UNWRAP_ENCRYPTION is set, copy the data to the output file instead of continuing to process it. * g10/gpg.c (enum cmd_and_opt_values): Add new value oUnwrap. (opts): Handle oUnwrap. (main): Likewise. * g10/options.h (opt): Add field unwrap_encryption. * g10/plaintext.c (handle_plaintext): Break the output file selection functionality into ... (get_output_file): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1060 Debian-bug-id: 282061
2015-01-22gpg: Replace remaining old error code macros by GPG_ERR_.Werner Koch1-2/+2
* g10/gpg.h (g10_errstr): Remove macro and change all occurrences by gpg_strerror. (G10ERR_): Remove all macros and change all occurrences by their GPG_ERR_ counterparts. Signed-off-by: Werner Koch <[email protected]>
2014-11-13gpg: Make the use of "--verify FILE" for detached sigs harder.Werner Koch1-13/+18
* 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]>
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-18/+18
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-6/+6
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-11-23Change stack size for Wince.Werner Koch1-66/+81
Allow for a longer agent atartup under wince. Print gpg output via estream.
2010-06-07Add unfinished gpgtar.Werner Koch1-1/+9
Collected changes and ports of bug fixes from stable.
2010-04-01Use gpg_err_set_errno to assign values to ERRNO.Werner Koch1-4/+4
2010-03-15Finished the bulk of changes to use estream in most places instead ofWerner Koch1-1/+2
stdio.
2010-03-08Removed almost al dup calls.Werner Koch1-4/+5
2009-10-02Implement the server comamnd DECRYPT.Werner Koch1-8/+24
Use int instead of gnupg_fd_t in the server. Comment fixes. Rename encr-data.c -> decrypt-data.c
2009-10-01Re-indented.Werner Koch1-460/+509
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-06First steps towards supporting W32.Werner Koch1-3/+4
This is mainly source code reorganization. Update gnulib. g10/ does currently not build.
2007-03-08Add extra flushsWerner Koch1-1/+12
2006-12-21Started to code a --server mode. Werner Koch1-0/+36
It is far from being ready!
2006-12-06Fixes for CVE-2006-6235Werner Koch1-5/+14
2006-10-02Fix for bug 537Werner Koch1-2/+2
2006-09-14Take advantage of newer gpg-error features.Werner Koch1-12/+12
2006-05-23g10/ does build again.Werner Koch1-8/+10
2006-04-28Merged recent changes from 1.4Werner Koch1-7/+48
2006-04-21Still merging 1.4.3 code backWerner Koch1-18/+21
2006-04-20* gpg.c (print_mds), armor.c (armor_filter, parse_hash_header): AddDavid Shaw1-6/+46
SHA-224. * sign.c (write_plaintext_packet), encode.c (encode_simple): Factor common literal packet setup code from here, to... * main.h, plaintext.c (setup_plaintext_name): Here. New. Make sure the literal packet filename field is UTF-8 encoded. * options.h, gpg.c (main): Make sure --set-filename is UTF-8 encoded and note when filenames are already UTF-8.
2006-04-19Continued with merging.Werner Koch1-15/+19
Still does not build.
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-93/+184
The gpg part does not yet build.
2006-03-05Replaced an assert and fixed batch mode issue in cardglue.Werner Koch1-3/+9
2005-09-20* keylist.c (reorder_keyblock, do_reorder_keyblock): Reorder attributeDavid Shaw1-1/+5
IDs as well as regular text IDs. * plaintext.c (ask_for_detached_datafile): Use make_filename() on filename so tilde expansion works.
2005-07-27Converted all m_free to xfree etc.Werner Koch1-15/+15
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2005-03-21* gpgv.c: Stubs for tty_enable_completion() & tty_disable_completion().David Shaw1-2/+4
* openfile.c (ask_outfile_name): Enable readline completion when prompting for an output filename. * plaintext.c (ask_for_detached_datafile): Enable readline completion when prompting for a detached sig datafile.
2004-11-04* plaintext.c (handle_plaintext): Don't try and create a zero-lengthDavid Shaw1-2/+3
filename when using --use-embedded-filename with input that has no filename (clearsigned or message generated from a pipe). * encode.c (encode_simple, encode_crypt), progress.c (handle_progress), sign.c (write_plaintext_packet): Fix a few inconsistent calls (NULL filename means a pipe here, so don't bother to check it twice).
2004-10-28* card-util.c, delkey.c, keygen.c, plaintext.c, keyedit.c, passphrase.c,David Shaw1-3/+4
revoke.c: Collapse the two different "can't do that in batch mode" strings into one.
2004-10-14* misc.c (is_secured_filename): New.Werner Koch1-0/+7
* keydb.c (maybe_create_keyring) * tdbio.c (tdbio_set_dbname) * plaintext.c (handle_plaintext) * openfile.c (copy_options_file, open_outfile) * exec.c (exec_write) * keygen.c (do_generate_keypair, gen_card_key_with_backup) * sign.c (sign_file, clearsign_file) * keyring.c (create_tmp_file, do_copy): Check for secured files before creating them. * keygen.c (print_status_key_created): s/unsigned char/byte/ due to a strange typedef for RISC OS. Noted by Stefan.
2004-10-13Added SELInux hacks and did some cleanups.Werner Koch1-0/+12
2004-10-13* configure.ac: Actually name the option --disable-finger and notWerner Koch1-2/+2
http. * openfile.c (overwrite_filep, make_outfile_name, open_outfile) (open_sigfile): Use iobuf_is_pipe_filename to check for pipes so that special filesnames are taken into account. This is bug 327. * tdbdump.c (import_ownertrust): Ditto. * sign.c (write_plaintext_packet): Ditto. * progress.c (handle_progress): Ditto. * plaintext.c (handle_plaintext): Ditto. * encode.c (encode_simple, encode_crypt): Ditto. * iobuf.c (iobuf_is_pipe_filename): New. * fileutil.c (is_file_compressed): Use it here.
2004-08-08* plaintext.c (handle_plaintext): Bigger buffer for extra safety.David Shaw1-1/+1
* 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-0/+18
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-04-16* plaintext.c (handle_plaintext): Accept 'u' as a plaintext mode thatDavid Shaw1-1/+1
requires end of line conversion. This is being considered for a UTF8 text packet. If this doesn't take place, no major harm done. If it does take place, we'll get a jump on starting the changeover. * g10.c (main): --no-use-embedded-filename. * build-packet.c (calc_plaintext, do_plaintext): Do not create illegal (packet header indicates a size larger than the actual packet) encrypted data packets when not compressing and using a filename longer than 255 characters. * keyedit.c (no_primary_warning): Cleanup. (menu_expire): Don't give primary warning for subkey expiration changes. These cannot reorder primaries.
2004-02-26* delkey.c (do_delete_key): Allow deleting a public key with a secretDavid Shaw1-5/+4
present if --expert is set. * plaintext.c (handle_plaintext): Make bytecount static so it works with multiple literal packets inside a message. * encode.c, helptext.c (keygen.algo, keygen.algo.elg_se), keygen.c (ask_algo), sig-check.c (do_check_messages), skclist.c (build_sk_list): Rename "ElGamal" to "Elgamal" as that is the proper spelling nowadays. Suggested by Jon Callas.
2004-02-24* plaintext.c: Copyright.David Shaw1-1/+2
* encode.c (encode_simple): Show cipher with --verbose. * options.h, g10.c (main), keyedit.c (sign_keys): Add --ask-cert-level option to enable cert level prompts during sigs. Defaults to on. Simplify --default-cert-check-level to --default-cert-level. If ask-cert-level is off, or batch is on, use the default-cert-level as the cert level. * options.h, g10.c (main), trustdb.c (mark_usable_uid_certs): Simplify --min-cert-check-level to --min-cert-level.
2004-02-22* plaintext.c (handle_plaintext): Properly handle a --max-output of zeroDavid Shaw1-5/+5
(do not limit output at all).
2004-02-18* options.h, g10.c (main), plaintext.c (handle_plaintext): AddDavid Shaw1-21/+69
--max-output option to help people deal with decompression bombs.
2003-12-28cleaned up RISC OS code and removed lots of unnecessary stuffStefan Bellon1-4/+7