aboutsummaryrefslogtreecommitdiffstats
path: root/common/ttyio.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-06-22w32: Add fallback in case the Windows console can't cope with Unicode.Werner Koch1-4/+18
* common/ttyio.c (w32_write_console): Fallback to WriteConsoleA on error. -- To test this switch the Windows Console to "legacy mode" set LANG=de gpg --card-edit and enter an invalid command. The response contains an Umlaut and old Windows versions (and the legacy console) don't have a proper font installed for this. Without this patch this runs into a log_fatal error. The mitigation we implement is to fallback to WriteConsoleA, that is accepting wrong encoding and to print a note about the problem. GnuPG-bug-id: 5491
2021-03-05w32: Free memory allocated by new function w32_write_console.Werner Koch1-0/+1
* common/ttyio.c (w32_write_console): Free buffer. --
2021-03-05common,w32: Allow Unicode input and output with the console.Werner Koch1-31/+73
* common/ttyio.c (do_get) [W32]: Use ReadConsoleW. (w32_write_console): New. (tty_printf, tty_fprintf) [W32]: Use new function. -- Note that due this change fixed stings (i.e. gettext translations) printed to the console will not be rendered correctly unless "chcp 65001" has been used. This needs to be fixed by followup patch. GnuPG-bug-id: 4365
2021-03-05common: Re-indent ttyio.c and remove EMX, RISCOS, and CE supportWerner Koch1-248/+187
* common/ttyio.c: Remove cruft like EMX and RISCOS support. Translate a few strings. Re-indent. --
2020-07-02Support a history file in gpg-card and gpg-connect-agent.Werner Koch1-2/+37
* common/gpgrlhelp.c (read_write_history): New. (gnupg_rl_initialize): Register new function. * common/ttyio.c (my_rl_rw_history): New var. (tty_private_set_rl_hooks): Add arg read_write_history. (tty_read_history): New. (tty_write_history): New. * tools/gpg-card.c (HISTORYNAME): New. (oNoHistory): New enum value. (opts): New option --no-history. (cmd_history): New. (cmds): New command "history". (interactive_loop): Read and save the history. * tools/gpg-connect-agent.c (HISTORYNAME): New. (opts): New option --no-history. (main): Read and save the history. New command /history. -- Yeah, finally we have stored history; I should have added this much earlier. Signed-off-by: Werner Koch <[email protected]>
2019-03-07common: Minor rework of tty_get.Werner Koch1-118/+142
* common/ttyio.c (do_get): Re-indent and remove the checking for char values larger than 0xa0. Use explicy control character checking. -- The code is really old (mid 1998) and with the checking for 0xa0 it has an implicit assumption of utf-8 or latin-1. Worse, the check was for c > 0xa0 and not c == 0xa0 so it never worked as intended. Signed-off-by: Werner Koch <[email protected]>
2019-01-26gpg: Move S2K encoding function to a shared file.Werner Koch1-0/+2
* g10/passphrase.c (encode_s2k_iterations): Move function to ... * common/openpgp-s2k.c: new file. Remove default intialization code. * common/openpgpdefs.h (S2K_DECODE_COUNT): New to keep only one copy. * g10/call-agent.c (agent_get_s2k_count): Change to return the count and print an error. * agent/protect.c: Include openpgpdefs.h * g10/card-util.c (gen_kdf_data): Adjust for changes * g10/gpgcompose.c: Include call-agent.h. (sk_esk): Adjust for changes. * g10/passphrase (passphrase_to_dek): Adjust for changes. * g10/main.h (S2K_DECODE_COUNT): Remove macro. Signed-off-by: Werner Koch <[email protected]>
2017-02-21Clean up word replication.Yuri Chornoivan1-1/+1
-- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2017-01-17common: Remove unused function tty_print_string.Werner Koch1-82/+46
* common/ttyio.c (tty_print_string): Rename to ... (do_print_string): this. Make local. Simplify FP case by using print_utf8_buffer. Change caller. Signed-off-by: Werner Koch <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
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-10-28Fix typosDaniel Kahn Gillmor1-1/+1
--
2014-08-26Switch to the libgpg-error provided estream.Werner Koch1-1/+1
* configure.ac (NEED_GPG_ERROR_VERSION): Reguire 1.14. (GPGRT_ENABLE_ES_MACROS): Define. (estream_INIT): Remove. * m4/estream.m4: Remove. * common/estream-printf.c, common/estream-printf.h: Remove. * common/estream.c, common/estream.h: Remove. * common/init.c (_init_common_subsystems): Call gpgrt initialization.
2014-03-27Change some keyedit functions to allow printing to arbitrary streams.Werner Koch1-33/+82
* common/ttyio.c (tty_print_string): Add optional arg FP. Change all callers. (tty_print_utf8_string2): Ditto. * g10/keyedit.c (show_prefs): Ditto. (show_key_with_all_names_colon): Ditto. (show_names): Ditto. * g10/keylist.c (print_revokers): Ditto. (print_fingerprint): Ditto.
2014-03-07w32: Include winsock2.h to silence warnings.Werner Koch1-0/+3
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-1/+1
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.
2012-04-20Change license for some files in common to LGPLv3+/GPLv2+.Werner Koch1-5/+15
Having the LGPL on the common GnuPG code helps to share code between GnuPG and related projects (like GPGME and Libassuan). This is good for interoperability and to reduces bugs. * common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c * common/b64enc.c, common/convert.c, common/dns-cert.c * common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c * common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c * common/helpfile.c, common/homedir.c, common/http.c, common/http.h * common/i18n.c, common/init.c, common/init.h, common/iobuf.c * common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h * common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h * common/percent.c, common/pka.c, common/pka.h, common/session-env.c * common/session-env.h, common/sexp-parse.h, common/sexputil.c * common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c * common/ssh-utils.h, common/sysutils.c, common/sysutils.h * common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h * common/userids.c, common/userids.h, common/xasprintf.c: Change license to LGPLv3+/GPLv2+/
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-7/+7
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-03-24More changes for CE. gpgsm does now build and run a keylisting.Werner Koch1-16/+31
2010-03-15Finished the bulk of changes to use estream in most places instead ofWerner Koch1-25/+25
stdio.
2010-03-10Merged jnlib into common.Werner Koch1-1/+0
2009-08-11* ttyio.h, ttyio.c (tty_enable_completion): Some ifdefs aroundDavid Shaw1-3/+4
HAVE_LIBREADLINE to allow building when readline isn't available.
2009-05-26signal cleanup fixWerner Koch1-0/+8
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-26More W32 related changesWerner Koch1-1/+1
2007-06-21Implemented the --gen-key command as we can't use the gpgsm-gencert.sh under ↵Werner Koch1-1/+22
Windows.
2007-06-06First steps towards supporting W32.Werner Koch1-2/+4
This is mainly source code reorganization. Update gnulib. g10/ does currently not build.
2006-09-22Clarified cURL and OpenLDAP license issues.Werner Koch1-4/+48
Made readline support work.
2006-09-21Various updatesWerner Koch1-34/+51
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2006-05-23g10/ does build again.Werner Koch1-3/+46
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-508/+0
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-1/+1
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
2003-09-23Merged most of David Shaw's changes in 1.3 since 2003-06-03.Werner Koch1-8/+8
2003-09-18(tty_fprintf): New.Werner Koch1-3/+50
(tty_print_string, tty_print_utf8_string2) (tty_print_utf8_string): Made P argument const byte*.
2003-08-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+508
'GNUPG-1-9-BRANCH'.
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-11/+13
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
2003-05-24* argparse.c, dotlock.c, fileutil.c, iobuf.c, miscutil.c,David Shaw1-34/+33
simple-gettext.c, errors.c, http.c, memory.c, secmem.c, ttyio.c: Edit all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it.
2003-02-22* ttyio.c (tty_print_utf8_string, tty_print_utf8_string2): Use 0 toDavid Shaw1-3/+3
indicate a string with no maximum size. This prevents early truncation of strings that contain control chars which are expanded into \xXX form.
2002-11-09* ttyio.c (TERMDEVICE): Removed.Werner Koch1-14/+40
(tty_get_ttyname): New. (init_ttyfp): Use it here instead of the TERMDEVICE macro.
2002-10-19This commit was manufactured by cvs2svn to create branchRepo Admin1-481/+0
'GNUPG-1-9-BRANCH'.
2002-08-06tidying up RISC OS stuffStefan Bellon1-19/+2
2002-06-29Update head to match stable 1.0David Shaw1-43/+85
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-3/+27
2000-01-27See ChangeLog: Thu Jan 27 18:00:44 CET 2000 Werner KochWerner Koch1-0/+1
2000-01-24See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner KochWerner Koch1-8/+8
1999-09-17See ChangeLog: Fri Sep 17 12:56:42 CEST 1999 Werner KochV1-0-1Werner Koch1-19/+2
1999-09-15See ChangeLog: Wed Sep 15 16:22:17 CEST 1999 Werner KochV1-0-4V1-0-3V1-0-2V1-0-1-ePit-1Werner Koch1-0/+17
1999-08-31See ChangeLog: Tue Aug 31 17:20:44 CEST 1999 Werner KochWerner Koch1-0/+23
1999-06-15See ChangeLog: Tue Jun 15 14:23:10 CEST 1999 Werner KochWerner Koch1-0/+23