Page MenuHome GnuPG

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/THANKS b/THANKS
index a56d985df..b27952893 100644
--- a/THANKS
+++ b/THANKS
@@ -1,290 +1,291 @@
GnuPG was originally written by Werner Koch. Other people contributed
by reporting problems, suggesting various improvements or submitting
actual code. Here is a list of those people. Help us keep it
complete and free of errors.
Adam Mitchell adam at cafe21.org
Alain Guibert alguibert+gpd at free.fr
Albert Chin china at thewrittenword.com
Alec Habig habig at budoe2.bu.edu
Alexander Belopolsky belopolsky at mac.com
Allan Clark allanc at sco.com
Anand Kumria wildfire at progsoc.uts.edu.au
Andreas Haumer andreas at xss.co.at
Andrew J. Schorr aschorr at telemetry-investments.com
Anthony Carrico acarrico at memebeam.org
Anthony Mulcahy anthony at kcn.ne.jp
Ariel T Glenn ariel at columbia.edu
ARIGA Seiji ariga at os.rim.or.jp
Benjamin Donnachie benjamin at py-soft.co.uk
Bernhard Herzog bh at intevation.de
Bernard Leak thisisnotapipe.a-t.hotmail.com
Bernhard Reiter bernhard at intevation.de
Billy Halsey bshalsey at paxoo.com
Bob Dunlop bob at xyzzy.org.uk
Bob Mathews bobmathews at mindspring.com
Bodo Moeller Bodo_Moeller at public.uni-hamburg.de
Brendan O'Dea bod at debian.org
Brenno de Winter brenno at dewinter.com
Brian M. Carlson karlsson at hal-pc.org
Brian Moore bem at cmc.net
Brian Warner warner at lothar.com
Bryan Fullerton bryanf at samurai.com
Bryce Nichols bryce at bnichols.org
Carl Meijer carlm at prism.co.za
Caskey L. Dickson caskey at technocage.com
Cees van de Griend cees-list at griend.xs4all.nl
Charles Levert charles at comm.polymtl.ca
Charly Avital shavital at mac.com
Chip Salzenberg chip at valinux.com
Chris Adams cmadams at hiwaay.net
Christian Biere christianbiere at gmx.de
Christian Kurz shorty at debian.org
Christian von Roques roques at pond.sub.org
Christopher Oliver oliver at fritz.traverse.net
Christian Recktenwald chris at citecs.de
Colin Tuckley colin at tuckley.org
Daiki Ueno ueno at unixuser.org
Dan Winship danw at helixcode.com
Daniel Eisenbud eisenbud at cs.swarthmore.edu
Daniel Kahn Gillmor dkg at fifthhorseman dot net
Daniel Koening dan at chaosdorf.de
Daniel Leidert daniel leidert at wgdd.de
Daniel Resare daniel at resare.com
Dany Nativel dany at natzo.com
Dave Dykstra dwd at bell-labs.com
David C Niemi niemi at tuxers.net
David Champion dgc at uchicago.edu
David D. Scribner dscribner at bigfoot.com
David Ellement ellement at sdd.hp.com
David Hallinan hallinan at rtd.com
David Hollenberg dhollen at ISI.EDU
David Mathog MATHOG at seqaxp.bio.caltech.edu
David R. Bergstein dbergstein at home.com
David Shaw dshaw at jabberwocky.com
Detlef Lannert lannert at lannert.rz.uni-duesseldorf.de
Dimitri dmitri at advantrix.com
Dirk Lattermann dlatt at t-online.de
Dirk Meyer dirk.meyer at dinoex.sub.org
Disastry Disastry at saiknes.lv
Douglas Calvert dfc at anize.org
Ed Boraas ecxjo at esperanto.org
Edmund GRIMLEY EVANS edmundo at rano.org
Edwin Woudt edwin at woudt.nl
Enzo Michelangeli em at MailAndNews.com
Ernst Molitor ernst.molitor at uni-bonn.de
Evgeny Legerov
Fabio Coatti cova at ferrara.linux.it
Felix von Leitner leitner at amdiv.de
fish stiqz fish at analog.org
Florian Weimer Florian.Weimer at rus.uni-stuttgart.de
Francesco Potorti pot at gnu.org
Frank Donahoe fdonahoe at wilkes1.wilkes.edu
Frank Heckenbach heckenb at mi.uni-erlangen.de
Frank Stajano frank.stajano at cl.cam.ac.uk
Frank Tobin ftobin at uiuc.edu
Gabriel Rosenkoetter gr at eclipsed.net
Gaël Quéri gael at lautre.net
Gene Carter gcarter at lanier.com
Geoff Keating geoffk at ozemail.com.au
Georg Schwarz georg.schwarz at iname.com
Giampaolo Tomassoni g.tomassoni at libero.it
Gilbert Fernandes gilbert_fernandes at hotmail.com
Greg Louis glouis at dynamicro.on.ca
Greg Troxel gdt at ir.bbn.com
Gregory Steuck steuck at iname.com
Harald Denker harry at hal.westfalen.de
Holger Baust Holger.Baust at freenet-ag.de
Henrik Nordstrom henrik at henriknordstrom.net
Hendrik Buschkamp buschkamp at rheumanet.org
Holger Schurig holger at d.om.org
Holger Smolinski smolinsk at de.ibm.com
Holger Trapp Holger.Trapp at informatik.tu-chemnitz.de
Hugh Daniel hugh at toad.com
Huy Le huyle at ugcs.caltech.edu
Ian McKellar imckellar at harvestroad.com.au
Ingo Klöcker kloecker at kde.org
Ivo Timmermans itimmermans at bigfoot.com
Jan Krueger max at physics.otago.ac.nz
Jan Niehusmann jan at gondor.com
Jan-0liver Wagner jan @ intevation.de
Janusz A. Urbanowicz alex at bofh.torun.pl
James Troup james at nocrew.org
Jean-loup Gailly gzip at prep.ai.mit.edu
Jeff Long long at kestrel.cc.ukans.edu
Jeffery Von Ronne jronne at ics.uci.edu
Jens Bachem bachem at rrz.uni-koeln.de
+Jens Seidel jensseidel at users.sf.net
Jeroen C. van Gelderen jeroen at vangelderen.org
J Horacio MG homega at ciberia.es
J. Michael Ashley jashley at acm.org
Jim Bauer jfbauer at home.com
Jim Small cavenewt at my-deja.com
Joachim Backes backes at rhrk.uni-kl.de
Joe Rhett jrhett at isite.net
Joerg Honegger Joerg.Honegger at hp.com
John A. Martin jam at jamux.com
John Clizbe JPClizbe at comcast.net
John R. Shannon john at johnrshannon.com
Johnny Teveßen j.tevessen at gmx.de
Jörg Schilling schilling at fokus.gmd.de
Jos Backus Jos.Backus at nl.origin-it.com
Joseph Walton joe at kafsemo.org
Juan F. Codagnone juam at arnet.com.ar
Jun Kuriyama kuriyama at sky.rim.or.jp
Kahil D. Jallad kdj4 at cs.columbia.edu
Karl Fogel kfogel at guanabana.onshore.com
Karsten Thygesen karthy at kom.auc.dk
Katsuhiro Kondou kondou at nec.co.jp
Kazu Yamamoto kazu at iij.ad.jp
Kazuyoshi Kakihara
Keith Clayton keith at claytons.org
Ken Takusagawa ken.takusagawa.2 at gmail.com
Kevin Ryde user42 at zip.com.au
Kiss Gabor kissg at ssg.ki.iif.hu
Klaus Singvogel ks at caldera.de
Kurt Garloff garloff at suse.de
Lars Kellogg-Stedman lars at bu.edu
L. Sassaman rabbi at quickie.net
M Taylor mctaylor at privacy.nb.ca
Marcel Waldvogel mwa at arl.wustl.edu
Marco d'Itri md at linux.it
Marco Parrone marc0 at autistici.org
Marcus Brinkmann Marcus.Brinkmann at ruhr-uni-bochum.de
Mark Adler madler at alumni.caltech.edu
Mark Elbrecht snowball3 at bigfoot.com
Mark Pettit pettit at yahoo-inc.com
Markus Friedl Markus.Friedl at informatik.uni-erlangen.de
Martin Kahlert martin.kahlert at provi.de
Martin Hamilton
Martin Schulte schulte at thp.uni-koeln.de
Matt Kraai kraai at alumni.carnegiemellon.edu
Matthew Skala mskala at ansuz.sooke.bc.ca
Matthew Wilcox matthew at wil.cx
Matthias Urlichs smurf at noris.de
Max Valianskiy maxcom at maxcom.ml.org
Michael Engels michael.engels at uni-duesseldorf.de
Michael Fischer v. Mollard mfvm at gmx.de
Michael Nottebrock michaelnottebrock at gmx.net
Michael Roth mroth at nessie.de
Michael Sobolev mss at despair.transas.com
Michael Tokarev mjt at tls.msk.ru
Mike Dowling ML.Dowling at tu-bs.de
Mike McEwan mike at lotusland.demon.co.uk
Moritz Schulte moritz at chaosdorf.de
Neal H Walfield neal at cs.uml.edu
Nelson H. F. Beebe beebe at math.utah.edu
Nicolas Graner Nicolas.Graner at cri.u-psud.fr
NIIBE Yutaka gniibe at chroot.org
Niklas Hernaeus
Nimrod Zimerman zimerman at forfree.at
Norihiko Murase skeleten at shillest.net
N J Doye nic at niss.ac.uk
Oliver Haakert haakert at hsp.de
Oskari Jääskeläinen f33003a at cc.hut.fi
Pascal Scheffers Pascal at scheffers.net
Paul D. Smith psmith at baynetworks.com
Per Cederqvist ceder at lysator.liu.se
Petr Cerny pcerny at suse.cz
Phil Blundell pb at debian.org
Philippe Laliberte arsphl at oeil.qc.ca
Peter Fales psfales at lucent.com
Peter Gutmann pgut001 at cs.auckland.ac.nz
Peter Marschall Peter.Marschall at gedos.de
Peter Valchev pvalchev at openbsd.org
Petr Uzel petr.uzel at suse cz
Phong Nguyen Phong.Nguyen at ens.fr
Piotr Krukowiecki piotr at pingu.ii.uj.edu.pl
QingLong qinglong at bolizm.ihep.su
Ralph Gillen gillen at theochem.uni-duesseldorf.de
Rat ratinox at peorth.gweep.net
Ray Link rlink at pitt.edu
Reinhard Wobst R.Wobst at ifw-dresden.de
Rémi Guyomarch rguyom at mail.dotcom.fr
Reuben Sumner rasumner at wisdom.weizmann.ac.il
Richard Lefebvre rick at cerca.umontreal.ca
Richard Outerbridge outer at interlog.com
Richard Patterson vectro at yahoo.com
Robert Joop rj at rainbow.in-berlin.de
Roddy Strachan roddy at satlink.com.au
Roger Sondermann r.so at bigfoot.com
Roland Rosenfeld roland at spinnaker.rhein.de
Roman Pavlik rp at tns.cz
Ross Golder rossigee at bigfoot.com
Russell Coker russell at coker.com.au
Ryan Malayter rmalayter at bai.org
Sam Roberts sam at cogent.ca
Sami Tolvanen sami at tolvanen.com
Sascha Kiefer sk at intertivity.com
Scott Worley sworley at chkno.net
Sean MacLennan seanm at netwinder.org
Sebastian Klemke packet at convergence.de
Serge Munhoven munhoven at mema.ucl.ac.be
SL Baur steve at xemacs.org
Sten Lindgren ged at solace dot miun dot se
Stefan Bellon sbellon at sbellon.de
Dr.Stefan.Dalibor Dr.Stefan.Dalibor at bfa.de
Stefan Karrmann S.Karrmann at gmx.net
Stefan Keller dres at cs.tu-berlin.de
Steffen Ullrich ccrlphr at xensei.com
Steffen Zahn zahn at berlin.snafu.de
Steven Bakker steven at icoe.att.com
Steven Murdoch sjmurdoch at bigfoot.com
Stoyan Angelov s_angelov at filibeto.org
Susanne Schultz schultz at hsp.de
Tavis Ormandy taviso at gentoo.org
Ted Cabeen secabeen at pobox.com
Thiago Jung Bauermann jungmann at cwb.matrix.com.br
Thijmen Klok thijmen at xs4all.nl
Thomas Roessler roessler at guug.de
Tim Mooney mooney at dogbert.cc.ndsu.nodak.edu
Timo Schulz twoaday at freakmail.de
Tobias Winkler tobias.winkler at s1998.tu-chemnitz.de
Todd Vierling tv at pobox.com
TOGAWA Satoshi Satoshi.Togawa at jp.yokogawa.com
Tom Duerbusch DuerbuschT at stlouiscity.com
Tom Pegios tomp at idirect.com
Tom Spindler dogcow at home.merit.edu
Tom Zerucha tzeruch at ceddec.com
Tomas Fasth tomas.fasth at twinspot.net
Tommi Komulainen Tommi.Komulainen at iki.fi
Thomas Klausner wiz at danbala.ifoer.tuwien.ac.at
Tomasz Kozlowski tomek at rentec.com
Thomas Mikkelsen tbm at image.dk
Ulf Möller 3umoelle at informatik.uni-hamburg.de
Urko Lusa ulusa at euskalnet.net
Vincent P. Broman broman at spawar.navy.mil
Volker Quetschke quetschke at scytek.de
W Lewis wiml at hhhh.org
Walter Hofmann Walter.Hofmann at physik.stud.uni-erlangen.de
Walter Koch koch at hsp.de
Wayne Chapeskie waynec at spinnaker.com
Werner Koch wk at gnupg.org
Wim Vandeputte bunbun at reptile.rug.ac.be
Winona Brown win at huh.org
Yosiaki IIDA iida at ring.gr.jp
Yoshihiro Kajiki kajiki at ylug.org
nbecker at hns.com
Thanks to the German Unix User Group for sponsoring this project,
Martin Hamilton for hosting the first mailing list and OpenIT for
hosting the server.
The development of this software has partly (i.e. the Windows port)
been funded by the German Ministry for Economics and Technology under
grant VIB3-68553.168-001/1999.
Many thanks to my wife Gerlinde for having so much patience with
me while hacking late in the evening.
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
2006 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
modifications, as long as this notice is preserved.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 8c9cefea6..38d264c5a 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,2354 +1,2358 @@
+2009-06-02 Werner Koch <wk@g10code.com>
+
+ * gpg-agent.c (main): Run pth_kill after fork. Fixes bug#1066.
+
2009-05-19 Werner Koch <wk@g10code.com>
* gpg-agent.c (JNLIB_NEED_AFLOCAL): Define.
(create_server_socket): Use SUN_LEN macro.
2009-05-15 Werner Koch <wk@g10code.com>
Fix bug #1053.
* agent.h (lookup_ttl_t): New.
* findkey.c (unprotect): Add arg LOOKUP_TTL.
(agent_key_from_file): Ditto.
* pksign.c (agent_pksign_do): Ditto.
* command-ssh.c (ttl_from_sshcontrol): New.
(data_sign): Pass new function to agent_pksign_do.
(search_control_file): Add new arg R_TTL.
2009-05-14 Werner Koch <wk@g10code.com>
* command.c (cmd_get_passphrase): Add option --qualitybar.
* call-pinentry.c (agent_askpin): Factor some code out to ...
(setup_qualitybar): .. new.
(agent_get_passphrase): Add arg WITH_QUALITYBAR and implement it.
2009-04-14 Marcus Brinkmann <marcus@g10code.de>
* call-pinentry.c (agent_get_confirmation): Try SETNOTOK command
with pinentry.
2009-04-01 Werner Koch <wk@g10code.com>
* protect-tool.c (pe_opt): New.
(opts): Add option --agent-program. Use ARGPARSE macros.
(get_new_passphrase): Remove.
(get_passphrase): Use gpg-agent directly. Remove arg OPT_CHECK and
change all callers.
* Makefile.am (gpg_protect_tool_LDADD): Replace pwquery_libs by
LIBASSUAN_LIBS.
(gpg_protect_tool_CFLAGS): New.
* command.c (percent_plus_unescape): Remove.
(cmd_putval): Use percent_plus_unescape_inplace.
* call-scd.c (unescape_status_string): Remove.
(card_getattr_cb): Use percent_plus_unescape.
* protect-tool.c (main): Use percent_plus_unescape from common/.
(percent_plus_unescape, percent_plus_unescape_string): Remove.
2009-03-27 Werner Koch <wk@g10code.com>
* learncard.c (agent_handle_learn): Add new certtype 111.
2009-03-26 Werner Koch <wk@g10code.com>
* agent.h (MAX_DIGEST_LEN): Change to 64.
* command.c (cmd_sethash): Allow digest length of 48 and 64.
(cmd_sethash): Allow more hash algos.
* trustlist.c (reformat_name): New.
(agent_marktrusted): Use a reformatted name. Reload the table
before the update and always reload it at the end.
(agent_istrusted): Check early for the disabled flag.
2009-03-25 Werner Koch <wk@g10code.com>
* pkdecrypt.c (agent_pkdecrypt): Return a specific error message
if the key is not available.
* gpg-agent.c (main): Print a started message to show the real pid.
2009-03-20 Werner Koch <wk@g10code.com>
* learncard.c (struct kpinfo_cp_parm_s): Add field CTRL.
(struct certinfo_cb_parm_s): Ditto.
(agent_handle_learn): Set CTRL field.
(kpinfo_cb, certinfo_cb): Send progress status.
* agent.h (agent_write_status): Flag with GNUPG_GCC_A_SENTINEL.
2009-03-19 Werner Koch <wk@g10code.com>
* trustlist.c (struct trustitem_s): Add field DISABLED.
(read_one_trustfile): Parse the '!' flag.
(agent_istrusted, agent_listtrusted): Check flag.
(agent_istrusted): Add arg R_DISABLED. Change all callers.
(agent_marktrusted): Do not ask if flagged as disabled. Reverse
the order of the questions. Store the disabled flag.
* gpg-agent.c (main): Save signal mask and open fds. Restore mask
and close all fds prior to the exec. Fixes bug#1013.
2009-03-17 Werner Koch <wk@g10code.com>
* command.c (cmd_get_passphrase): Break repeat loop on error.
Show error message.
(cmd_getinfo): Add subcommand "cmd_has_option".
(command_has_option): New.
2009-03-17 Daiki Ueno <ueno@unixuser.org>
* command.c (option_value): New function.
(cmd_get_passphrase): Accept new option --repeat, which makes
gpg-agent to ask passphrase several times.
2009-03-06 Werner Koch <wk@g10code.com>
* command.c (cmd_keyinfo): New command.
(register_commands): Register it.
(agent_write_status): Make sure not to print LR or CR.
* divert-scd.c (ask_for_card): Factor shadow info parsing out to ...
* protect.c (parse_shadow_info): New.
* findkey.c (agent_key_from_file): Use make_canon_sexp.
(agent_write_private_key, unprotect, read_key_file)
(agent_key_available): Use bin2hex.
(agent_key_info_from_file): New.
(read_key_file): Log no error message for ENOENT.
2009-03-05 Werner Koch <wk@g10code.com>
* divert-scd.c (getpin_cb): Support flag 'P'. Change max_digits
from 8 to 16. Append a message about keypads.
* findkey.c (unprotect): Change max digits to 16.
2009-03-02 Werner Koch <wk@g10code.com>
* command.c (cmd_getinfo): Add subcommand "scd_running".
* call-scd.c (agent_scd_check_running): New.
* gpg-agent.c: Add missing option strings for "--batch" and
"--homedir". Reported by Petr Uzel.
* protect-tool.c (import_p12_file): Take care of canceled
passphrase entry. Fixes bug#1003.
(export_p12_file): Ditto.
2008-12-17 Werner Koch <wk@g10code.com>
* gpg-agent.c (handle_connections): Set action of all pth event
handled signals to SIG_IGN. Use a different pth_sigmask strategy.
2008-12-10 Werner Koch <wk@g10code.com>
* command.c (cmd_get_passphrase): Implement option --no-ask.
2008-12-09 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Call i18n_init before init_common_subsystems.
* preset-passphrase.c (main): Ditto.
* protect-tool.c (main): Ditto.
* command.c (cmd_preset_passphrase): Allow an arbitrary string for
the cache id.
2008-12-08 Werner Koch <wk@g10code.com>
* gpg-agent.c (handle_connections): Sync the ticker to the next
full second. This is bug#871.
2008-12-05 Werner Koch <wk@g10code.com>
* minip12.c (decrypt_block): Fix const modified of CHARSETS.
* learncard.c (sinfo_cb_parm_s): Remove superflous semicolon.
Reported by Stoyan Angelov.
2008-11-18 Werner Koch <wk@g10code.com>
* gpg-agent.c (make_libversion): New.
(my_strusage): Print libgcrypt version
2008-11-11 Werner Koch <wk@g10code.com>
* call-scd.c (membuf_data_cb): Change return type to
assuan_error_t to avoid warnings with newer libassuan versions.
2008-11-04 Werner Koch <wk@g10code.com>
* command.c (cmd_killagent): Stop the agent immediately.
(start_command_handler): Take care of GPG_ERR_EOF.
2008-10-29 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Move USE_STANDARD_SOCKET to the outer scope.
(create_socket_name): Remove arg USE_STANDARD_SOCKET. Change all
callers.
(create_server_socket): Remove IS_STANDARD_NAME and replace it by
USE_STANDARD_SOCKET. Change all callers.
(check_own_socket_running): New.
(check_own_socket, check_own_socket_thread): New.
(handle_tick): Check server socket once a minute.
(handle_connections): Remove the extra pth_wait in the shutdown
case.
2008-10-20 Werner Koch <wk@g10code.com>
* command.c (cmd_geteventcounter): Mark unused arg.
(cmd_listtrusted, cmd_pksign, cmd_pkdecrypt, cmd_genkey): Ditto.
(cmd_updatestartuptty, post_cmd_notify): Ditto.
* command-ssh.c (add_control_entry)
(ssh_handler_request_identities, ssh_handler_remove_identity)
(ssh_handler_remove_all_identities, ssh_handler_lock)
(ssh_handler_unlock): Ditto.
* call-pinentry.c (pinentry_active_p, popup_message_thread)
(agent_popup_message_stop): Ditto.
* findkey.c (agent_public_key_from_file): Ditto.
* genkey.c (check_passphrase_pattern): Ditto.
* call-scd.c (atfork_cb): Ditto.
* protect-tool.c (import_p12_cert_cb): Ditto.
* t-protect.c (main): Ditto.
2008-10-17 Werner Koch <wk@g10code.com>
* call-scd.c (start_scd) [W32]: Use snprintf again because we now
always use the estream variant.
2008-10-15 Werner Koch <wk@g10code.com>
* call-scd.c (start_scd): Enable assuan loggging if requested.
(agent_scd_check_aliveness) [W32]: Fix use of GetExitCodeProcess.
2008-10-14 Werner Koch <wk@g10code.com>
* gpg-agent.c (get_agent_scd_notify_event): Need to use a manual
reset event.
2008-09-29 Werner Koch <wk@g10code.com>
* agent.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
(GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
change all users.
2008-09-25 Werner Koch <wk@g10code.com>
* divert-scd.c (getpin_cb): Support a Reset Code style PINs..
2008-09-03 Werner Koch <wk@g10code.com>
* command.c (parse_keygrip): Use hex2bin.
(cmd_preset_passphrase): Decode the passphrase. Reported by Kiss
Gabor. Fixes #679 again.
* preset-passphrase.c (make_hexstring): Remove.
(preset_passphrase): Use bin2hex.
2008-05-27 Werner Koch <wk@g10code.com>
* trustlist.c (insert_colons): Fix stupidly wrong allocation size
computation.
2008-05-26 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Re-initialize default assuan log stream if a
log file is used.
* trustlist.c (agent_marktrusted): Use xtryasprintf and xfree.
* gpg-agent.c (main, agent_deinit_default_ctrl): Always use xfree
because our asprintf is mapped to an xmalloc style function in
util.h. Replace xstrdup by xtrystrdup.
* w32main.c (build_argv): Ditto.
* preset-passphrase.c (preset_passphrase): Ditto.
* divert-scd.c (ask_for_card): Ditto.
* command.c (option_handler): Ditto.
* command-ssh.c (ssh_handler_request_identities): Ditto.
* call-pinentry.c (start_pinentry): Ditto.
* gpg-agent.c (start_connection_thread)
(start_connection_thread_ssh): Use pth_thread_id for useful output
under W32.
(pth_thread_id) [!PTH_HAVE_PTH_THREAD_ID]: New.
2008-03-17 Werner Koch <wk@g10code.com>
* agent.h (agent_inq_pinentry_launched): New prototype.
* call-pinentry.c: Include sys/types.h and signal.h.
2008-02-14 Werner Koch <wk@g10code.com>
* command.c (agent_inq_pinentry_launched): New.
(option_handler): Add option allow-pinentry-notify.
* call-pinentry.c (getinfo_pid_cb): New.
(start_pinentry): Ask for the PID and notify the client.
2008-01-15 Marcus Brinkmann <marcus@g10code.de>
* call-pinentry.c (start_pinentry): Start pinentry in detached
mode.
2007-12-04 Werner Koch <wk@g10code.com>
* call-pinentry.c (agent_askpin): Use gnupg_get_help_string.
2007-12-03 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): s/standard_socket/use_standard_socket/ for
clarity.
(create_server_socket): New arg IS_SSH to avoid testing with
assuan commands.
2007-11-20 Werner Koch <wk@g10code.com>
* gpg-agent.c (get_agent_scd_notify_event): New.
(handle_signal): Factor SIGUSR2 code out to:
(agent_sigusr2_action): .. New.
(agent_sighup_action): Print info message here and not in
handle_signal.
(handle_connections) [PTH_EVENT_HANDLE]: Call agent_sigusr2_action.
* call-scd.c (agent_scd_check_aliveness) [W32]: Implemented.
(start_scd) [W32]: Send event-signal option.
2007-11-19 Werner Koch <wk@g10code.com>
* call-pinentry.c (agent_askpin): Set the tooltip for the quality
bar.
2007-11-15 Werner Koch <wk@g10code.com>
* agent.h (struct server_control_s): Add XAUTHORITY and
PINENTRY_USER_DATA.
* gpg-agent.c: New option --xauthority.
(main, agent_init_default_ctrl)
(agent_deinit_default_ctrl): Implemented
* command.c (cmd_updatestartuptty): Ditto.
* command-ssh.c (start_command_handler_ssh): Ditto.
* call-pinentry.c (atfork_cb): Set the environment.
(start_pinentry): Pass CTRL as arg to atfork_cb.
2007-11-14 Werner Koch <wk@g10code.com>
* call-scd.c (start_scd) [W32]: Take care of fflush peculiarities.
2007-11-07 Werner Koch <wk@g10code.com>
* agent.h: Remove errors.h.
2007-10-24 Werner Koch <wk@g10code.com>
* genkey.c (check_passphrase_constraints): Changed the wording of
the warning messages.
2007-10-19 Werner Koch <wk@g10code.com>
* protect-tool.c (get_passphrase): Use new utf8 switch fucntions.
2007-10-15 Daiki Ueno <ueno@unixuser.org> (wk)
* command-ssh.c (reenter_compare_cb): New function; imported from
genkey.c.
(ssh_identity_register): Ask initial passphrase twice.
2007-10-02 Werner Koch <wk@g10code.com>
* command.c (cmd_getinfo): Add "pid" subcommand.
2007-10-01 Werner Koch <wk@g10code.com>
* agent.h (struct server_control_s): Remove unused CONNECTION_FD.
* gpg-agent.c: Remove w32-afunix.h. Include mkdtemp.h.
(socket_nonce, socket_nonce_ssh): New.
(create_server_socket): Use assuan socket wrappers. Remove W32
specific stuff. Save the server nonce.
(check_nonce): New.
(start_connection_thread, start_connection_thread_ssh): Call it.
(handle_connections): Change args to gnupg_fd_t.
* command.c (start_command_handler): Change LISTEN_FD to gnupg_fd_t.
* command-ssh.c (start_command_handler_ssh): Ditto.
2007-09-18 Werner Koch <wk@g10code.com>
* agent.h (struct pin_entry_info_s): Add element WITH_QUALITYBAR.
* genkey.c (check_passphrase_constraints): New arg SILENT.
Changed all callers.
(agent_protect_and_store, agent_genkey): Enable qualitybar.
* call-pinentry.c (agent_askpin): Send that option.
(unescape_passphrase_string): New.
(inq_quality): New.
(estimate_passphrase_quality): New.
2007-09-14 Marcus Brinkmann <marcus@g10code.de>
* call-pinentry.c (agent_popup_message_stop): Implement kill for
Windows.
2007-08-28 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Add option --faked-system-time.
* protect-tool.c (read_and_unprotect): Print the protected-at date.
* agent.h (struct server_control_s): Add member IN_PASSWD.
* command.c (cmd_passwd): Set it.
* findkey.c (try_unprotect_cb): Use it.
* protect.c (do_encryption): Replace asprintf by xtryasprint.
(agent_protect): Create the protected-at item.
(agent_unprotect): Add optional arg PROTECTED_AT.
(merge_lists): Add args CUTOFF and CUTLEN.
(agent_unprotect): Use them.
* findkey.c (try_unprotect_cb): Add code to test for expired keys.
(unprotect): Allow changing the passphrase.
2007-08-27 Werner Koch <wk@g10code.com>
* gpg-agent.c: Add options --min-passphrase-nonalpha,
--check-passphrase-pattern and --enforce-passphrase-constraints.
(MIN_PASSPHRASE_NONALPHA): Init nonalpha option to 1.
(main): Declare options for gpgconf.
* agent.h (struct): Add members MIN_PASSPHRASE_NONALPHA,
ENFORCE_PASSPHRASE_CONSTRAINTS and CHECK_PASSPHRASE_PATTERN.
* genkey.c (nonalpha_charcount): New.
(check_passphrase_pattern): New.
(check_passphrase_constraints): Implement. Factor some code out...
(take_this_one_anyway, take_this_one_anyway2): .. New.
* call-pinentry.c (agent_show_message): New.
(agent_askpin): We better reset the pin buffer before asking.
* trustlist.c (insert_colons): New.
(agent_marktrusted): Pretty print the fpr.
2007-08-22 Werner Koch <wk@g10code.com>
* findkey.c (O_BINARY): Make sure it is defined.
(agent_write_private_key): Use O_BINARY
* protect-tool.c (import_p12_file): Add hack to allow importing of
gnupg 2.0.4 generated files.
2007-08-06 Werner Koch <wk@g10code.com>
* trustlist.c (read_one_trustfile): Add flag "cm".
(agent_istrusted): Ditto.
2007-08-02 Werner Koch <wk@g10code.com>
* gpg-agent.c: Include gc-opt-flags.h and remove their definition
here.
2007-07-13 Werner Koch <wk@g10code.com>
* genkey.c (check_passphrase_constraints): Require a confirmation
for an empty passphrase.
(agent_genkey, agent_protect_and_store): No need to repeat an
empty passphrase.
2007-07-05 Werner Koch <wk@g10code.com>
* call-scd.c (struct inq_needpin_s): New.
(inq_needpin): Pass unknown inquiries up.
2007-07-04 Werner Koch <wk@g10code.com>
* gpg-agent.c (TIMERTICK_INTERVAL): New.
(fixed_gcry_pth_init, main): Kludge to fix Pth initialization.
2007-07-03 Werner Koch <wk@g10code.com>
* gpg-agent.c (handle_connections): Do not use FD_SETSIZE for
select but compute the correct number.
2007-07-02 Werner Koch <wk@g10code.com>
* command.c (cmd_reloadagent) [W32]: New.
(register_commands) [W32]: New command RELOADAGENT.
* Makefile.am (gpg_agent_SOURCES): Remove w32main.c and w32main.h.
(gpg_agent_res_ldflags): Remove icon file as we don't have a
proper icon yet.
* gpg-agent.c (main): do not include w32main.h. Remove all calls
to w32main.c.
(agent_sighup_action): New.
(handle_signal): Use it.
2007-06-26 Werner Koch <wk@g10code.com>
* gpg-agent.c (create_directories) [W32]: Made it work.
2007-06-21 Werner Koch <wk@g10code.com>
* agent.h (ctrl_t): Remove. It is now declared in ../common/util.h.
* gpg-agent.c (check_for_running_agent): New arg SILENT. Changed
all callers.
(create_server_socket): If the standard socket is in use check
whether a agent is running and avoid starting another one.
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpg-agent.c (main): Percent escape pathname in --gpgconf-list
output.
2007-06-18 Werner Koch <wk@g10code.com>
* w32main.c (build_argv): New.
(WinMain): Use it.
* command.c (cmd_killagent) [W32]: New.
(cmd_getinfo): New.
* gpg-agent.c (get_agent_ssh_socket_name): New.
(no_force_standard_socket) New.
(create_server_socket): Use it.
* Makefile.am (gpg_agent_res_ldflags): Pass windows option to ld.
2007-06-14 Werner Koch <wk@g10code.com>
* protect-tool.c (main): Setup default socket name for
simple-pwquery.
(MAP_SPWQ_ERROR_IMPL): New. Use map_spwq_error for spqw related
error codes.
* preset-passphrase.c (main): Setup default socket name for
simple-pwquery.
(map_spwq_error): Remove.
(MAP_SPWQ_ERROR_IMPL): New.
* call-pinentry.c (start_pinentry): Use gnupg_module_name.
* call-scd.c (start_scd): Ditto.
2007-06-12 Werner Koch <wk@g10code.com>
* taskbar.c: New.
* trustlist.c (read_one_trustfile): Replace GNUPG_SYSCONFDIR by a
function call.
(read_trustfiles): Ditto.
* gpg-agent.c (main): Replace some calls by init_common_subsystems.
* preset-passphrase.c (main): Ditto.
* protect-tool.c (main): Ditto.
2007-06-11 Werner Koch <wk@g10code.com>
* Makefile.am (common_libs): Use libcommonstd macro.
(commonpth_libs): Use libcommonpth macro.
* protect-tool.c (main) [W32]: Call pth_init.
* preset-passphrase.c (main) [W32]: Replace the explicit Winsocket
init by a call to pth_init.
* trustlist.c (initialize_module_trustlist): New.
* gpg-agent.c (main): Call it.
* call-pinentry.c (initialize_module_query): Rename to
initialize_module_call_pinentry.
* minip12.c: Remove iconv.h. Add utf8conf.h. Changed all iconv
calss to use these jnlib wrappers.
2007-06-06 Werner Koch <wk@g10code.com>
* minip12.c (enum): Rename CONTEXT to ASNCONTEXT as winnt.h
defines such a symbol to access the process context.
* call-pinentry.c (dump_mutex_state) [W32]: Handle the W32Pth case.
* call-scd.c (dump_mutex_state): Ditto.
* protect-tool.c (i18n_init): Remove.
* preset-passphrase.c (i18n_init): Remove.
* gpg-agent.c (i18n_init): Remove.
2007-05-19 Marcus Brinkmann <marcus@g10code.de>
* protect-tool.c (get_passphrase): Free ORIG_CODESET on error.
2007-05-14 Werner Koch <wk@g10code.com>
* protect.c (make_shadow_info): Replace sprintf by smklen.
2007-04-20 Werner Koch <wk@g10code.com>
* gpg-agent.c (my_gcry_logger, my_gcry_outofcore_handler): Removed.
(main): Call the setup_libgcrypt_logging helper.
* protect-tool.c (my_gcry_logger): Removed.
(main): Call the setup_libgcrypt_logging helper.
2007-04-03 Werner Koch <wk@g10code.com>
* trustlist.c (read_trustfiles): Take a missing trustlist as an
empty one.
2007-03-20 Werner Koch <wk@g10code.com>
* protect-tool.c: New option --p12-charset.
* minip12.c (p12_build): Implement it.
2007-03-19 Werner Koch <wk@g10code.com>
* minip12.c: Include iconv.h.
(decrypt_block): New.
(parse_bag_encrypted_data, parse_bag_data): Use it here.
(bag_data_p, bag_decrypted_data_p): New helpers.
2007-03-06 Werner Koch <wk@g10code.com>
* gpg-agent.c (main) <gpgconf>: Add entries for all ttl options.
2007-02-20 Werner Koch <wk@g10code.com>
* call-pinentry.c (start_pinentry): Fix for OS X to allow loading
of the bundle. Tested by Benjamin Donnachie.
2007-02-14 Werner Koch <wk@g10code.com>
* gpg-agent.c: New option --pinentry-touch-file.
(get_agent_socket_name): New.
* agent.h (opt): Add pinentry_touch_file.
* call-pinentry.c (start_pinentry): Send new option to the
pinentry.
2007-01-31 Moritz Schulte <moritz@g10code.com> (wk)
* command-ssh.c (stream_read_string): Initialize LENGTH to zero.
(start_command_handler_ssh): Use es_fgetc/es_ungetc to check if
EOF has been reached before trying to process another request.
2007-01-31 Werner Koch <wk@g10code.com>
* command-ssh.c (start_command_handler_ssh):
* Makefile.am (t_common_ldadd): Add LIBICONV.
2007-01-25 Werner Koch <wk@g10code.com>
* genkey.c (check_passphrase_constraints): Get ngettext call right
and use UTF-8 aware strlen.
* protect-tool.c (get_passphrase): New arg OPT_CHECK.
(get_new_passphrase): Enable OPT_CHECK on the first call.
* command.c (cmd_get_passphrase): Implement option --check.
2007-01-24 Werner Koch <wk@g10code.com>
* gpg-agent.c (MIN_PASSPHRASE_LEN): New
(parse_rereadable_options): New option --min-passphrase-len.
* genkey.c (check_passphrase_constraints): New.
(agent_genkey, agent_protect_and_store): Call new function. Fix
memory leak.
* call-pinentry.c (agent_askpin): Allow translation of the displayed
error message.
(agent_popup_message_start): Remove arg CANCEL_BTN.
(popup_message_thread): Use --one-button option.
* command.c (cmd_passwd): Now that we don't distinguish between
assuan and regular error codes we can jump to the end on error.
2006-12-07 David Shaw <dshaw@jabberwocky.com>
* Makefile.am: Link to iconv for jnlib dependency.
2006-11-20 Werner Koch <wk@g10code.com>
* call-pinentry.c (agent_popup_message_stop): Use SIGKILL.
* call-scd.c (inq_needpin): Implement POPUPKEYPADPROMPT and
DISMISSKEYPADPROMPT.
2006-11-15 Werner Koch <wk@g10code.com>
* protect.c (make_shadow_info): Cast printf arg to unsigned int.
* minip12.c (parse_bag_encrypted_data): Ditto.
(parse_bag_data, p12_parse): Ditto.
* command-ssh.c (ssh_identity_register): Changed buffer_n to
size_t.
* agent.h (struct server_control_s): New field thread_startup.
* command.c (start_command_handler): Moved CTRL init code to ..
* gpg-agent.c (start_connection_thread): .. here.
(agent_deinit_default_ctrl): New.
(agent_init_default_ctrl): Made static.
(handle_connections): Allocate CTRL and pass it pth_spawn.
* command-ssh.c (start_command_handler_ssh): Moved CTRL init code
to ..
* gpg-agent.c (start_connection_thread_ssh): .. here.
2006-11-14 Werner Koch <wk@g10code.com>
* command.c (bump_key_eventcounter): New.
(bump_card_eventcounter): New.
(cmd_geteventcounter): New command.
* gpg-agent.c (handle_signal): Call bump_card_eventcounter.
* findkey.c (agent_write_private_key): Call bump_key_eventcounter.
* trustlist.c (agent_reload_trustlist): Ditto.
* command.c (post_cmd_notify, io_monitor): New.
(register_commands, start_command_handler): Register them.
2006-11-09 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): In detached mode connect standard
descriptors to /dev/null.
* trustlist.c (read_trustfiles): Make sure not to pass a zero size
to realloc as the C standards says that this behaves like free.
2006-11-06 Werner Koch <wk@g10code.com>
* protect-tool.c (my_strusage): Fixed typo.
2006-10-23 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): New command --gpgconf-test.
* minip12.c (parse_bag_encrypted_data, parse_bag_data): Allow for
a salt of 20 bytes.
2006-10-20 Werner Koch <wk@g10code.com>
* Makefile.am (t_common_ldadd): Use GPG_ERROR_LIBS instead -o just -l
2006-10-19 Werner Koch <wk@g10code.com>
* findkey.c (unprotect): Use it to avoid unnecessary calls to
agent_askpin.
* call-pinentry.c (pinentry_active_p): New.
2006-10-17 Werner Koch <wk@g10code.com>
* Makefile.am (gpg_agent_LDADD): Link to libcommonpth.
(gpg_agent_CFLAGS): New. This allows to only link this with Pth.
2006-10-16 Werner Koch <wk@g10code.com>
* call-pinentry.c (agent_get_confirmation): Map Cancel code here too.
* trustlist.c (agent_marktrusted): Return Cancel instead of
Not_Confirmed for the first question.
2006-10-12 Werner Koch <wk@g10code.com>
* protect-tool.c (get_passphrase): Fix if !HAVE_LANGINFO_CODESET.
2006-10-06 Werner Koch <wk@g10code.com>
* Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
(gpg_agent_LDADD): Ditto.
* divert-scd.c (divert_pksign): Use PKAUTH for the TLS algo.
2006-10-05 Werner Koch <wk@g10code.com>
* command.c (has_option_name): New.
(cmd_sethash): New --hash option.
* pksign.c (do_encode_raw_pkcs1): New.
(agent_pksign_do): Use it here for the TLS algo.
* agent.h (GCRY_MD_USER_TLS_MD5SHA1): New.
* divert-scd.c (pksign): Add case for tls-md5sha1.
* divert-scd.c (encode_md_for_card): Check that the algo is valid.
2006-10-04 Werner Koch <wk@g10code.com>
* call-pinentry.c (agent_get_passphrase): Changed to return the
unencoded passphrase.
(agent_askpin, agent_get_passphrase, agent_get_confirmation): Need
to map the cancel error.
* command.c (send_back_passphrase): New.
(cmd_get_passphrase): Use it here. Also implement --data option.
(skip_options): New.
2006-09-26 Werner Koch <wk@g10code.com>
* learncard.c (agent_handle_learn): Send back the keypair
information.
2006-09-25 Werner Koch <wk@g10code.com>
* trustlist.c (read_one_trustfile): Allow extra flags.
(struct trustitem_s): Replaced KEYFLAGS by a FLAGS struct.
Changed all code to use this.
(agent_istrusted): New arg CTRL. Changed all callers. Send back
flags.
* command.c (agent_write_status): New.
2006-09-20 Werner Koch <wk@g10code.com>
* Makefile.am: Changes to allow parallel make runs.
2006-09-15 Werner Koch <wk@g10code.com>
* trustlist.c: Entirely rewritten.
(agent_trustlist_housekeeping): Removed and removed all calls.
2006-09-14 Werner Koch <wk@g10code.com>
Replaced all call gpg_error_from_errno(errno) by
gpg_error_from_syserror().
* call-pinentry.c (start_pinentry): Replaced pipe_connect2 by
pipe_connect_ext.
* call-scd.c (start_scd): Ditto.
* command.c (start_command_handler): Replaced
init_connected_socket_server by init_socket_server_ext.
2006-09-13 Werner Koch <wk@g10code.com>
* preset-passphrase.c (main) [W32]: Check for WSAStartup error.
2006-09-08 Werner Koch <wk@g10code.com>
* call-scd.c: Add signal.h as we are referencing SIGUSR2.
2006-09-06 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (AM_CFLAGS): Add $(GPG_ERR_CFLAGS).
(gpg_agent_LDADD): Replace -lgpg-error with $(GPG_ERROR_LIBS).
2006-09-06 Werner Koch <wk@g10code.com>
* query.c: Renamed to ..
* call-pinentry.c: .. this.
* agent.h (out_of_core): Removed.
(CTRL): Removed and changed everywhere to ctrl_t.
Replaced all Assuan error codes by libgpg-error codes. Removed
all map_to_assuan_status and map_assuan_err.
* gpg-agent.c (main): Call assuan_set_assuan_err_source to have Assuan
switch to gpg-error codes.
* command.c (set_error): Adjusted.
2006-09-04 Werner Koch <wk@g10code.com>
* command.c (percent_plus_unescape): New.
(cmd_get_val, cmd_putval): New.
2006-08-29 Werner Koch <wk@g10code.com>
* command-ssh.c (stream_read_mpi): Sanity check for early
detecting of too large keys.
* gpg-agent.c (my_gcry_outofcore_handler): New.
(main): Register it.
(main): No allocate 32k secure memory (was 16k).
2006-07-31 Werner Koch <wk@g10code.com>
* preset-passphrase.c (make_hexstring): For consistency use
xtrymalloc and changed caller to use xfree. Fixed function
comment.
2006-07-29 Marcus Brinkmann <marcus@g10code.de>
* preset-passphrase.c (preset_passphrase): Do not strip off last
character of passphrase.
(make_hexstring): New function.
* command.c (cmd_preset_passphrase): Use parse_hexstring to syntax
check passphrase argument. Truncate passphrase at delimiter.
2006-07-24 Werner Koch <wk@g10code.com>
* minip12.c (build_key_bag): New args SHA1HASH and
KEYIDSTR. Append bag Attributes if these args are given.
(build_cert_sequence): ditto.
(p12_build): Calculate certificate hash and pass to build
functions.
2006-07-21 Werner Koch <wk@g10code.com>
* minip12.c (oid_pkcs_12_keyBag): New.
(parse_bag_encrypted_data): New arg R_RESULT. Support keybags and
return the key object.
(p12_parse): Take new arg into account. Free RESULT on error.
2006-06-26 Werner Koch <wk@g10code.com>
* gpg-agent.c (handle_signal): Print info for SIGUSR2 only in
verbose mode.
2006-06-22 Werner Koch <wk@g10code.com>
* command-ssh.c (make_cstring): Use memcpy instead of strncpy.
(ssh_receive_mpint_list, sexp_key_extract, data_sign): Use
xtrycalloc instead of xtrymalloc followed by memset.
2006-06-20 Werner Koch <wk@g10code.com>
* minip12.c (create_final): New arg PW. Add code to calculate the
MAC.
2006-06-09 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (gpg_agent_LDADD): Add $(NETLIBS).
(gpg_protect_tool_LDADD): Likewise.
(gpg_preset_passphrase_LDADD): Likewise.
2006-04-09 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_request_process): Removed FIXME mentioning a
possible DoS attack.
2006-04-01 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_identity_register): Make KEY_GRIP_RAW be 20
instead of 21 bytes long; do not fill KEY_GRIP_RAW[20] with NUL
byte - KEY_GRIP_RAW is a raw binary string anyway.
2006-02-09 Werner Koch <wk@g10code.com>
* call-scd.c (struct scd_local_s): New field next_local.
(scd_local_list): New.
(start_scd): Put new local into list.
(agent_reset_scd): Remove it from the list.
(agent_scd_check_aliveness): Here is the actual reason why we need
all this stuff.
(agent_reset_scd): Send the new command RESTART instead of RESET.
2005-12-16 Werner Koch <wk@g10code.com>
* minip12.c (cram_octet_string): New
(p12_parse): Use it for NDEFed bags.
(parse_bag_data): Ditto.
(string_to_key, set_key_iv, crypt_block): New arg SALTLEN.
(p12_build): Use old value 8 for new arg.
(parse_bag_encrypted_data, parse_bag_data): Allow for salts of 8
to 16 bytes. Add new arg R_CONSUMED.
2005-11-24 Werner Koch <wk@g10code.com>
* minip12.c (p12_parse): Fixed for case that the key object comes
prior to the certificate.
2005-10-19 Werner Koch <wk@g10code.com>
* divert-scd.c (getpin_cb): Hack to use it for a keypad message.
* call-scd.c (inq_needpin): Reworked to support the new KEYPADINFO.
* query.c (start_pinentry): Keep track of the owner.
(popup_message_thread, agent_popup_message_start)
(agent_popup_message_stop, agent_reset_query): New.
* command.c (start_command_handler): Make sure a popup window gets
closed.
2005-10-08 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (gpg_protect_tool_LDADD): Add ../gl/libgnu.a.
(gpg_preset_passphrase_LDADD, t_common_ldadd): Likewise.
(gpg_agent_LDADD): Add ../gl/libgnu.a after ../common/libcommon.a.
2005-09-16 Werner Koch <wk@g10code.com>
* minip12.c (build_key_sequence, build_cert_sequence): Fixed
padding.
2005-09-15 Moritz Schulte <moritz@g10code.com>
* t-protect.c (test_agent_protect): Implemented.
(main): Disable use of secure memory.
2005-09-09 Werner Koch <wk@g10code.com>
* minip12.c (p12_build): Oops, array needs to be larger for the
certificate.
(build_cert_bag): Fixed yesterdays change.
* command-ssh.c (card_key_available): Let the card handler decide
whether the card is supported here. Also get a short serial
number to return from the card handler.
2005-09-08 Werner Koch <wk@g10code.com>
* minip12.c (build_cert_bag): Use a non constructed object.
i.e. 0x80 and not 0xa0.
2005-08-16 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Use a default file name for --write-env-file.
2005-07-25 Werner Koch <wk@g10code.com>
* findkey.c (agent_public_key_from_file): Fixed array assignment.
This was the cause for random segvs.
2005-06-29 Werner Koch <wk@g10code.com>
* command-ssh.c (data_sign): Removed empty statement.
2005-06-21 Werner Koch <wk@g10code.com>
* minip12.c (create_final): Cast size_t to ulong for printf.
(build_key_bag, build_cert_bag, build_cert_sequence): Ditto.
2005-06-16 Werner Koch <wk@g10code.com>
* protect-tool.c (make_advanced): Makde RESULT a plain char.
* call-scd.c (unescape_status_string): Need to cast unsigned char*
for strcpy.
(agent_card_pksign): Made arg R_BUF an unsigned char**.
* divert-scd.c (divert_pksign): Made SIGVAL unsigned char*.
(encode_md_for_card): Initialize R_VAL and R_LEN.
* genkey.c (store_key): Made BUF unsigned.
* protect.c (do_encryption): Ditto.
(do_encryption): Made arg PROTBEGIN unsigned. Initialize RESULT
and RESULTLEN even on error.
(merge_lists): Need to cast unsigned char * for strcpy. Initialize
RESULTand RESULTLEN even on error.
(agent_unprotect): Likewise for strtoul.
(make_shadow_info): Made P and INFO plain char.
(agent_shadow_key): Made P plain char.
2005-06-15 Werner Koch <wk@g10code.com>
* query.c (agent_get_passphrase): Made HEXSTRING a char*.
* command-ssh.c (ssh_key_grip): Made arg BUFFER unsigned.
(ssh_key_grip): Simplified.
(data_sign): Initialize variables with the definition.
(ssh_convert_key_to_blob): Make sure that BLOB and BLOB_SIZE
are set to NULL on error. Cool, gcc-4 detects uninitialized stuff
beyond function boundaries; well it can't know that we do error
proper error handling so that this was not a real error.
(file_to_buffer): Likewise for BUFFER and BUFFER_N.
(data_sign): Likewise for SIG and SIG_N.
(stream_read_byte): Set B to a value even on error.
* command.c (cmd_genkey): Changed VALUE to char.
(cmd_readkey): Cast arg for gcry_sexp_sprint.
* agent.h (struct server_control_s): Made KEYGRIP unsigned.
2005-06-13 Werner Koch <wk@g10code.com>
* command-ssh.c (start_command_handler_ssh): Reset the SCD.
2005-06-09 Werner Koch <wk@g10code.com>
* gpg-agent.c (create_socket_name): New option --max-cache-ttl-ssh.
* cache.c (housekeeping): Use it.
(agent_put_cache): Use a switch to get the default ttl so that it
is easier to add more cases.
2005-06-06 Werner Koch <wk@g10code.com>
* gpg-agent.c: New option --default-cache-ttl-ssh.
* agent.h (cache_mode_t): New.
* pksign.c (agent_pksign_do): New arg CACHE_MODE to replace the
ARG IGNORE_CACHE. Changed all callers.
(agent_pksign): Ditto.
* findkey.c (agent_key_from_file): Ditto. Canged all callers.
(unprotect): Ditto.
* command-ssh.c (data_sign): Use CACHE_MODE_SSH.
* cache.c (agent_get_cache): New arg CACHE_MODE.
(agent_put_cache): Ditto. Store it in the cache.
* query.c (agent_query_dump_state, dump_mutex_state): New.
(unlock_pinentry): Reset the global context before releasing the
mutex.
* gpg-agent.c (handle_signal): Dump query.c info on SIGUSR1.
* call-scd.c (agent_scd_check_aliveness): Always do a waitpid and
add a timeout to the locking.
2005-06-03 Werner Koch <wk@g10code.com>
* command.c (cmd_updatestartuptty): New.
* gpg-agent.c: New option --write-env-file.
* gpg-agent.c (handle_connections): Make sure that the signals we
are handling are not blocked.Block signals while creating new
threads.
2005-06-02 Werner Koch <wk@g10code.com>
* call-scd.c (agent_scd_dump_state, dump_mutex_state): New.
* gpg-agent.c (handle_signal): Print it on SIGUSR1.
(handle_connections): Include the file descriptor into the
threadnames.
2005-06-01 Werner Koch <wk@g10code.com>
* gpg-agent.c: Include setenv.h.
2005-05-31 Werner Koch <wk@g10code.com>
* agent.h (out_of_core): s/__inline__/inine. Noted by Ray Link.
2005-05-25 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Do not unset the DISPLAY when we are
continuing as child.
2005-05-24 Werner Koch <wk@g10code.com>
* call-scd.c (inq_needpin): Skip leading spaces in of PIN
description.
* divert-scd.c (getpin_cb): Enhanced to cope with description
flags.
* query.c (agent_askpin): Add arg PROMPT_TEXT. Changed all
callers.
2005-05-21 Werner Koch <wk@g10code.com>
* call-scd.c (start_scd): Don't test for an alive scdaemon here.
(agent_scd_check_aliveness): New.
* gpg-agent.c (handle_tick): Test for an alive scdaemon.
(handle_signal): Print thread info on SIGUSR1.
2005-05-20 Werner Koch <wk@g10code.com>
* protect-tool.c: New option --canonical.
(show_file): Implement it.
* keyformat.txt: Define the created-at attribute for keys.
2005-05-18 Werner Koch <wk@g10code.com>
* divert-scd.c (ask_for_card): Removed the card reset kludge.
2005-05-17 Werner Koch <wk@g10code.com>
* call-scd.c (unlock_scd): Add new arg CTRL. Changed all callers.
(start_scd): Reoworked to allow for additional connections.
* agent.h (ctrl_t): Add local data for the SCdaemon.
* command.c (start_command_handler): Release SERVER_LOCAL.
* gpg-agent.c (create_server_socket): Use xmalloc.
(main): Removed option --disable-pth a dummy. Removed non-pth
code path.
(cleanup_sh): Removed. Not needed anymore.
2005-05-05 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_key_to_buffer): Rename to ...
(ssh_key_to_protected_buffer): ... this; change callers.
Improved documentation.
Use ssh_key_grip(), where gcry_pk_get_keygrip() has been used
before.
(ssh_handler_sign_request): Removed unusued variable P.
2005-04-20 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_handler_request_identities): Removed
debugging code (sleep call), which was commited unintenionally.
2005-04-20 Werner Koch <wk@g10code.com>
* minip12.c (parse_bag_encrypted_data): Fix the unpadding hack.
* gpg-agent.c: New option --disable-scdaemon.
(handle_connections): Add time event to drive ...
(handle_tick): New function.
(main): Record the parent PID. Fixed segv when using ssh and a
command.
* call-scd.c (start_scd): Take care of this option.
2005-04-03 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_request_spec): New member: secret_input.
(REQUEST_SPEC_DEFINE): New argument: secret_input.
(request_specs): Add secret_input flag.
(request_spec_lookup): New function ...
(ssh_request_process): ... use it here; depending on secret_input
flag allocate secure or non-secure memory.
2005-03-02 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (sexp_key_extract): Removed FIXME, since
xtrymallos does set errno correctly by now.
(sexp_extract_identifier): Remove const attribute from identifier.
(ssh_handler_request_identities): Remove const attribute from
key_type; removes ugly casts and FIXME.
(sexp_key_extract): Remove const attribute from comment.
(ssh_send_key_public): Remove const attribute from
key_type/comment; removes ugly cast.
(data_sign): Remove const attribute from identifier; removes ugly
cast.
(key_secret_to_public): Remove const attribute from comment;
removes ugly cast.
(ssh_handler_sign_request): Remove const attribute from p.
(sexp_key_extract): Use make_cstring().
(ssh_key_extract_comment): Likewise.
(ssh_key_to_buffer): Use secure memory for memory area to hold the
key S-Expression.
Added more comments.
2005-02-25 Werner Koch <wk@g10code.com>
* findkey.c (modify_description): Keep invalid % escapes, so that
%0A may pass through.
* agent.h (server_control_s): New field USE_AUTH_CALL.
* call-scd.c (agent_card_pksign): Make use of it.
* command-ssh.c (data_sign): Set the flag.
(ssh_send_key_public): New arg OVERRIDE_COMMENT.
(card_key_available): Add new arg CARDSN.
(ssh_handler_request_identities): Use the card s/n as comment.
(sexp_key_extract): Use GCRYMPI_FMT_STD.
(data_sign): Ditto.
* learncard.c (make_shadow_info): Moved to ..
* protect.c (make_shadow_info): .. here. Return NULL on malloc
failure. Made global.
* agent.h: Add prototype.
2005-02-24 Werner Koch <wk@g10code.com>
* call-scd.c (unescape_status_string): New. Actual a copy of
../g10/call-agent.c
(card_getattr_cb, agent_card_getattr): New.
* command-ssh.c (card_key_available): New.
(ssh_handler_request_identities): First see whether a card key is
available.
* gpg-agent.c (handle_connections): Need to check for events if
select returns with -1.
2005-02-23 Werner Koch <wk@g10code.com>
* command-ssh.c (get_passphrase): Removed.
(ssh_identity_register): Partly rewritten.
(open_control_file, search_control_file, add_control_entry): New.
(ssh_handler_request_identities): Return only files listed in our
control file.
* findkey.c (unprotect): Check for allocation error.
* agent.h (opt): Add fields to record the startup terminal
settings.
* gpg-agent.c (main): Record them and do not force keep display
with --enable-ssh-support.
* command-ssh.c (start_command_handler_ssh): Use them here.
* gpg-agent.c: Renamed option --ssh-support to
--enable-ssh-support.
* command.c (cmd_readkey): New.
(register_commands): Register new command "READKEY".
* command-ssh.c (ssh_request_process): Improved logging.
* findkey.c (agent_write_private_key): Always use plain open.
Don't depend on an umask for permissions.
(agent_key_from_file): Factored file reading code out to ..
(read_key_file): .. new function.
(agent_public_key_from_file): New.
2005-02-22 Werner Koch <wk@g10code.com>
* command-ssh.c (stream_read_string): Removed call to abort on
memory error because the CVS version of libgcrypt makes sure
that ERRNO gets always set on error even with a faulty user
supplied function.
2005-02-19 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_receive_mpint_list): Slightly rewritten, do
not use elems_secret member of key_spec.
(ssh_key_type_spec): Removed member: elems_secret.
(ssh_key_types): Removed elems_secret data.
(ssh_sexp_construct): Renamed to ...
(sexp_key_construct): ... this; changed callers.
(ssh_sexp_extract): Renamed to ...
(sexp_key_extract): ... this; changed callers.
(ssh_sexp_extract_key_type): Renamed to ...
(sexp_extract_identifier): ... this; changed callers; use
make_cstring().
Added more comments.
2005-02-18 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_sexp_construct): Rewritten generation of sexp
template, clarified.
(ssh_sexp_extract): Support shadowed-private-key-sexp; treat
protected-private key and shadowed-private-key as public keys.
(key_secret_to_public): Rewritten: simply use ssh_sexp_extract()
and ssh_sexp_construct().
2005-02-15 Werner Koch <wk@g10code.com>
* findkey.c (modify_description): Don't increment OUT_LEN during
the second pass.
2005-02-14 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (es_read_byte): Renamed to ...
(stream_es_read_byte): ... this; changed callers.
(es_write_byte): Renamed to ...
(stream_write_byte): ... this; changed callers.
(es_read_uint32): Renamed to ...
(stream_read_uint32): ... this; changed callers.
(es_write_uint32): Renamed to ...
(stream_write_uint32): ... this; changed callers.
(es_read_data): Renamed to ...
(stream_read_data): ... this; changed callers.
(es_write_data): Renamed to ...
(stream_write_data): ... this; changed callers.
(es_read_string): Renamed to ...
(stream_read_string): ... this; changed callers.
(es_read_cstring): Renamed to ...
(stream_read_cstring): ... this; changed callers.
(es_write_string): Renamed to ...
(stream_write_string): ... this; changed callers.
(es_write_cstring): Renamed to ...
(stream_write_cstring): ... this; changed callers.
(es_read_mpi): Renamed to ...
(stream_read_mpi): ... this; changed callers.
(es_write_mpi): Renamed to ...
(stream_write_mpi): ... this; changed callers.
(es_copy): Renamed to ...
(stream_copy): ... this; changed callers.
(es_read_file): Renamed to ...
(file_to_buffer): ... this; changed callers.
(ssh_identity_register): Removed variable description_length;
changed code to use asprintf for description.
(stream_write_uint32): Do not filter out the last byte of shift
expression.
(uint32_construct): New macro ...
(stream_read_uint32): ... use it; removed unnecessary cast.
2005-02-03 Werner Koch <wk@g10code.com>
* agent.h (agent_exit): Add JNLIB_GCC_A_NR to indicate that this
function won't return.
* gpg-agent.c (check_for_running_agent): Initialize pid to a
default value if not needed.
* command-ssh.c: Removed stdint.h. s/byte_t/unsigned char/,
s/uint32/u32/ becuase that is what we have always used in GnuPG.
(ssh_request_specs): Moved to top of file.
(ssh_key_types): Ditto.
(make_cstring): Ditto.
(data_sign): Don't use a variable for the passphrase prompt, make
it translatable.
(ssh_request_process):
* findkey.c (modify_description): Renamed arguments for clarity,
polished documentation. Make comment a C-string. Fixed case of
DESCRIPTION being just "%".
(agent_key_from_file): Make sure comment string to a C-string.
* gpg-agent.c (create_socket_name): Cleanup the implemntation, use
DIMof, agent_exit, removed superflous args and return the
allocated string as value. Documented. Changed callers.
(create_server_socket): Cleanups similar to above. Changed callers.
(cleanup_do): Renamed to ..
(remove_socket): .. this. Changed caller.
(handle_connections): The signals are to be handled in the select
and not in the accept. Test all FDs after returning from a
select. Remove the event tests from the accept calls. The select
already assured that the accept won't block.
2005-01-29 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_handler_request_identities)
(ssh_handler_sign_request, ssh_handler_add_identity)
(ssh_handler_remove_identity, ssh_handler_remove_all_identities)
(ssh_handler_lock, ssh_handler_unlock): Changed to return an error
code instead of a boolean.
(ssh_request_process): Changed to return a boolean instead of an
error; adjust caller.
(ssh_request_handle_t): Adjusted type.
(ssh_request_spec): New member: identifier.
(REQUEST_SPEC_DEFINE): New macro; use it for initialization of
request_specs[].
(ssh_request_process): In debugging mode, log identifier of
handler to execute.
(start_command_handler_ssh): Moved most of the stream handling
code ...
(ssh_request_process): ... here.
2005-01-28 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_handler_add_identity): Pass ctrl to
ssh_identity_register().
(ssh_identity_register): New argument: ctrl; pass ctrl to
get_passphrase().
(get_passphrase): Pass ctrl instead of NULL to agent_askpin().
(start_command_handler_ssh): Use agent_init_default_ctrl();
deallocate structure members, which might be dynamically
allocated.
(lifetime_default): Removed variable.
(ssh_handler_add_identity): Fix ttl handling; renamed variable
`death' to `ttl'.
(ssh_identity_register): Fix key grip handling.
2005-01-26 Moritz Schulte <moritz@g10code.com>
* command-ssh.c (ssh_handler_sign_request): Confirm to agent
protocol in case of failure.
* command-ssh.c: New file.
* Makefile.am (gpg_agent_SOURCES): New source file: command-ssh.c.
* findkey.c (modify_description): New function.
(agent_key_from_file): Support comment field in key s-expressions.
* gpg-agent.c (enum cmd_and_opt_values): New item: oSSHSupport.
(opts) New entry for oSSHSupport.
New variable: socket_name_ssh.
(cleanup_do): New function based on cleanup().
(cleanup): Use cleanup_do() for socket_name and socket_name_ssh.
(main): New switch case for oSSHSupport.
(main): Move socket name creation code to ...
(create_socket_name): ... this new function.
(main): Use create_socket_name() for creating socket names for
socket_name and for socket_name_ssh in case ssh support is
enabled.
Move socket creation code to ...
(create_server_socket): ... this new function.
(main): Use create_server_socket() for creating sockets.
In case standard_socket is set, do not only store a socket name in
socket_name, but also in socket_name_ssh.
Generate additional environment info strings for ssh support.
Pass additional ssh socket argument to handle_connections.
(start_connection_thread_ssh): New function.
(handle_connections): Use select to multiplex between gpg-agent
and ssh-agent protocol.
* agent.h (struct opt): New member: ssh_support.
(start_command_handler_ssh): Add prototype.
2005-01-04 Werner Koch <wk@g10code.com>
* trustlist.c (agent_marktrusted): Use "Cancel" for the first
confirmation and made the strings translatable.
* cache.c (agent_put_cache): Fix the test for using the default
TTL.
2004-12-21 Werner Koch <wk@g10code.com>
* preset-passphrase.c (preset_passphrase): Handle --passphrase.
* Makefile.am (gpg_preset_passphrase_LDADD): Reorder libs so that
pwquery may use stuff from jnlib. Conditionally add -lwsock2
(gpg_protect_tool_LDADD): Ditto.
* preset-passphrase.c (main): Use default_homedir().
(main) [W32]: Initialize sockets.
2004-12-21 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libexec_PROGRAMS): Add gpg-preset-passphrase.
(gpg_preset_passphrase_SOURCES, gpg_preset_passphrase_LDADD): New
targets.
* agent.h (opt): New member allow_cache_passphrase.
* cache.c (housekeeping): Check if R->ttl is not negative.
(agent_put_cache): Allow ttl to be negative.
* command.c (parse_hexstring): Allow something to follow the
hexstring.
(cmd_cache_passphrase): New function.
(register_commands): Add it.
* gpg-agent.c: Handle --allow-preset-passphrase.
* preset-passphrase.c: New file.
2004-12-21 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Use default_homedir().
* protect-tool.c (main): Ditto.
2004-12-20 Werner Koch <wk@g10code.com>
* gpg-agent.c (main) [W32]: Now that Mutexes work we can remove
the pth_init kludge.
(main): Add new options --[no-]use-standard-socket.
(check_for_running_agent): Check whether it is running on the
standard socket.
* call-scd.c (init_membuf, put_membuf, get_membuf): Removed. We
now use the identical implementation from ../common/membuf.c.
* pksign.c (agent_pksign): Changed arg OUTFP to OUTBUF and use
membuf functions to return the value.
* pkdecrypt.c (agent_pkdecrypt): Ditto.
* genkey.c (agent_genkey): Ditto.
* command.c (cmd_pksign, cmd_pkdecrypt, cmd_genkey): Replaced
assuan_get_data_fp() by a the membuf scheme.
(clear_outbuf, write_and_clear_outbuf): New.
2004-12-19 Werner Koch <wk@g10code.com>
* query.c (initialize_module_query): New.
* call-scd.c (initialize_module_call_scd): New.
* gpg-agent.c (main): Call them.
2004-12-18 Werner Koch <wk@g10code.com>
* gpg-agent.c (main): Remove special Pth initialize.
* agent.h (map_assuan_err): Define in terms of
map_assuan_err_with_source.
2004-12-17 Moritz Schulte <moritz@g10code.com>
* query.c: Undo change from 2004-12-05.
2004-12-15 Werner Koch <wk@g10code.com>
* gpg-agent.c [W32]: Various hacks to make it work.
* findkey.c (agent_write_private_key) [W32]: Adjust open call.
* call-scd.c (start_scd) [W32]: Don't check whether the daemon
didn't died. To hard to do under Windows.
(start_scd) [W32]: Disable sending of the event signal option.
* protect-tool.c (read_file, export_p12_file) [W32]: Use setmode
to get stdout and stin into binary mode.
2004-12-05 Moritz Schulte <moritz@g10code.com>
* query.c (start_pinentry): Allow CTRL be NULL.
2004-10-22 Werner Koch <wk@g10code.com>
* gpg-agent.c (parse_rereadable_options): Return "not handled"
when the log file has not beend hadled. This is will let the main
option processing continue. Fixed a bug introduced on 2004-09-4
resulting in logging to stderr until a HUP has been given.
(main): Don't close the listen FD.
2004-09-30 Werner Koch <wk@g10code.com>
* Makefile.am: Adjusted from gettext 1.14.
2004-09-29 Werner Koch <wk@g10code.com>
* minip12.c (parse_bag_encrypted_data): Print error if a bad
passphrase has been given.
2004-09-28 Werner Koch <wk@g10code.com>
* protect.c (agent_unprotect): Fixed wiping of CLEARTEXT. Thanks
to Moritz for pointing this out.
2004-09-25 Moritz Schulte <moritz@g10code.com>
* agent.h: Declare: agent_pksign_do.
(struct server_control_s): New member: raw_value.
* pksign.c (do_encode_md): New argument: raw_value; support
generation of raw (non-pkcs1) data objects; adjust callers.
(agent_pksign_do): New function, based on code ripped
out from agent_pksign.
(agent_pksign): Use agent_pksign_do.
* command.c (start_command_handler): Set ctrl.digest.raw_value.
2004-09-09 Werner Koch <wk@g10code.de>
* gpg-agent.c (check_for_running_agent): New.
(main): The default action is now to check for an already running
agent.
(parse_rereadable_options): Set logfile only on reread.
(main): Do not print the "is development version" note.
2004-08-20 Werner Koch <wk@g10code.de>
* gpg-agent.c: New option --max-cache-ttl. Suggested by Alexander
Belopolsky.
* cache.c (housekeeping): Use it here instead of the hardwired
default of 1 hour.
* query.c (start_pinentry): Use a timeout for the pinentry lock.
2004-08-18 Werner Koch <wk@g10code.de>
* protect-tool.c (get_passphrase): Make sure that the default
prompts passed to gpg-agent are utf-8 encoded. Add new prompt values.
(import_p12_file, import_p12_file, export_p12_file): Changed calls
to get_passphrase so that better prompts are displayed.
(get_new_passphrase): New.
2004-07-22 Werner Koch <wk@g10code.de>
* trustlist.c (read_list): Allow colons in the fingerprint.
(headerblurb): Rephrased.
* gpg-agent.c (handle_connections): Increase the stack size ot 256k.
2004-06-20 Moritz Schulte <moritz@g10code.com>
* gpg-agent.c: Include <sys/stat.h> (build fix for BSD).
2004-05-11 Werner Koch <wk@gnupg.org>
* gpg-agent.c (handle_signal): Reload the trustlist on SIGHUP.
(start_connection_thread): Hack to simulate a ticker.
* trustlist.c (agent_trustlist_housekeeping)
(agent_reload_trustlist): New. Protected all global functions
here with a simple counter which is sufficient for Pth.
2004-05-03 Werner Koch <wk@gnupg.org>
* gpg-agent.c: Remove help texts for options lile --lc-ctype.
(main): New option --allow-mark-trusted.
* trustlist.c (agent_marktrusted): Use it here.
2004-04-30 Werner Koch <wk@gnupg.org>
* protect-tool.c: New option --enable-status-msg.
(store_private_key): Print status messages for imported keys.
(read_and_unprotect): Ditto for bad passphrase.
* gpg-agent.c (parse_rereadable_options): New arg REREAD. Allow
changing oLogFile.
(current_logfile): New.
2004-04-26 Werner Koch <wk@gnupg.org>
* call-scd.c (start_scd): Do not register an event signal if we
are running as a pipe server.
2004-04-21 Werner Koch <wk@gnupg.org>
* call-scd.c (start_scd): Send event-signal option. Always check
that the scdaemon is still running.
* gpg-agent.c (handle_signal): Do not use SIGUSR{1,2} anymore for
changing the verbosity.
2004-04-16 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Tell the logging code that we are running
detached.
2004-04-06 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Use new libgcrypt thread library register
scheme.
2004-03-23 Marcus Brinkmann <marcus@g10code.de>
* gpg-agent.c (main): For now, always print the default config
file name for --gpgconf-list.
2004-03-17 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main) <gpgconf>: Fixed default value quoting.
2004-03-16 Werner Koch <wk@gnupg.org>
* gpg-agent.c (parse_rereadable_options): Use the new
DEFAULT_CACHE_TTL macro.
(main): Updated --gpgconf-list output.
2004-02-21 Werner Koch <wk@gnupg.org>
* command.c (cmd_passwd): Take acount of a key description.
* genkey.c (reenter_compare_cb): Do not set the error text.
(agent_protect_and_store, agent_genkey): Force a re-enter after a
non-matching passphrase.
* query.c (agent_askpin): Add new arg INITIAL_ERRTEXT; changed
all callers.
2004-02-19 Werner Koch <wk@gnupg.org>
* protect-tool.c: New options --have-cert and --prompt.
(export_p12_file): Read a certificate from STDIN and pass it to
p12_build. Detect a keygrip and construct the filename in that
case. Unprotcet a key if needed. Print error messages for key
formats we can't handle.
(release_passphrase): New.
(get_passphrase): New arg PROMPTNO. Return the allocated
string. Changed all callers.
* minip12.c: Revamped the build part.
(p12_build): New args CERT and CERTLEN.
2004-02-18 Werner Koch <wk@gnupg.org>
* protect-tool.c (main): Setup the used character set.
* gpg-agent.c (main): Ditto.
* gpg-agent.c (set_debug): New. New option --debug-level.
(main): New option --gpgconf-list.
2004-02-17 Werner Koch <wk@gnupg.org>
* pksign.c (do_encode_md): Cleaned up by using gcry_sexp_build.
* Makefile.am (gpg_protect_tool_SOURCES): Removed
simple-pwquery.[ch], as we once moved it to ../common.
2004-02-13 Werner Koch <wk@gnupg.org>
* command.c (cmd_setkeydesc): New.
(register_commands): Add command SETKEYDESC.
(cmd_pksign, cmd_pkdecrypt): Use the key description.
(reset_notify): Reset the description.
* findkey.c (unprotect): Add arg DESC_TEXT.
(agent_key_from_file): Ditto.
* pksign.c (agent_pksign): Ditto.
* pkdecrypt.c (agent_pkdecrypt): Ditto. Made CIPHERTEXT an
unsigned char*.
* protect-tool.c (main): New options --no-fail-on-exist, --homedir.
(store_private_key): Use them here.
2004-02-12 Werner Koch <wk@gnupg.org>
* protect-tool.c (read_file, main): Allow reading from stdin.
* Makefile.am: Include cmacros.am for common flags.
(libexec_PROGRAMS): Put gpg-protect-tool there.
2004-02-10 Werner Koch <wk@gnupg.org>
* minip12.c (parse_bag_encrypted_data): Finished implementation.
(p12_parse): Add callback args.
* protect-tool.c (import_p12_cert_cb): New.
(import_p12_file): Use it.
2004-02-06 Werner Koch <wk@gnupg.org>
* minip12.c (crypt_block): Add arg CIPHER_ALGO; changed all callers.
(set_key_iv): Add arg KEYBYTES; changed caller.
2004-02-03 Werner Koch <wk@gnupg.org>
* findkey.c (agent_key_from_file): Extra paranoid wipe.
* protect.c (agent_unprotect): Ditto.
(merge_lists): Ditto. Add arg RESULTLEN.
* pkdecrypt.c (agent_pkdecrypt): Don't show the secret key even in
debug mode.
* protect.c: Add DSA and Elgamal description.
2004-01-29 Werner Koch <wk@gnupg.org>
* agent.h (server_control_s): Add connection_fd field.
* command.c (start_command_handler): Init it here.
* gpg-agent.c (agent_init_default_ctrl): and here.
* call-scd.c: Add the CTRL arg to all functions calling start_scd
and pass it to start_scd. Changed all callers
(start_scd): Keep track of the current active connection.
(agent_reset_scd): New.
* command.c (start_command_handler): Call it here.
* learncard.c (agent_handle_learn): Add arg CTRL; changed caller.
(send_cert_back): Ditto.
2004-01-28 Werner Koch <wk@gnupg.org>
* trustlist.c (agent_marktrusted): Check whether the trustlist is
writable.
2004-01-27 Werner Koch <wk@gnupg.org>
* sexp-parse.h: Moved to ../common.
2004-01-24 Werner Koch <wk@gnupg.org>
* call-scd.c (atfork_cb): New.
(start_scd): Make sure secmem gets cleared.
* query.c (atfork_cb): New.
(start_pinentry): Make sure secmem gets cleared.
2004-01-16 Werner Koch <wk@gnupg.org>
* findkey.c (agent_key_from_file): Now return an error code so
that we have more detailed error messages in the upper layers.
This fixes the handling of pinentry's cancel button.
* pksign.c (agent_pksign): Changed accordingly.
* pkdecrypt.c (agent_pkdecrypt): Ditto.
* command.c (cmd_passwd): Ditto.
2003-12-16 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Set the prefixes for assuan logging.
2003-12-15 Werner Koch <wk@gnupg.org>
* protect.c (do_encryption): Use gcry_create_nonce instad of the
obsolete WEAK_RANDOM.
2003-11-20 Werner Koch <wk@gnupg.org>
* sexp-parse.h (snext): Don't use atoi_1 and digitp macros, so
that this file is useful by other applications too.
2003-10-27 Werner Koch <wk@gnupg.org>
* command.c (cmd_get_confirmation): New command.
2003-08-20 Timo Schulz <twoaday@freakmail.de>
* pksign.c (do_encode_md): Allocate enough space. Cast md
byte to unsigned char to prevent sign extension.
2003-08-14 Timo Schulz <twoaday@freakmail.de>
* pksign.c (do_encode_md): Due to the fact pkcs#1 padding
is now in Libgcrypt, use the new interface.
2003-07-31 Werner Koch <wk@gnupg.org>
* Makefile.am (gpg_agent_LDADD): Added INTLLIBS.
(gpg_protect_tool_SOURCES): Added simple-pwquery.[ch]
2003-07-27 Werner Koch <wk@gnupg.org>
Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2003-07-15 Werner Koch <wk@gnupg.org>
* simple-pwquery.c, simple-pwquery.h: Moved to ../common.
* Makefile.am (gpg_protect_tool_LDADD): Add simple-pwquery.o.
Removed it from xx_SOURCES.
2003-07-04 Werner Koch <wk@gnupg.org>
* gpg-agent.c (handle_connections): Kludge to allow use of Pth 1
and 2.
2003-06-30 Werner Koch <wk@gnupg.org>
* call-scd.c (learn_status_cb): Store the serialno in PARM.
2003-06-26 Werner Koch <wk@gnupg.org>
* call-scd.c (agent_card_serialno): Don't do a RESET anymore.
2003-06-25 Werner Koch <wk@gnupg.org>
* command.c (cmd_scd): New.
* call-scd.c (agent_card_scd): New.
* divert-scd.c (divert_generic_cmd): New
* call-scd.c (agent_card_learn): New callback args SINFO.
(learn_status_cb): Pass all other status lines to the sinfo
callback.
* learncard.c (release_sinfo, sinfo_cb): New.
(agent_handle_learn): Pass the new cb to the learn function and
pass the collected information back to the client's assuan
connection.
* gpg-agent.c (main): Moved pth_init before gcry_check_version.
2003-06-24 Werner Koch <wk@gnupg.org>
* gpg-agent.c (handle_connections): Adjusted for Pth 2.0
Adjusted for changes in the libgcrypt API. Some more fixes for the
libgpg-error stuff.
2003-06-04 Werner Koch <wk@gnupg.org>
Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2003-06-03 Werner Koch <wk@gnupg.org>
Changed all error codes in all files to the new libgpg-error scheme.
* agent.h: Include gpg-error.h and errno.h
* Makefile.am: Link with libgpg-error
* query.c: assuan.h is now a system header.
* genkey.c (agent_genkey): Fixed silly use of xmalloc by
xtrymalloc.
2003-04-29 Werner Koch <wk@gnupg.org>
* command.c (register_commands): Adjusted for new Assuan semantics.
* Makefile.am: Don't override LDFLAGS.
2002-12-04 Werner Koch <wk@gnupg.org>
* gpg-agent.c: New variable config_filename.
(parse_rereadable_options): New.
(main): Use it here. Add setting of default values, set
config_filename.
(reread_configuration): Filled with actual code.
2002-12-03 Werner Koch <wk@gnupg.org>
* protect-tool.c (read_key): Don't run make_canonical on a NULL
buffer.
* command.c (parse_hexstring): New.
(cmd_sethash): Use it.
(parse_keygrip): New.
(cmd_havekey, cmd_sigkey): Use it.
(cmd_passwd): New.
* genkey.c (agent_protect_and_store): New.
(store_key): Add arg FORCE.
(agent_genkey): Pass false to this force of store_key.
2002-11-13 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Switch all messages to utf-8.
* simple-pwquery.c (agent_send_all_options): Use $GPG_TTY and
stdin with ttyname.
* cache.c (new_data): Uiih - /sizeof d/sizeof *d/.
2002-11-10 Werner Koch <wk@gnupg.org>
* command.c (option_handler): Fix keep_tty check.
2002-11-06 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Make sure we have a default ttyname.
* command.c (option_handler): Check opt.keep_tty here
* query.c (start_pinentry): but not anymore here.
2002-11-05 Werner Koch <wk@gnupg.org>
* agent.h (opt,server_control_s): Move display and lc_ variables
to the control struct so that they are per connection.
* gpg-agent.c (agent_init_default_ctrl): New.
(main): Assign those command line options to new default_* variables.
Reset DISPLAY in server mode so that tehre is no implicit default.
* command.c (start_command_handler): Initialize and deinitialize
the control values.
(option_handler): Work on the ctrl values and not on the opt.
* query.c (start_pinentry): New argument CTRL to set the display
connection specific. Changed all callers to pass this value.
(agent_askpin,agent_get_passphrase,agent_get_confirmation): Add
CTRL arg and pass it ot start_pinentry.
* command.c (cmd_get_passphrase): Pass CTRL argument.
* trustlist.c (agent_marktrusted): Add CTRL argument
* command.c (cmd_marktrusted): Pass CTRL argument
* divert-scd.c (ask_for_card): Add CTRL arg.
(divert_pksign,divert_pkdecrypt): Ditto. Changed caller.
(getpin_cb): Use OPAQUE to pass the CTRL variable. Changed both
users.
* findkey.c (unprotect): Add CTRL arg.
(agent_key_from_file): Ditto.
* query.c (unlock_pinentry): Disconnect the pinentry so that we
start a new one for each request. This is required to support
clients with different environments (e.g. X magic cookies).
2002-09-05 Neal H. Walfield <neal@cs.uml.edu>
* gpg-agent.c (main) [USE_GNU_PTH]: No need to call
assuan_set_io_func as assuan is smart.
2002-09-25 Werner Koch <wk@gnupg.org>
* gpg-agent.c (handle_signal): Flush cache on SIGHUP.
* cache.c (agent_flush_cache): New.
* gpg-agent.c, agent.h: Add --keep-display and --keep-tty.
* query.c (start_pinentry): Implement them. The option passing
needs more thoughts.
2002-09-09 Werner Koch <wk@gnupg.org>
* gpg-agent.c (create_private_keys_directory)
(create_directories): New.
(main): Try to create a home directory.
2002-09-04 Neal H. Walfield <neal@g10code.de>
* gpg-agent.c (main): Use sigaction, not signal.
2002-09-03 Neal H. Walfield <neal@g10code.de>
* findkey.c: Include <fcntl.h>.
(agent_write_private_key): Prefer POSIX compatibity, open and
fdopen, over the simplicity of GNU extensions, fopen(file, "x").
2002-08-22 Werner Koch <wk@gnupg.org>
* query.c (agent_askpin): Provide the default desc text depending
on the pininfo. Do the basic PIN verification only when
min_digits is set.
2002-08-21 Werner Koch <wk@gnupg.org>
* query.c (agent_askpin): Hack to show the right default prompt.
(agent_get_passphrase): Ditto.
* trans.c: Removed and replaced all usages with standard _()
* divert-scd.c (getpin_cb): Pass a more descritive text to the
pinentry.
* Makefile.am: Renamed the binary protect-tool to gpg-protect-tool.
* protect-tool.c: Removed the note about internal use only.
* gpg-agent.c (main): New option --daemon so that the program is
not accidently started in the background.
2002-08-16 Werner Koch <wk@gnupg.org>
* call-scd.c (learn_status_cb): Handle CERTINFO status.
(agent_card_learn): Add args for certinfo cb.
* learncard.c (release_certinfo,certinfo_cb): New.
(send_cert_back): New. With factored out code from ..
(agent_handle_learn): here. Return certinfo stuff.
2002-07-26 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): New option --ignore-cache-for-signing.
* command.c (option_handler): New server option
use-cache-for-signing defaulting to true.
(cmd_pksign): handle global and per session option.
* findkey.c (agent_key_from_file, unprotect): New arg
ignore_cache. Changed all callers.
* pksign.c (agent_pksign): Likewise.
2002-06-29 Werner Koch <wk@gnupg.org>
* query.c (start_pinentry): Use GNUPG_DERAULT_PINENTRY.
* call-scd.c (start_scd): Use GNUPG_DEFAULT_SCDAEMON.
2002-06-28 Werner Koch <wk@gnupg.org>
* protect-tool.c (export_p12_file): New.
(main): New command --p12-export.
* minip12.c (create_final,p12_build,compute_tag_length): New.
(store_tag_length): New.
2002-06-27 Werner Koch <wk@gnupg.org>
* minip12.c (crypt_block): Renamed from decrypt_block, add arg to
allow encryption.
* Makefile.am (pkglib_PROGRAMS): Put protect-tool there.
* findkey.c (agent_write_private_key,agent_key_from_file)
(agent_key_available): Use GNUPG_PRIVATE_KEYS_DIR constant.
* gpg-agent.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
* protect-tool.c (store_private_key): New.
(import_p12_file): Store the new file if requested.
(main): New options --force and --store.
* gpg-agent.c (main): Set a global flag when running detached.
* query.c (start_pinentry): Pass the list of FD to keep in the
child when not running detached.
* call-scd.c (start_scd): Ditto.
2002-06-26 Werner Koch <wk@gnupg.org>
* command.c (cmd_istrusted, cmd_listtrusted, cmd_marktrusted)
(cmd_pksign, cmd_pkdecrypt, cmd_genkey, cmd_get_passphrase)
(cmd_learn): Print an error message for a failed operation.
* simple-pwquery.c, simple-pwquery.h: New.
* protect-tool. (get_passphrase): New, used to get a passphrase
from the agent if none was given on the command line.
2002-06-25 Werner Koch <wk@gnupg.org>
* protect-tool.c (rsa_key_check): New.
(import_p12_file): New.
(main): New command --p12-import.
* minip12.c, minip12.h: New.
2002-06-24 Werner Koch <wk@gnupg.org>
* protect-tool.c (read_file): New.
(read_key): Factored most code out to read_file.
2002-06-17 Werner Koch <wk@gnupg.org>
* agent.h: Add a callback function to the pin_entry_info structure.
* query.c (agent_askpin): Use the callback to check for a correct
PIN. Removed the start_err_text argument because it is not
anymore needed; changed callers.
* findkey.c (unprotect): Replace our own check loop by a callback.
(try_unprotect_cb): New.
* genkey.c (reenter_compare_cb): New.
(agent_genkey): Use this callback here. Fixed setting of the pi2
variable and a segv in case of an empty PIN.
* divert-scd.c (getpin_cb): Removed some unused stuff and
explained what we still have to change.
2002-06-12 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): New option --disable-pth.
2002-06-11 Werner Koch <wk@gnupg.org>
* protect-tool.c: Add command --show-keygrip
(show_keygrip): New.
2002-05-23 Werner Koch <wk@gnupg.org>
* call-scd.c: Seirialized all scdaeom access when using Pth.
* cache.c: Made the cache Pth-thread-safe.
(agent_unlock_cache_entry): New.
* findkey.c (unprotect): Unlock the returned cache value.
* command.c (cmd_get_passphrase): Ditto.
* gpg-agent.c (main): Register pth_read/write with Assuan.
2002-05-22 Werner Koch <wk@gnupg.org>
* query.c: Serialized all pinentry access when using Pth.
* gpg-agent.c (handle_signal,start_connection_thread)
(handle_connections): New
(main): Use the new Pth stuff to allow concurrent connections.
* command.c (start_command_handler): Add new arg FD so that the
fucntion can also be used for an already connected socket.
* Makefile.am: Link with Pth.
2002-05-14 Werner Koch <wk@gnupg.org>
* cache.c (housekeeping, agent_put_cache): Use our time() wrapper.
2002-04-26 Werner Koch <wk@gnupg.org>
* cache.c (agent_put_cache): Reinitialize the creation time and
the ttl when reusing a slot.
* call-scd.c (start_scd): Print debug messages only with debug
flags set.
* query.c (start_pinentry): Ditto.
2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* agent.h (agent_get_confirmation): Replace paramter prompt with
two parameters ok and cancel.
* query.c (agent_get_confirmation): Likewise. Implement this.
* trustlist.c (agent_marktrusted): Fix invocation of
agent_get_confirmation.
* divert-scd.c (ask_for_card): Likewise.
2002-04-24 Marcus Brinkmann <marcus@g10code.de>
* agent.h (struct opt): Add members display, ttyname, ttytype,
lc_ctype, and lc_messages.
* gpg-agent.c (enum cmd_and_opt_values): Add oDisplay, oTTYname,
oTTYtype, oLCctype, and LCmessages.
(main): Handle these options.
* command.c (option_handler): New function.
(register_commands): Register option handler.
* query.c (start_pinentry): Pass the various display and tty
options to the pinentry.
2002-04-05 Werner Koch <wk@gnupg.org>
* protect-tool.c (show_file): New. Used as default action.
2002-03-28 Werner Koch <wk@gnupg.org>
* divert-scd.c (encode_md_for_card): Don't do the pkcs-1 padding,
the scdaemon should take care of it.
(ask_for_card): Hack to not display the trailing zero.
2002-03-11 Werner Koch <wk@gnupg.org>
* learncard.c (kpinfo_cb): Remove the content restrictions from
the keyID.
2002-03-06 Werner Koch <wk@gnupg.org>
* learncard.c: New.
* divert-scd.c (ask_for_card): The serial number is binary so
convert it to hex here.
* findkey.c (agent_write_private_key): New.
* genkey.c (store_key): And use it here.
* pkdecrypt.c (agent_pkdecrypt): Changed the way the diversion is done.
* divert-scd.c (divert_pkdecrypt): Changed interface and
implemented it.
2002-03-05 Werner Koch <wk@gnupg.org>
* call-scd.c (inq_needpin): New.
(agent_card_pksign): Add getpin_cb args.
(agent_card_pkdecrypt): New.
2002-03-04 Werner Koch <wk@gnupg.org>
* pksign.c (agent_pksign): Changed how the diversion is done.
* divert-scd.c (divert_pksign): Changed interface and implemented it.
(encode_md_for_card): New.
* call-scd.c (agent_card_pksign): New.
2002-02-28 Werner Koch <wk@gnupg.org>
* pksign.c (agent_pksign): Detect whether a Smartcard is to be
used and divert the operation in this case.
* pkdecrypt.c (agent_pkdecrypt): Likewise
* findkey.c (agent_key_from_file): Add optional arg shadow_info
and have it return information about a shadowed key.
* protect.c (agent_get_shadow_info): New.
* protect.c (snext,sskip,smatch): Moved to
* sexp-parse.h: New file.
* divert-scd.c: New.
2002-02-27 Werner Koch <wk@gnupg.org>
* protect.c (agent_shadow_key): New.
* command.c (cmd_learn): New command LEARN.
* gpg-agent.c: New option --scdaemon-program.
* call-scd.c (start_scd): New. Based on query.c
* query.c: Add 2 more arguments to all uses of assuan_transact.
2002-02-18 Werner Koch <wk@gnupg.org>
* findkey.c (unprotect): Show an error message for a bad passphrase.
* command.c (cmd_marktrusted): Implemented.
* trustlist.c (agent_marktrusted): New.
(open_list): Add APPEND arg.
* query.c (agent_get_confirmation): New.
2002-02-06 Werner Koch <wk@gnupg.org>
* cache.c (housekeeping): Fixed linking in the remove case.
2002-02-01 Werner Koch <wk@gnupg.org>
* gpg-agent.c: New option --default-cache-ttl.
* cache.c (agent_put_cache): Use it.
* cache.c: Add a few debug outputs.
* protect.c (agent_private_key_type): New.
* agent.h: Add PRIVATE_KEY_ enums.
* findkey.c (agent_key_from_file): Use it to decide whether we
have to unprotect a key.
(unprotect): Cache the passphrase.
* findkey.c (agent_key_from_file,agent_key_available): The key
files do now require a ".key" suffix to make a script's life
easier.
* genkey.c (store_key): Ditto.
2002-01-31 Werner Koch <wk@gnupg.org>
* genkey.c (store_key): Protect the key.
(agent_genkey): Ask for the passphrase.
* findkey.c (unprotect): Actually unprotect the key.
* query.c (agent_askpin): Add an optional start_err_text.
2002-01-30 Werner Koch <wk@gnupg.org>
* protect.c: New.
(hash_passphrase): Based on the GnuPG 1.0.6 version.
* protect-tool.c: New
2002-01-29 Werner Koch <wk@gnupg.org>
* findkey.c (agent_key_available): New.
* command.c (cmd_havekey): New.
(register_commands): And register new command.
2002-01-20 Werner Koch <wk@gnupg.org>
* command.c (cmd_get_passphrase): Remove the plus signs.
* query.c (start_pinentry): Send no-grab option to pinentry
* gpg-agent.c (main): Move variable grab as no_grab to agent.h.
2002-01-19 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): Disable core dumps.
* cache.c: New.
* command.c (cmd_get_passphrase): Use the cache.
(cmd_clear_passphrase): Ditto.
* gpg-agent.c: Removed unused cruft and implement the socket
based server.
(my_strusage): Take bug report address from configure.ac.
* command.c (start_command_handler): Add an argument to start as
regular server.
(start_command_handler): Enable Assuan logging.
2002-01-15 Werner Koch <wk@gnupg.org>
* trustlist.c: New.
* command.c (cmd_istrusted, cmd_listtrusted, cmd_marktrusted): New.
2002-01-07 Werner Koch <wk@gnupg.org>
* genkey.c: Store the secret part and return the public part.
2002-01-03 Werner Koch <wk@gnupg.org>
* command.c (cmd_get_passphrase): New.
(cmd_clear_passphrase): New.
* query.c (agent_get_passphrase): New.
2002-01-02 Werner Koch <wk@gnupg.org>
* genkey.c: New.
* command.c (cmd_genkey): New.
* command.c (rc_to_assuan_status): Removed and changed all callers
to use map_to_assuan_status.
2001-12-19 Werner Koch <wk@gnupg.org>
* keyformat.txt: New.
2001-12-19 Marcus Brinkmann <marcus@g10code.de>
* query.c (start_pinentry): Add new argument to assuan_pipe_connect.
2001-12-18 Werner Koch <wk@gnupg.org>
* Makefile.am: Use LIBGCRYPT macros
2001-12-14 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): New option --batch. New option --debug-wait
n, so that it is possible to attach gdb when used in server mode.
* query.c (agent_askpin): Don't ask in batch mode.
* command.c: Removed the conversion macros as they are now in
../common/util.h.
2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* query.c (LINELENGTH): Removed.
(agent_askpin): Use ASSUAN_LINELENGTH, not LINELENGTH.
2001-11-19 Werner Koch <wk@gnupg.org>
* gpg-agent.c: Removed all GUI code, removed code for old
protocol. New code to use the Assuan protocol as a server and
also to communicate with a new ask-passphrase utility.
2000-11-22 Werner Koch <wk@gnupg.org>
* gpg-agent.c (main): csh support by Dan Winship, new options --sh
and --csh and set default by consulting $SHELL.
Mon Aug 21 17:59:17 CEST 2000 Werner Koch <wk@openit.de>
* gpg-agent.c (passphrase_dialog): Cleanup the window and added the
user supplied text to the window.
(main): Fixed segv in gtk_init when used without a command to start.
* gpg-agent.c: --flush option.
(req_flush): New.
(req_clear_passphrase): Implemented.
Fri Aug 18 14:27:14 CEST 2000 Werner Koch <wk@openit.de>
* gpg-agent.c: New.
* Makefile.am: New.
Copyright 2001, 2002, 2003, 2004, 2005,
2007, 2008, 2009 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
modifications, as long as this notice is preserved.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 7093ee1e6..9eec9380a 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1,2208 +1,2211 @@
/* gpg-agent.c - The GnuPG Agent
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
* 2006, 2007, 2009 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GnuPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <time.h>
#include <fcntl.h>
#include <sys/stat.h>
#ifndef HAVE_W32_SYSTEM
# include <sys/socket.h>
# include <sys/un.h>
#endif /*!HAVE_W32_SYSTEM*/
#include <unistd.h>
#include <signal.h>
#include <pth.h>
#define JNLIB_NEED_LOG_LOGV
#define JNLIB_NEED_AFLOCAL
#include "agent.h"
#include <assuan.h> /* Malloc hooks and socket wrappers. */
#include "i18n.h"
#include "mkdtemp.h" /* Gnulib replacement. */
#include "sysutils.h"
#include "setenv.h"
#include "gc-opt-flags.h"
#include "exechelp.h"
enum cmd_and_opt_values
{ aNull = 0,
oCsh = 'c',
oQuiet = 'q',
oSh = 's',
oVerbose = 'v',
oNoVerbose = 500,
aGPGConfList,
aGPGConfTest,
oOptions,
oDebug,
oDebugAll,
oDebugLevel,
oDebugWait,
oNoGreeting,
oNoOptions,
oHomedir,
oNoDetach,
oNoGrab,
oLogFile,
oServer,
oDaemon,
oBatch,
oPinentryProgram,
oPinentryTouchFile,
oDisplay,
oTTYname,
oTTYtype,
oLCctype,
oLCmessages,
oXauthority,
oScdaemonProgram,
oDefCacheTTL,
oDefCacheTTLSSH,
oMaxCacheTTL,
oMaxCacheTTLSSH,
oEnforcePassphraseConstraints,
oMinPassphraseLen,
oMinPassphraseNonalpha,
oCheckPassphrasePattern,
oMaxPassphraseDays,
oEnablePassphraseHistory,
oUseStandardSocket,
oNoUseStandardSocket,
oFakedSystemTime,
oIgnoreCacheForSigning,
oAllowMarkTrusted,
oAllowPresetPassphrase,
oKeepTTY,
oKeepDISPLAY,
oSSHSupport,
oDisableScdaemon,
oWriteEnvFile
};
static ARGPARSE_OPTS opts[] = {
{ aGPGConfList, "gpgconf-list", 256, "@" },
{ aGPGConfTest, "gpgconf-test", 256, "@" },
{ 301, NULL, 0, N_("@Options:\n ") },
{ oServer, "server", 0, N_("run in server mode (foreground)") },
{ oDaemon, "daemon", 0, N_("run in daemon mode (background)") },
{ oVerbose, "verbose", 0, N_("verbose") },
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
{ oSh, "sh", 0, N_("sh-style command output") },
{ oCsh, "csh", 0, N_("csh-style command output") },
{ oOptions, "options" , 2, N_("|FILE|read options from FILE")},
{ oDebug, "debug" ,4|16, "@"},
{ oDebugAll, "debug-all" ,0, "@"},
{ oDebugLevel, "debug-level" ,2, "@"},
{ oDebugWait,"debug-wait",1, "@"},
{ oNoDetach, "no-detach" ,0, N_("do not detach from the console")},
{ oNoGrab, "no-grab" ,0, N_("do not grab keyboard and mouse")},
{ oLogFile, "log-file" ,2, N_("use a log file for the server")},
{ oUseStandardSocket, "use-standard-socket", 0,
N_("use a standard location for the socket")},
{ oNoUseStandardSocket, "no-use-standard-socket", 0, "@"},
{ oPinentryProgram, "pinentry-program", 2 ,
N_("|PGM|use PGM as the PIN-Entry program") },
{ oPinentryTouchFile, "pinentry-touch-file", 2 , "@" },
{ oScdaemonProgram, "scdaemon-program", 2 ,
N_("|PGM|use PGM as the SCdaemon program") },
{ oDisableScdaemon, "disable-scdaemon", 0, N_("do not use the SCdaemon") },
{ oFakedSystemTime, "faked-system-time", 2, "@" }, /* (epoch time) */
{ oBatch, "batch", 0, "@" },
{ oHomedir, "homedir", 2, "@"},
{ oDisplay, "display", 2, "@" },
{ oTTYname, "ttyname", 2, "@" },
{ oTTYtype, "ttytype", 2, "@" },
{ oLCctype, "lc-ctype", 2, "@" },
{ oLCmessages, "lc-messages", 2, "@" },
{ oXauthority, "xauthority", 2, "@" },
{ oKeepTTY, "keep-tty", 0, N_("ignore requests to change the TTY")},
{ oKeepDISPLAY, "keep-display",
0, N_("ignore requests to change the X display")},
{ oDefCacheTTL, "default-cache-ttl", 4,
N_("|N|expire cached PINs after N seconds")},
{ oDefCacheTTLSSH, "default-cache-ttl-ssh", 4, "@" },
{ oMaxCacheTTL, "max-cache-ttl", 4, "@" },
{ oMaxCacheTTLSSH, "max-cache-ttl-ssh", 4, "@" },
{ oEnforcePassphraseConstraints, "enforce-passphrase-constraints", 0, "@"},
{ oMinPassphraseLen, "min-passphrase-len", 4, "@" },
{ oMinPassphraseNonalpha, "min-passphrase-nonalpha", 4, "@" },
{ oCheckPassphrasePattern, "check-passphrase-pattern", 2, "@" },
{ oMaxPassphraseDays, "max-passphrase-days", 4, "@" },
{ oEnablePassphraseHistory, "enable-passphrase-history", 0, "@" },
{ oIgnoreCacheForSigning, "ignore-cache-for-signing", 0,
N_("do not use the PIN cache when signing")},
{ oAllowMarkTrusted, "allow-mark-trusted", 0,
N_("allow clients to mark keys as \"trusted\"")},
{ oAllowPresetPassphrase, "allow-preset-passphrase", 0,
N_("allow presetting passphrase")},
{ oSSHSupport, "enable-ssh-support", 0, N_("enable ssh-agent emulation") },
{ oWriteEnvFile, "write-env-file", 2|8,
N_("|FILE|write environment settings also to FILE")},
{0}
};
#define DEFAULT_CACHE_TTL (10*60) /* 10 minutes */
#define DEFAULT_CACHE_TTL_SSH (30*60) /* 30 minutes */
#define MAX_CACHE_TTL (120*60) /* 2 hours */
#define MAX_CACHE_TTL_SSH (120*60) /* 2 hours */
#define MIN_PASSPHRASE_LEN (8)
#define MIN_PASSPHRASE_NONALPHA (1)
#define MAX_PASSPHRASE_DAYS (0)
/* The timer tick used for housekeeping stuff. For Windows we use a
longer period as the SetWaitableTimer seems to signal earlier than
the 2 seconds. */
#ifdef HAVE_W32_SYSTEM
#define TIMERTICK_INTERVAL (4)
#else
#define TIMERTICK_INTERVAL (2) /* Seconds. */
#endif
/* The list of open file descriptors at startup. Note that this list
has been allocated using the standard malloc. */
static int *startup_fd_list;
/* The signal mask at startup and a flag telling whether it is valid. */
#ifdef HAVE_SIGPROCMASK
static sigset_t startup_signal_mask;
static int startup_signal_mask_valid;
#endif
/* Flag to indicate that a shutdown was requested. */
static int shutdown_pending;
/* Counter for the currently running own socket checks. */
static int check_own_socket_running;
/* True if we are listening on the standard socket. */
static int use_standard_socket;
/* It is possible that we are currently running under setuid permissions */
static int maybe_setuid = 1;
/* Name of the communication socket used for native gpg-agent requests. */
static char *socket_name;
/* Name of the communication socket used for ssh-agent-emulation. */
static char *socket_name_ssh;
/* We need to keep track of the server's nonces (these are dummies for
POSIX systems). */
static assuan_sock_nonce_t socket_nonce;
static assuan_sock_nonce_t socket_nonce_ssh;
/* Default values for options passed to the pinentry. */
static char *default_display;
static char *default_ttyname;
static char *default_ttytype;
static char *default_lc_ctype;
static char *default_lc_messages;
static char *default_xauthority;
/* Name of a config file, which will be reread on a HUP if it is not NULL. */
static char *config_filename;
/* Helper to implement --debug-level */
static const char *debug_level;
/* Keep track of the current log file so that we can avoid updating
the log file after a SIGHUP if it didn't changed. Malloced. */
static char *current_logfile;
/* The handle_tick() function may test whether a parent is still
running. We record the PID of the parent here or -1 if it should be
watched. */
static pid_t parent_pid = (pid_t)(-1);
/*
Local prototypes.
*/
static char *create_socket_name (char *standard_name, char *template);
static gnupg_fd_t create_server_socket (char *name, int is_ssh,
assuan_sock_nonce_t *nonce);
static void create_directories (void);
static void agent_init_default_ctrl (ctrl_t ctrl);
static void agent_deinit_default_ctrl (ctrl_t ctrl);
static void handle_connections (gnupg_fd_t listen_fd,
gnupg_fd_t listen_fd_ssh);
static void check_own_socket (void);
static int check_for_running_agent (int silent, int mode);
/* Pth wrapper function definitions. */
GCRY_THREAD_OPTION_PTH_IMPL;
static int fixed_gcry_pth_init (void)
{
return pth_self ()? 0 : (pth_init () == FALSE) ? errno : 0;
}
#ifndef PTH_HAVE_PTH_THREAD_ID
static unsigned long pth_thread_id (void)
{
return (unsigned long)pth_self ();
}
#endif
/*
Functions.
*/
static char *
make_libversion (const char *libname, const char *(*getfnc)(const char*))
{
const char *s;
char *result;
if (maybe_setuid)
{
gcry_control (GCRYCTL_INIT_SECMEM, 0, 0); /* Drop setuid. */
maybe_setuid = 0;
}
s = getfnc (NULL);
result = xmalloc (strlen (libname) + 1 + strlen (s) + 1);
strcpy (stpcpy (stpcpy (result, libname), " "), s);
return result;
}
static const char *
my_strusage (int level)
{
static char *ver_gcry;
const char *p;
switch (level)
{
case 11: p = "gpg-agent (GnuPG)";
break;
case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break;
case 19: p = _("Please report bugs to <" PACKAGE_BUGREPORT ">.\n");
break;
case 20:
if (!ver_gcry)
ver_gcry = make_libversion ("libgcrypt", gcry_check_version);
p = ver_gcry;
break;
case 1:
case 40: p = _("Usage: gpg-agent [options] (-h for help)");
break;
case 41: p = _("Syntax: gpg-agent [options] [command [args]]\n"
"Secret key management for GnuPG\n");
break;
default: p = NULL;
}
return p;
}
/* Setup the debugging. With the global variable DEBUG_LEVEL set to NULL
only the active debug flags are propagated to the subsystems. With
DEBUG_LEVEL set, a specific set of debug flags is set; thus overriding
all flags already set. Note that we don't fail here, because it is
important to keep gpg-agent running even after re-reading the
options due to a SIGHUP. */
static void
set_debug (void)
{
if (!debug_level)
;
else if (!strcmp (debug_level, "none"))
opt.debug = 0;
else if (!strcmp (debug_level, "basic"))
opt.debug = DBG_ASSUAN_VALUE;
else if (!strcmp (debug_level, "advanced"))
opt.debug = DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE;
else if (!strcmp (debug_level, "expert"))
opt.debug = (DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE
|DBG_CACHE_VALUE);
else if (!strcmp (debug_level, "guru"))
opt.debug = ~0;
else
{
log_error (_("invalid debug-level `%s' given\n"), debug_level);
opt.debug = 0; /* Reset debugging, so that prior debug
statements won't have an undesired effect. */
}
if (opt.debug && !opt.verbose)
opt.verbose = 1;
if (opt.debug && opt.quiet)
opt.quiet = 0;
if (opt.debug & DBG_MPI_VALUE)
gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 2);
if (opt.debug & DBG_CRYPTO_VALUE )
gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1);
gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
}
/* Helper for cleanup to remove one socket with NAME. */
static void
remove_socket (char *name)
{
if (name && *name)
{
char *p;
remove (name);
p = strrchr (name, '/');
if (p)
{
*p = 0;
rmdir (name);
*p = '/';
}
*name = 0;
}
}
static void
cleanup (void)
{
remove_socket (socket_name);
remove_socket (socket_name_ssh);
}
/* Handle options which are allowed to be reset after program start.
Return true when the current option in PARGS could be handled and
false if not. As a special feature, passing a value of NULL for
PARGS, resets the options to the default. REREAD should be set
true if it is not the initial option parsing. */
static int
parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
{
if (!pargs)
{ /* reset mode */
opt.quiet = 0;
opt.verbose = 0;
opt.debug = 0;
opt.no_grab = 0;
opt.pinentry_program = NULL;
opt.pinentry_touch_file = NULL;
opt.scdaemon_program = NULL;
opt.def_cache_ttl = DEFAULT_CACHE_TTL;
opt.def_cache_ttl_ssh = DEFAULT_CACHE_TTL_SSH;
opt.max_cache_ttl = MAX_CACHE_TTL;
opt.max_cache_ttl_ssh = MAX_CACHE_TTL_SSH;
opt.enforce_passphrase_constraints = 0;
opt.min_passphrase_len = MIN_PASSPHRASE_LEN;
opt.min_passphrase_nonalpha = MIN_PASSPHRASE_NONALPHA;
opt.check_passphrase_pattern = NULL;
opt.max_passphrase_days = MAX_PASSPHRASE_DAYS;
opt.enable_passhrase_history = 0;
opt.ignore_cache_for_signing = 0;
opt.allow_mark_trusted = 0;
opt.disable_scdaemon = 0;
return 1;
}
switch (pargs->r_opt)
{
case oQuiet: opt.quiet = 1; break;
case oVerbose: opt.verbose++; break;
case oDebug: opt.debug |= pargs->r.ret_ulong; break;
case oDebugAll: opt.debug = ~0; break;
case oDebugLevel: debug_level = pargs->r.ret_str; break;
case oLogFile:
if (!reread)
return 0; /* not handeld */
if (!current_logfile || !pargs->r.ret_str
|| strcmp (current_logfile, pargs->r.ret_str))
{
log_set_file (pargs->r.ret_str);
assuan_set_assuan_log_stream (log_get_stream ());
xfree (current_logfile);
current_logfile = xtrystrdup (pargs->r.ret_str);
}
break;
case oNoGrab: opt.no_grab = 1; break;
case oPinentryProgram: opt.pinentry_program = pargs->r.ret_str; break;
case oPinentryTouchFile: opt.pinentry_touch_file = pargs->r.ret_str; break;
case oScdaemonProgram: opt.scdaemon_program = pargs->r.ret_str; break;
case oDisableScdaemon: opt.disable_scdaemon = 1; break;
case oDefCacheTTL: opt.def_cache_ttl = pargs->r.ret_ulong; break;
case oDefCacheTTLSSH: opt.def_cache_ttl_ssh = pargs->r.ret_ulong; break;
case oMaxCacheTTL: opt.max_cache_ttl = pargs->r.ret_ulong; break;
case oMaxCacheTTLSSH: opt.max_cache_ttl_ssh = pargs->r.ret_ulong; break;
case oEnforcePassphraseConstraints:
opt.enforce_passphrase_constraints=1;
break;
case oMinPassphraseLen: opt.min_passphrase_len = pargs->r.ret_ulong; break;
case oMinPassphraseNonalpha:
opt.min_passphrase_nonalpha = pargs->r.ret_ulong;
break;
case oCheckPassphrasePattern:
opt.check_passphrase_pattern = pargs->r.ret_str;
break;
case oMaxPassphraseDays:
opt.max_passphrase_days = pargs->r.ret_ulong;
break;
case oEnablePassphraseHistory:
opt.enable_passhrase_history = 1;
break;
case oIgnoreCacheForSigning: opt.ignore_cache_for_signing = 1; break;
case oAllowMarkTrusted: opt.allow_mark_trusted = 1; break;
case oAllowPresetPassphrase: opt.allow_preset_passphrase = 1; break;
default:
return 0; /* not handled */
}
return 1; /* handled */
}
/* The main entry point. */
int
main (int argc, char **argv )
{
ARGPARSE_ARGS pargs;
int orig_argc;
int may_coredump;
char **orig_argv;
FILE *configfp = NULL;
char *configname = NULL;
const char *shell;
unsigned configlineno;
int parse_debug = 0;
int default_config =1;
int greeting = 0;
int nogreeting = 0;
int pipe_server = 0;
int is_daemon = 0;
int nodetach = 0;
int csh_style = 0;
char *logfile = NULL;
int debug_wait = 0;
int gpgconf_list = 0;
gpg_error_t err;
const char *env_file_name = NULL;
/* Before we do anything else we save the list of currently open
file descriptors and the signal mask. This info is required to
do the exec call properly. */
startup_fd_list = get_all_open_fds ();
#ifdef HAVE_SIGPROCMASK
if (!sigprocmask (SIG_UNBLOCK, NULL, &startup_signal_mask))
startup_signal_mask_valid = 1;
#endif /*HAVE_SIGPROCMASK*/
/* Set program name etc. */
set_strusage (my_strusage);
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
/* Please note that we may running SUID(ROOT), so be very CAREFUL
when adding any stuff between here and the call to INIT_SECMEM()
somewhere after the option parsing */
log_set_prefix ("gpg-agent", JNLIB_LOG_WITH_PREFIX|JNLIB_LOG_WITH_PID);
/* Make sure that our subsystems are ready. */
i18n_init ();
init_common_subsystems ();
/* Libgcrypt requires us to register the threading model first.
Note that this will also do the pth_init. */
gcry_threads_pth.init = fixed_gcry_pth_init;
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
if (err)
{
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
gpg_strerror (err));
}
/* Check that the libraries are suitable. Do it here because
the option parsing may need services of the library. */
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
{
log_fatal( _("%s is too old (need %s, have %s)\n"), "libgcrypt",
NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
}
assuan_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
assuan_set_assuan_log_stream (log_get_stream ());
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
assuan_set_assuan_err_source (GPG_ERR_SOURCE_DEFAULT);
setup_libgcrypt_logging ();
gcry_control (GCRYCTL_USE_SECURE_RNDPOOL);
may_coredump = disable_core_dumps ();
/* Set default options. */
parse_rereadable_options (NULL, 0); /* Reset them to default values. */
#ifdef HAVE_W32_SYSTEM
use_standard_socket = 1; /* Under Windows we always use a standard
socket. */
#endif
shell = getenv ("SHELL");
if (shell && strlen (shell) >= 3 && !strcmp (shell+strlen (shell)-3, "csh") )
csh_style = 1;
opt.homedir = default_homedir ();
/* Record some of the original environment strings. */
opt.startup_display = getenv ("DISPLAY");
if (opt.startup_display)
opt.startup_display = xstrdup (opt.startup_display);
opt.startup_ttyname = ttyname (0);
if (opt.startup_ttyname)
opt.startup_ttyname = xstrdup (opt.startup_ttyname);
opt.startup_ttytype = getenv ("TERM");
if (opt.startup_ttytype)
opt.startup_ttytype = xstrdup (opt.startup_ttytype);
/* Fixme: Better use the locale function here. */
opt.startup_lc_ctype = getenv ("LC_CTYPE");
if (opt.startup_lc_ctype)
opt.startup_lc_ctype = xstrdup (opt.startup_lc_ctype);
opt.startup_lc_messages = getenv ("LC_MESSAGES");
if (opt.startup_lc_messages)
opt.startup_lc_messages = xstrdup (opt.startup_lc_messages);
opt.startup_xauthority = getenv ("XAUTHORITY");
if (opt.startup_xauthority)
opt.startup_xauthority = xstrdup (opt.startup_xauthority);
opt.startup_pinentry_user_data = getenv ("PINENTRY_USER_DATA");
if (opt.startup_pinentry_user_data)
opt.startup_pinentry_user_data = xstrdup (opt.startup_pinentry_user_data);
/* Check whether we have a config file on the commandline */
orig_argc = argc;
orig_argv = argv;
pargs.argc = &argc;
pargs.argv = &argv;
pargs.flags= 1|(1<<6); /* do not remove the args, ignore version */
while (arg_parse( &pargs, opts))
{
if (pargs.r_opt == oDebug || pargs.r_opt == oDebugAll)
parse_debug++;
else if (pargs.r_opt == oOptions)
{ /* yes there is one, so we do not try the default one, but
read the option file when it is encountered at the
commandline */
default_config = 0;
}
else if (pargs.r_opt == oNoOptions)
default_config = 0; /* --no-options */
else if (pargs.r_opt == oHomedir)
opt.homedir = pargs.r.ret_str;
}
/* Initialize the secure memory. */
gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0);
maybe_setuid = 0;
/*
Now we are now working under our real uid
*/
if (default_config)
configname = make_filename (opt.homedir, "gpg-agent.conf", NULL );
argc = orig_argc;
argv = orig_argv;
pargs.argc = &argc;
pargs.argv = &argv;
pargs.flags= 1; /* do not remove the args */
next_pass:
if (configname)
{
configlineno = 0;
configfp = fopen (configname, "r");
if (!configfp)
{
if (default_config)
{
if( parse_debug )
log_info (_("NOTE: no default option file `%s'\n"),
configname );
}
else
{
log_error (_("option file `%s': %s\n"),
configname, strerror(errno) );
exit(2);
}
xfree (configname);
configname = NULL;
}
if (parse_debug && configname )
log_info (_("reading options from `%s'\n"), configname );
default_config = 0;
}
while (optfile_parse( configfp, configname, &configlineno, &pargs, opts) )
{
if (parse_rereadable_options (&pargs, 0))
continue; /* Already handled */
switch (pargs.r_opt)
{
case aGPGConfList: gpgconf_list = 1; break;
case aGPGConfTest: gpgconf_list = 2; break;
case oBatch: opt.batch=1; break;
case oDebugWait: debug_wait = pargs.r.ret_int; break;
case oOptions:
/* config files may not be nested (silently ignore them) */
if (!configfp)
{
xfree(configname);
configname = xstrdup(pargs.r.ret_str);
goto next_pass;
}
break;
case oNoGreeting: nogreeting = 1; break;
case oNoVerbose: opt.verbose = 0; break;
case oNoOptions: break; /* no-options */
case oHomedir: opt.homedir = pargs.r.ret_str; break;
case oNoDetach: nodetach = 1; break;
case oLogFile: logfile = pargs.r.ret_str; break;
case oCsh: csh_style = 1; break;
case oSh: csh_style = 0; break;
case oServer: pipe_server = 1; break;
case oDaemon: is_daemon = 1; break;
case oDisplay: default_display = xstrdup (pargs.r.ret_str); break;
case oTTYname: default_ttyname = xstrdup (pargs.r.ret_str); break;
case oTTYtype: default_ttytype = xstrdup (pargs.r.ret_str); break;
case oLCctype: default_lc_ctype = xstrdup (pargs.r.ret_str); break;
case oLCmessages: default_lc_messages = xstrdup (pargs.r.ret_str);
case oXauthority: default_xauthority = xstrdup (pargs.r.ret_str);
break;
case oUseStandardSocket: use_standard_socket = 1; break;
case oNoUseStandardSocket: use_standard_socket = 0; break;
case oFakedSystemTime:
{
time_t faked_time = isotime2epoch (pargs.r.ret_str);
if (faked_time == (time_t)(-1))
faked_time = (time_t)strtoul (pargs.r.ret_str, NULL, 10);
gnupg_set_time (faked_time, 0);
}
break;
case oKeepTTY: opt.keep_tty = 1; break;
case oKeepDISPLAY: opt.keep_display = 1; break;
case oSSHSupport: opt.ssh_support = 1; break;
case oWriteEnvFile:
if (pargs.r_type)
env_file_name = pargs.r.ret_str;
else
env_file_name = make_filename ("~/.gpg-agent-info", NULL);
break;
default : pargs.err = configfp? 1:2; break;
}
}
if (configfp)
{
fclose( configfp );
configfp = NULL;
/* Keep a copy of the name so that it can be read on SIGHUP. */
config_filename = configname;
configname = NULL;
goto next_pass;
}
xfree (configname);
configname = NULL;
if (log_get_errorcount(0))
exit(2);
if (nogreeting )
greeting = 0;
if (greeting)
{
fprintf (stderr, "%s %s; %s\n",
strusage(11), strusage(13), strusage(14) );
fprintf (stderr, "%s\n", strusage(15) );
}
#ifdef IS_DEVELOPMENT_VERSION
/* We don't want to print it here because gpg-agent is useful of its
own and quite matured. */
/*log_info ("NOTE: this is a development version!\n");*/
#endif
set_debug ();
if (atexit (cleanup))
{
log_error ("atexit failed\n");
cleanup ();
exit (1);
}
initialize_module_call_pinentry ();
initialize_module_call_scd ();
initialize_module_trustlist ();
/* Try to create missing directories. */
create_directories ();
if (debug_wait && pipe_server)
{
log_debug ("waiting for debugger - my pid is %u .....\n",
(unsigned int)getpid());
gnupg_sleep (debug_wait);
log_debug ("... okay\n");
}
if (gpgconf_list == 2)
agent_exit (0);
if (gpgconf_list)
{
char *filename;
char *filename_esc;
/* List options and default values in the GPG Conf format. */
filename = make_filename (opt.homedir, "gpg-agent.conf", NULL );
filename_esc = percent_escape (filename, NULL);
printf ("gpgconf-gpg-agent.conf:%lu:\"%s\n",
GC_OPT_FLAG_DEFAULT, filename_esc);
xfree (filename);
xfree (filename_esc);
printf ("verbose:%lu:\n"
"quiet:%lu:\n"
"debug-level:%lu:\"none:\n"
"log-file:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME,
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME,
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME,
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME );
printf ("default-cache-ttl:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, DEFAULT_CACHE_TTL );
printf ("default-cache-ttl-ssh:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, DEFAULT_CACHE_TTL_SSH );
printf ("max-cache-ttl:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, MAX_CACHE_TTL );
printf ("max-cache-ttl-ssh:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, MAX_CACHE_TTL_SSH );
printf ("enforce-passphrase-constraints:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
printf ("min-passphrase-len:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME, MIN_PASSPHRASE_LEN );
printf ("min-passphrase-nonalpha:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME,
MIN_PASSPHRASE_NONALPHA);
printf ("check-passphrase-pattern:%lu:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME);
printf ("max-passphrase-days:%lu:%d:\n",
GC_OPT_FLAG_DEFAULT|GC_OPT_FLAG_RUNTIME,
MAX_PASSPHRASE_DAYS);
printf ("enable-passphrase-history:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
printf ("no-grab:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
printf ("ignore-cache-for-signing:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
printf ("allow-mark-trusted:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
printf ("disable-scdaemon:%lu:\n",
GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME);
agent_exit (0);
}
/* If this has been called without any options, we merely check
whether an agent is already running. We do this here so that we
don't clobber a logfile but print it directly to stderr. */
if (!pipe_server && !is_daemon)
{
log_set_prefix (NULL, JNLIB_LOG_WITH_PREFIX);
check_for_running_agent (0, 0);
agent_exit (0);
}
#ifdef ENABLE_NLS
/* gpg-agent usually does not output any messages because it runs in
the background. For log files it is acceptable to have messages
always encoded in utf-8. We switch here to utf-8, so that
commands like --help still give native messages. It is far
easier to switch only once instead of for every message and it
actually helps when more then one thread is active (avoids an
extra copy step). */
bind_textdomain_codeset (PACKAGE_GT, "UTF-8");
#endif
/* Now start with logging to a file if this is desired. */
if (logfile)
{
log_set_file (logfile);
log_set_prefix (NULL, (JNLIB_LOG_WITH_PREFIX
|JNLIB_LOG_WITH_TIME
|JNLIB_LOG_WITH_PID));
current_logfile = xstrdup (logfile);
assuan_set_assuan_log_stream (log_get_stream ());
}
/* Make sure that we have a default ttyname. */
if (!default_ttyname && ttyname (1))
default_ttyname = xstrdup (ttyname (1));
if (!default_ttytype && getenv ("TERM"))
default_ttytype = xstrdup (getenv ("TERM"));
if (pipe_server)
{
/* This is the simple pipe based server */
ctrl_t ctrl;
ctrl = xtrycalloc (1, sizeof *ctrl);
if (!ctrl)
{
log_error ("error allocating connection control data: %s\n",
strerror (errno) );
agent_exit (1);
}
agent_init_default_ctrl (ctrl);
start_command_handler (ctrl, GNUPG_INVALID_FD, GNUPG_INVALID_FD);
agent_deinit_default_ctrl (ctrl);
xfree (ctrl);
}
else if (!is_daemon)
; /* NOTREACHED */
else
{ /* Regular server mode */
gnupg_fd_t fd;
gnupg_fd_t fd_ssh;
pid_t pid;
/* Remove the DISPLAY variable so that a pinentry does not
default to a specific display. There is still a default
display when gpg-agent was started using --display or a
client requested this using an OPTION command. Note, that we
don't do this when running in reverse daemon mode (i.e. when
exec the program given as arguments). */
#ifndef HAVE_W32_SYSTEM
if (!opt.keep_display && !argc)
unsetenv ("DISPLAY");
#endif
/* Create the sockets. */
socket_name = create_socket_name
("S.gpg-agent", "/tmp/gpg-XXXXXX/S.gpg-agent");
if (opt.ssh_support)
socket_name_ssh = create_socket_name
("S.gpg-agent.ssh", "/tmp/gpg-XXXXXX/S.gpg-agent.ssh");
fd = create_server_socket (socket_name, 0, &socket_nonce);
if (opt.ssh_support)
fd_ssh = create_server_socket (socket_name_ssh, 1, &socket_nonce_ssh);
else
fd_ssh = GNUPG_INVALID_FD;
/* If we are going to exec a program in the parent, we record
the PID, so that the child may check whether the program is
still alive. */
if (argc)
parent_pid = getpid ();
fflush (NULL);
#ifdef HAVE_W32_SYSTEM
pid = getpid ();
printf ("set GPG_AGENT_INFO=%s;%lu;1\n", socket_name, (ulong)pid);
#else /*!HAVE_W32_SYSTEM*/
pid = fork ();
if (pid == (pid_t)-1)
{
log_fatal ("fork failed: %s\n", strerror (errno) );
exit (1);
}
else if (pid)
{ /* We are the parent */
char *infostr, *infostr_ssh_sock, *infostr_ssh_pid;
/* Close the socket FD. */
close (fd);
/* Note that we used a standard fork so that Pth runs in
both the parent and the child. The pth_fork would
terminate Pth in the child but that is not the way we
want it. Thus we use a plain fork and terminate Pth here
in the parent. The pth_kill may or may not work reliable
but it should not harm to call it. Because Pth fiddles
with the signal mask the signal mask might not be correct
right now and thus we restore it. That is not strictly
necessary but some programs falsely assume a cleared
signal mask. */
+ if ( !pth_kill () )
+ log_error ("pth_kill failed in foked process\n");
+
#ifdef HAVE_SIGPROCMASK
if (startup_signal_mask_valid)
{
if (sigprocmask (SIG_SETMASK, &startup_signal_mask, NULL))
log_error ("error restoring signal mask: %s\n",
strerror (errno));
}
else
log_info ("no saved signal mask\n");
#endif /*HAVE_SIGPROCMASK*/
/* Create the info string: <name>:<pid>:<protocol_version> */
if (asprintf (&infostr, "GPG_AGENT_INFO=%s:%lu:1",
socket_name, (ulong)pid ) < 0)
{
log_error ("out of core\n");
kill (pid, SIGTERM);
exit (1);
}
if (opt.ssh_support)
{
if (asprintf (&infostr_ssh_sock, "SSH_AUTH_SOCK=%s",
socket_name_ssh) < 0)
{
log_error ("out of core\n");
kill (pid, SIGTERM);
exit (1);
}
if (asprintf (&infostr_ssh_pid, "SSH_AGENT_PID=%u",
pid) < 0)
{
log_error ("out of core\n");
kill (pid, SIGTERM);
exit (1);
}
}
*socket_name = 0; /* Don't let cleanup() remove the socket -
the child should do this from now on */
if (opt.ssh_support)
*socket_name_ssh = 0;
if (env_file_name)
{
FILE *fp;
fp = fopen (env_file_name, "w");
if (!fp)
log_error (_("error creating `%s': %s\n"),
env_file_name, strerror (errno));
else
{
fputs (infostr, fp);
putc ('\n', fp);
if (opt.ssh_support)
{
fputs (infostr_ssh_sock, fp);
putc ('\n', fp);
fputs (infostr_ssh_pid, fp);
putc ('\n', fp);
}
fclose (fp);
}
}
if (argc)
{ /* Run the program given on the commandline. */
if (putenv (infostr))
{
log_error ("failed to set environment: %s\n",
strerror (errno) );
kill (pid, SIGTERM );
exit (1);
}
if (opt.ssh_support && putenv (infostr_ssh_sock))
{
log_error ("failed to set environment: %s\n",
strerror (errno) );
kill (pid, SIGTERM );
exit (1);
}
if (opt.ssh_support && putenv (infostr_ssh_pid))
{
log_error ("failed to set environment: %s\n",
strerror (errno) );
kill (pid, SIGTERM );
exit (1);
}
/* Close all the file descriptors except the standard
ones and those open at startup. We explicitly don't
close 0,1,2 in case something went wrong collecting
them at startup. */
close_all_fds (3, startup_fd_list);
/* Run the command. */
execvp (argv[0], argv);
log_error ("failed to run the command: %s\n", strerror (errno));
kill (pid, SIGTERM);
exit (1);
}
else
{
/* Print the environment string, so that the caller can use
shell's eval to set it */
if (csh_style)
{
*strchr (infostr, '=') = ' ';
printf ("setenv %s\n", infostr);
if (opt.ssh_support)
{
*strchr (infostr_ssh_sock, '=') = ' ';
printf ("setenv %s\n", infostr_ssh_sock);
*strchr (infostr_ssh_pid, '=') = ' ';
printf ("setenv %s\n", infostr_ssh_pid);
}
}
else
{
printf ( "%s; export GPG_AGENT_INFO;\n", infostr);
if (opt.ssh_support)
{
printf ("%s; export SSH_AUTH_SOCK;\n", infostr_ssh_sock);
printf ("%s; export SSH_AGENT_PID;\n", infostr_ssh_pid);
}
}
xfree (infostr);
if (opt.ssh_support)
{
xfree (infostr_ssh_sock);
xfree (infostr_ssh_pid);
}
exit (0);
}
/*NOTREACHED*/
} /* End parent */
/*
This is the child
*/
/* Detach from tty and put process into a new session */
if (!nodetach )
{
int i;
unsigned int oldflags;
/* Close stdin, stdout and stderr unless it is the log stream */
for (i=0; i <= 2; i++)
{
if (!log_test_fd (i) && i != fd )
{
if ( ! close (i)
&& open ("/dev/null", i? O_WRONLY : O_RDONLY) == -1)
{
log_error ("failed to open `%s': %s\n",
"/dev/null", strerror (errno));
cleanup ();
exit (1);
}
}
}
if (setsid() == -1)
{
log_error ("setsid() failed: %s\n", strerror(errno) );
cleanup ();
exit (1);
}
log_get_prefix (&oldflags);
log_set_prefix (NULL, oldflags | JNLIB_LOG_RUN_DETACHED);
opt.running_detached = 1;
}
if (chdir("/"))
{
log_error ("chdir to / failed: %s\n", strerror (errno));
exit (1);
}
{
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigemptyset (&sa.sa_mask);
sa.sa_flags = 0;
sigaction (SIGPIPE, &sa, NULL);
}
#endif /*!HAVE_W32_SYSTEM*/
log_info ("%s %s started\n", strusage(11), strusage(13) );
handle_connections (fd, opt.ssh_support ? fd_ssh : GNUPG_INVALID_FD);
assuan_sock_close (fd);
}
return 0;
}
void
agent_exit (int rc)
{
/*FIXME: update_random_seed_file();*/
#if 1
/* at this time a bit annoying */
if (opt.debug & DBG_MEMSTAT_VALUE)
{
gcry_control( GCRYCTL_DUMP_MEMORY_STATS );
gcry_control( GCRYCTL_DUMP_RANDOM_STATS );
}
if (opt.debug)
gcry_control (GCRYCTL_DUMP_SECMEM_STATS );
#endif
gcry_control (GCRYCTL_TERM_SECMEM );
rc = rc? rc : log_get_errorcount(0)? 2 : 0;
exit (rc);
}
static void
agent_init_default_ctrl (ctrl_t ctrl)
{
/* Note we ignore malloc errors because we can't do much about it
and the request will fail anyway shortly after this
initialization. */
if (ctrl->display)
xfree (ctrl->display);
ctrl->display = default_display? xtrystrdup (default_display) : NULL;
if (ctrl->ttyname)
xfree (ctrl->ttyname);
ctrl->ttyname = default_ttyname? xtrystrdup (default_ttyname) : NULL;
if (ctrl->ttytype)
xfree (ctrl->ttytype);
ctrl->ttytype = default_ttytype? xtrystrdup (default_ttytype) : NULL;
if (ctrl->lc_ctype)
xfree (ctrl->lc_ctype);
ctrl->lc_ctype = default_lc_ctype? xtrystrdup (default_lc_ctype) : NULL;
if (ctrl->lc_messages)
xfree (ctrl->lc_messages);
ctrl->lc_messages = default_lc_messages? xtrystrdup (default_lc_messages)
/**/ : NULL;
if (ctrl->xauthority)
xfree (ctrl->xauthority);
ctrl->xauthority = default_xauthority? xtrystrdup (default_xauthority)
/**/: NULL;
if (ctrl->pinentry_user_data)
xfree (ctrl->pinentry_user_data);
ctrl->pinentry_user_data = NULL;
}
static void
agent_deinit_default_ctrl (ctrl_t ctrl)
{
if (ctrl->display)
xfree (ctrl->display);
if (ctrl->ttyname)
xfree (ctrl->ttyname);
if (ctrl->ttytype)
xfree (ctrl->ttytype);
if (ctrl->lc_ctype)
xfree (ctrl->lc_ctype);
if (ctrl->lc_messages)
xfree (ctrl->lc_messages);
if (ctrl->xauthority)
xfree (ctrl->xauthority);
if (ctrl->pinentry_user_data)
xfree (ctrl->pinentry_user_data);
}
/* Reread parts of the configuration. Note, that this function is
obviously not thread-safe and should only be called from the PTH
signal handler.
Fixme: Due to the way the argument parsing works, we create a
memory leak here for all string type arguments. There is currently
no clean way to tell whether the memory for the argument has been
allocated or points into the process' original arguments. Unless
we have a mechanism to tell this, we need to live on with this. */
static void
reread_configuration (void)
{
ARGPARSE_ARGS pargs;
FILE *fp;
unsigned int configlineno = 0;
int dummy;
if (!config_filename)
return; /* No config file. */
fp = fopen (config_filename, "r");
if (!fp)
{
log_error (_("option file `%s': %s\n"),
config_filename, strerror(errno) );
return;
}
parse_rereadable_options (NULL, 1); /* Start from the default values. */
memset (&pargs, 0, sizeof pargs);
dummy = 0;
pargs.argc = &dummy;
pargs.flags = 1; /* do not remove the args */
while (optfile_parse (fp, config_filename, &configlineno, &pargs, opts) )
{
if (pargs.r_opt < -1)
pargs.err = 1; /* Print a warning. */
else /* Try to parse this option - ignore unchangeable ones. */
parse_rereadable_options (&pargs, 1);
}
fclose (fp);
set_debug ();
}
/* Return the file name of the socket we are using for native
requests. */
const char *
get_agent_socket_name (void)
{
const char *s = socket_name;
return (s && *s)? s : NULL;
}
/* Return the file name of the socket we are using for SSH
requests. */
const char *
get_agent_ssh_socket_name (void)
{
const char *s = socket_name_ssh;
return (s && *s)? s : NULL;
}
/* Under W32, this function returns the handle of the scdaemon
notification event. Calling it the first time creates that
event. */
#ifdef HAVE_W32_SYSTEM
void *
get_agent_scd_notify_event (void)
{
static HANDLE the_event;
if (!the_event)
{
HANDLE h, h2;
SECURITY_ATTRIBUTES sa = { sizeof (SECURITY_ATTRIBUTES), NULL, TRUE};
/* We need to use manual reset evet object due to the way our
w32-pth wait function works: If we would use an automatic
reset event we are not able to figure out which handle has
been signaled because at the time we single out the signaled
handles using WFSO the event has already been reset due to
the WFMO. */
h = CreateEvent (&sa, TRUE, FALSE, NULL);
if (!h)
log_error ("can't create scd notify event: %s\n", w32_strerror (-1) );
else if (!DuplicateHandle (GetCurrentProcess(), h,
GetCurrentProcess(), &h2,
EVENT_MODIFY_STATE|SYNCHRONIZE, TRUE, 0))
{
log_error ("setting syncronize for scd notify event failed: %s\n",
w32_strerror (-1) );
CloseHandle (h);
}
else
{
CloseHandle (h);
the_event = h2;
}
}
log_debug ("returning notify handle %p\n", the_event);
return the_event;
}
#endif /*HAVE_W32_SYSTEM*/
/* Create a name for the socket. With USE_STANDARD_SOCKET given as
true using STANDARD_NAME in the home directory or if given as
false from the mkdir type name TEMPLATE. In the latter case a
unique name in a unique new directory will be created. In both
cases check for valid characters as well as against a maximum
allowed length for a unix domain socket is done. The function
terminates the process in case of an error. Returns: Pointer to an
allocated string with the absolute name of the socket used. */
static char *
create_socket_name (char *standard_name, char *template)
{
char *name, *p;
if (use_standard_socket)
name = make_filename (opt.homedir, standard_name, NULL);
else
{
name = xstrdup (template);
p = strrchr (name, '/');
if (!p)
BUG ();
*p = 0;
if (!mkdtemp (name))
{
log_error (_("can't create directory `%s': %s\n"),
name, strerror (errno));
agent_exit (2);
}
*p = '/';
}
if (strchr (name, PATHSEP_C))
{
log_error (("`%s' are not allowed in the socket name\n"), PATHSEP_S);
agent_exit (2);
}
if (strlen (name) + 1 >= DIMof (struct sockaddr_un, sun_path) )
{
log_error (_("name of socket too long\n"));
agent_exit (2);
}
return name;
}
/* Create a Unix domain socket with NAME. Returns the file descriptor
or terminates the process in case of an error. Not that this
function needs to be used for the regular socket first and only
then for the ssh socket. */
static gnupg_fd_t
create_server_socket (char *name, int is_ssh, assuan_sock_nonce_t *nonce)
{
struct sockaddr_un *serv_addr;
socklen_t len;
gnupg_fd_t fd;
int rc;
fd = assuan_sock_new (AF_UNIX, SOCK_STREAM, 0);
if (fd == ASSUAN_INVALID_FD)
{
log_error (_("can't create socket: %s\n"), strerror (errno));
agent_exit (2);
}
serv_addr = xmalloc (sizeof (*serv_addr));
memset (serv_addr, 0, sizeof *serv_addr);
serv_addr->sun_family = AF_UNIX;
if (strlen (name) + 1 >= sizeof (serv_addr->sun_path))
{
log_error (_("socket name `%s' is too long\n"), name);
agent_exit (2);
}
strcpy (serv_addr->sun_path, name);
len = SUN_LEN (serv_addr);
rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len);
if (use_standard_socket && rc == -1 && errno == EADDRINUSE)
{
/* Check whether a gpg-agent is already running on the standard
socket. We do this test only if this is not the ssh socket.
For ssh we assume that a test for gpg-agent has already been
done and reuse the requested ssh socket. Testing the
ssh-socket is not possible because at this point, though we
know the new Assuan socket, the Assuan server and thus the
ssh-agent server is not yet operational. This would lead to
a hang. */
if (!is_ssh && !check_for_running_agent (1, 1))
{
log_error (_("a gpg-agent is already running - "
"not starting a new one\n"));
*name = 0; /* Inhibit removal of the socket by cleanup(). */
assuan_sock_close (fd);
agent_exit (2);
}
remove (name);
rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len);
}
if (rc != -1
&& (rc=assuan_sock_get_nonce ((struct sockaddr*)serv_addr, len, nonce)))
log_error (_("error getting nonce for the socket\n"));
if (rc == -1)
{
/* We use gpg_strerror here because it allows us to get strings
for some W32 socket error codes. */
log_error (_("error binding socket to `%s': %s\n"),
serv_addr->sun_path,
gpg_strerror (gpg_error_from_errno (errno)));
assuan_sock_close (fd);
if (use_standard_socket)
*name = 0; /* Inhibit removal of the socket by cleanup(). */
agent_exit (2);
}
if (listen (FD2INT(fd), 5 ) == -1)
{
log_error (_("listen() failed: %s\n"), strerror (errno));
assuan_sock_close (fd);
agent_exit (2);
}
if (opt.verbose)
log_info (_("listening on socket `%s'\n"), serv_addr->sun_path);
return fd;
}
/* Check that the directory for storing the private keys exists and
create it if not. This function won't fail as it is only a
convenience function and not strictly necessary. */
static void
create_private_keys_directory (const char *home)
{
char *fname;
struct stat statbuf;
fname = make_filename (home, GNUPG_PRIVATE_KEYS_DIR, NULL);
if (stat (fname, &statbuf) && errno == ENOENT)
{
#ifdef HAVE_W32_SYSTEM /*FIXME: Setup proper permissions. */
if (!CreateDirectory (fname, NULL))
log_error (_("can't create directory `%s': %s\n"),
fname, w32_strerror (-1) );
#else
if (mkdir (fname, S_IRUSR|S_IWUSR|S_IXUSR ))
log_error (_("can't create directory `%s': %s\n"),
fname, strerror (errno) );
#endif
else if (!opt.quiet)
log_info (_("directory `%s' created\n"), fname);
}
xfree (fname);
}
/* Create the directory only if the supplied directory name is the
same as the default one. This way we avoid to create arbitrary
directories when a non-default home directory is used. To cope
with HOME, we compare only the suffix if we see that the default
homedir does start with a tilde. We don't stop here in case of
problems because other functions will throw an error anyway.*/
static void
create_directories (void)
{
struct stat statbuf;
const char *defhome = standard_homedir ();
char *home;
home = make_filename (opt.homedir, NULL);
if ( stat (home, &statbuf) )
{
if (errno == ENOENT)
{
if (
#ifdef HAVE_W32_SYSTEM
( !compare_filenames (home, defhome) )
#else
(*defhome == '~'
&& (strlen (home) >= strlen (defhome+1)
&& !strcmp (home + strlen(home)
- strlen (defhome+1), defhome+1)))
|| (*defhome != '~' && !strcmp (home, defhome) )
#endif
)
{
#ifdef HAVE_W32_SYSTEM
if (!CreateDirectory (home, NULL))
log_error (_("can't create directory `%s': %s\n"),
home, w32_strerror (-1) );
#else
if (mkdir (home, S_IRUSR|S_IWUSR|S_IXUSR ))
log_error (_("can't create directory `%s': %s\n"),
home, strerror (errno) );
#endif
else
{
if (!opt.quiet)
log_info (_("directory `%s' created\n"), home);
create_private_keys_directory (home);
}
}
}
else
log_error (_("stat() failed for `%s': %s\n"), home, strerror (errno));
}
else if ( !S_ISDIR(statbuf.st_mode))
{
log_error (_("can't use `%s' as home directory\n"), home);
}
else /* exists and is a directory. */
{
create_private_keys_directory (home);
}
xfree (home);
}
/* This is the worker for the ticker. It is called every few seconds
and may only do fast operations. */
static void
handle_tick (void)
{
static time_t last_minute;
if (!last_minute)
last_minute = time (NULL);
/* Check whether the scdaemon has died and cleanup in this case. */
agent_scd_check_aliveness ();
/* If we are running as a child of another process, check whether
the parent is still alive and shutdown if not. */
#ifndef HAVE_W32_SYSTEM
if (parent_pid != (pid_t)(-1))
{
if (kill (parent_pid, 0))
{
shutdown_pending = 2;
log_info ("parent process died - shutting down\n");
log_info ("%s %s stopped\n", strusage(11), strusage(13) );
cleanup ();
agent_exit (0);
}
}
#endif /*HAVE_W32_SYSTEM*/
/* Code to be run every minute. */
if (last_minute + 60 <= time (NULL))
{
check_own_socket ();
last_minute = time (NULL);
}
}
/* A global function which allows us to call the reload stuff from
other places too. This is only used when build for W32. */
void
agent_sighup_action (void)
{
log_info ("SIGHUP received - "
"re-reading configuration and flushing cache\n");
agent_flush_cache ();
reread_configuration ();
agent_reload_trustlist ();
}
static void
agent_sigusr2_action (void)
{
if (opt.verbose)
log_info ("SIGUSR2 received - updating card event counter\n");
/* Nothing to check right now. We only increment a counter. */
bump_card_eventcounter ();
}
static void
handle_signal (int signo)
{
switch (signo)
{
#ifndef HAVE_W32_SYSTEM
case SIGHUP:
agent_sighup_action ();
break;
case SIGUSR1:
log_info ("SIGUSR1 received - printing internal information:\n");
pth_ctrl (PTH_CTRL_DUMPSTATE, log_get_stream ());
agent_query_dump_state ();
agent_scd_dump_state ();
break;
case SIGUSR2:
agent_sigusr2_action ();
break;
case SIGTERM:
if (!shutdown_pending)
log_info ("SIGTERM received - shutting down ...\n");
else
log_info ("SIGTERM received - still %ld running threads\n",
pth_ctrl( PTH_CTRL_GETTHREADS ));
shutdown_pending++;
if (shutdown_pending > 2)
{
log_info ("shutdown forced\n");
log_info ("%s %s stopped\n", strusage(11), strusage(13) );
cleanup ();
agent_exit (0);
}
break;
case SIGINT:
log_info ("SIGINT received - immediate shutdown\n");
log_info( "%s %s stopped\n", strusage(11), strusage(13));
cleanup ();
agent_exit (0);
break;
#endif
default:
log_info ("signal %d received - no action defined\n", signo);
}
}
/* Check the nonce on a new connection. This is a NOP unless we we
are using our Unix domain socket emulation under Windows. */
static int
check_nonce (ctrl_t ctrl, assuan_sock_nonce_t *nonce)
{
if (assuan_sock_check_nonce (ctrl->thread_startup.fd, nonce))
{
log_info (_("error reading nonce on fd %d: %s\n"),
FD2INT(ctrl->thread_startup.fd), strerror (errno));
assuan_sock_close (ctrl->thread_startup.fd);
xfree (ctrl);
return -1;
}
else
return 0;
}
/* This is the standard connection thread's main function. */
static void *
start_connection_thread (void *arg)
{
ctrl_t ctrl = arg;
if (check_nonce (ctrl, &socket_nonce))
return NULL;
agent_init_default_ctrl (ctrl);
if (opt.verbose)
log_info (_("handler 0x%lx for fd %d started\n"),
pth_thread_id (), FD2INT(ctrl->thread_startup.fd));
start_command_handler (ctrl, GNUPG_INVALID_FD, ctrl->thread_startup.fd);
if (opt.verbose)
log_info (_("handler 0x%lx for fd %d terminated\n"),
pth_thread_id (), FD2INT(ctrl->thread_startup.fd));
agent_deinit_default_ctrl (ctrl);
xfree (ctrl);
return NULL;
}
/* This is the ssh connection thread's main function. */
static void *
start_connection_thread_ssh (void *arg)
{
ctrl_t ctrl = arg;
if (check_nonce (ctrl, &socket_nonce_ssh))
return NULL;
agent_init_default_ctrl (ctrl);
if (opt.verbose)
log_info (_("ssh handler 0x%lx for fd %d started\n"),
pth_thread_id (), FD2INT(ctrl->thread_startup.fd));
start_command_handler_ssh (ctrl, ctrl->thread_startup.fd);
if (opt.verbose)
log_info (_("ssh handler 0x%lx for fd %d terminated\n"),
pth_thread_id (), FD2INT(ctrl->thread_startup.fd));
agent_deinit_default_ctrl (ctrl);
xfree (ctrl);
return NULL;
}
/* Connection handler loop. Wait for connection requests and spawn a
thread after accepting a connection. */
static void
handle_connections (gnupg_fd_t listen_fd, gnupg_fd_t listen_fd_ssh)
{
pth_attr_t tattr;
pth_event_t ev, time_ev;
sigset_t sigs;
int signo;
struct sockaddr_un paddr;
socklen_t plen;
fd_set fdset, read_fdset;
int ret;
gnupg_fd_t fd;
int nfd;
tattr = pth_attr_new();
pth_attr_set (tattr, PTH_ATTR_JOINABLE, 0);
pth_attr_set (tattr, PTH_ATTR_STACK_SIZE, 256*1024);
#ifndef HAVE_W32_SYSTEM /* fixme */
/* Make sure that the signals we are going to handle are not blocked
and create an event object for them. We also set the default
action to ignore because we use an Pth event to get notified
about signals. This avoids that the default action is taken in
case soemthing goes wrong within Pth. The problem might also be
a Pth bug. */
sigemptyset (&sigs );
{
static const int mysigs[] = { SIGHUP, SIGUSR1, SIGUSR2, SIGINT, SIGTERM };
struct sigaction sa;
int i;
for (i=0; i < DIM (mysigs); i++)
{
sigemptyset (&sa.sa_mask);
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
sigaction (mysigs[i], &sa, NULL);
sigaddset (&sigs, mysigs[i]);
}
}
pth_sigmask (SIG_UNBLOCK, &sigs, NULL);
ev = pth_event (PTH_EVENT_SIGS, &sigs, &signo);
#else
# ifdef PTH_EVENT_HANDLE
sigs = 0;
ev = pth_event (PTH_EVENT_HANDLE, get_agent_scd_notify_event ());
signo = 0;
# else
/* Use a dummy event. */
sigs = 0;
ev = pth_event (PTH_EVENT_SIGS, &sigs, &signo);
# endif
#endif
time_ev = NULL;
FD_ZERO (&fdset);
FD_SET (FD2INT (listen_fd), &fdset);
nfd = FD2INT (listen_fd);
if (listen_fd_ssh != GNUPG_INVALID_FD)
{
FD_SET ( FD2INT(listen_fd_ssh), &fdset);
if (FD2INT (listen_fd_ssh) > nfd)
nfd = FD2INT (listen_fd_ssh);
}
for (;;)
{
/* Make sure that our signals are not blocked. */
pth_sigmask (SIG_UNBLOCK, &sigs, NULL);
/* Shutdown test. */
if (shutdown_pending)
{
if (pth_ctrl (PTH_CTRL_GETTHREADS) == 1)
break; /* ready */
/* Do not accept new connections but keep on running the
loop to cope with the timer events. */
FD_ZERO (&fdset);
}
/* Create a timeout event if needed. To help with power saving
we syncronize the ticks to the next full second. */
if (!time_ev)
{
pth_time_t nexttick;
nexttick = pth_timeout (TIMERTICK_INTERVAL, 0);
if (nexttick.tv_usec > 10) /* Use a 10 usec threshhold. */
{
nexttick.tv_sec++;
nexttick.tv_usec = 0;
}
time_ev = pth_event (PTH_EVENT_TIME, nexttick);
}
/* POSIX says that fd_set should be implemented as a structure,
thus a simple assignment is fine to copy the entire set. */
read_fdset = fdset;
if (time_ev)
pth_event_concat (ev, time_ev, NULL);
ret = pth_select_ev (nfd+1, &read_fdset, NULL, NULL, NULL, ev);
if (time_ev)
pth_event_isolate (time_ev);
if (ret == -1)
{
if (pth_event_occurred (ev)
|| (time_ev && pth_event_occurred (time_ev)))
{
if (pth_event_occurred (ev))
{
#if defined(HAVE_W32_SYSTEM) && defined(PTH_EVENT_HANDLE)
agent_sigusr2_action ();
#else
handle_signal (signo);
#endif
}
if (time_ev && pth_event_occurred (time_ev))
{
pth_event_free (time_ev, PTH_FREE_ALL);
time_ev = NULL;
handle_tick ();
}
continue;
}
log_error (_("pth_select failed: %s - waiting 1s\n"),
strerror (errno));
pth_sleep (1);
continue;
}
if (pth_event_occurred (ev))
{
#if defined(HAVE_W32_SYSTEM) && defined(PTH_EVENT_HANDLE)
agent_sigusr2_action ();
#else
handle_signal (signo);
#endif
}
if (time_ev && pth_event_occurred (time_ev))
{
pth_event_free (time_ev, PTH_FREE_ALL);
time_ev = NULL;
handle_tick ();
}
/* We now might create new threads and because we don't want any
signals (as we are handling them here) to be delivered to a
new thread. Thus we need to block those signals. */
pth_sigmask (SIG_BLOCK, &sigs, NULL);
if (!shutdown_pending && FD_ISSET (FD2INT (listen_fd), &read_fdset))
{
ctrl_t ctrl;
plen = sizeof paddr;
fd = INT2FD (pth_accept (FD2INT(listen_fd),
(struct sockaddr *)&paddr, &plen));
if (fd == GNUPG_INVALID_FD)
{
log_error ("accept failed: %s\n", strerror (errno));
}
else if ( !(ctrl = xtrycalloc (1, sizeof *ctrl)) )
{
log_error ("error allocating connection control data: %s\n",
strerror (errno) );
assuan_sock_close (fd);
}
else
{
char threadname[50];
snprintf (threadname, sizeof threadname-1,
"conn fd=%d (gpg)", FD2INT(fd));
threadname[sizeof threadname -1] = 0;
pth_attr_set (tattr, PTH_ATTR_NAME, threadname);
ctrl->thread_startup.fd = fd;
if (!pth_spawn (tattr, start_connection_thread, ctrl))
{
log_error ("error spawning connection handler: %s\n",
strerror (errno) );
assuan_sock_close (fd);
xfree (ctrl);
}
}
fd = GNUPG_INVALID_FD;
}
if (!shutdown_pending && listen_fd_ssh != GNUPG_INVALID_FD
&& FD_ISSET ( FD2INT (listen_fd_ssh), &read_fdset))
{
ctrl_t ctrl;
plen = sizeof paddr;
fd = INT2FD(pth_accept (FD2INT(listen_fd_ssh),
(struct sockaddr *)&paddr, &plen));
if (fd == GNUPG_INVALID_FD)
{
log_error ("accept failed for ssh: %s\n", strerror (errno));
}
else if ( !(ctrl = xtrycalloc (1, sizeof *ctrl)) )
{
log_error ("error allocating connection control data: %s\n",
strerror (errno) );
assuan_sock_close (fd);
}
else
{
char threadname[50];
agent_init_default_ctrl (ctrl);
snprintf (threadname, sizeof threadname-1,
"conn fd=%d (ssh)", FD2INT(fd));
threadname[sizeof threadname -1] = 0;
pth_attr_set (tattr, PTH_ATTR_NAME, threadname);
ctrl->thread_startup.fd = fd;
if (!pth_spawn (tattr, start_connection_thread_ssh, ctrl) )
{
log_error ("error spawning ssh connection handler: %s\n",
strerror (errno) );
assuan_sock_close (fd);
xfree (ctrl);
}
}
fd = GNUPG_INVALID_FD;
}
}
pth_event_free (ev, PTH_FREE_ALL);
if (time_ev)
pth_event_free (time_ev, PTH_FREE_ALL);
cleanup ();
log_info (_("%s %s stopped\n"), strusage(11), strusage(13));
}
/* Helper for check_own_socket. */
static int
check_own_socket_pid_cb (void *opaque, const void *buffer, size_t length)
{
membuf_t *mb = opaque;
put_membuf (mb, buffer, length);
return 0;
}
/* The thread running the actual check. We need to run this in a
separate thread so that check_own_thread can be called from the
timer tick. */
static void *
check_own_socket_thread (void *arg)
{
int rc;
char *sockname = arg;
assuan_context_t ctx;
membuf_t mb;
char *buffer;
check_own_socket_running++;
rc = assuan_socket_connect (&ctx, sockname, (pid_t)(-1));
xfree (sockname);
if (rc)
{
log_error ("can't connect my own socket: %s\n", gpg_strerror (rc));
goto leave;
}
init_membuf (&mb, 100);
rc = assuan_transact (ctx, "GETINFO pid", check_own_socket_pid_cb, &mb,
NULL, NULL, NULL, NULL);
put_membuf (&mb, "", 1);
buffer = get_membuf (&mb, NULL);
if (rc || !buffer)
{
log_error ("sending command \"%s\" to my own socket failed: %s\n",
"GETINFO pid", gpg_strerror (rc));
rc = 1;
}
else if ( (pid_t)strtoul (buffer, NULL, 10) != getpid ())
{
log_error ("socket is now serviced by another server\n");
rc = 1;
}
else if (opt.verbose > 1)
log_error ("socket is still served by this server\n");
xfree (buffer);
assuan_disconnect (ctx);
leave:
if (rc)
{
/* We may not remove the socket as it is now in use by another
server. Setting the name to empty does this. */
if (socket_name)
*socket_name = 0;
if (socket_name_ssh)
*socket_name_ssh = 0;
shutdown_pending = 2;
log_info ("this process is useless - shutting down\n");
}
check_own_socket_running--;
return NULL;
}
/* Check whether we are still listening on our own socket. In case
another gpg-agent process started after us has taken ownership of
our socket, we woul linger around without any real taks. Thus we
better check once in a while whether we are really needed. */
static void
check_own_socket (void)
{
char *sockname;
pth_attr_t tattr;
if (!use_standard_socket)
return; /* This check makes only sense in standard socket mode. */
if (check_own_socket_running || shutdown_pending)
return; /* Still running or already shutting down. */
sockname = make_filename (opt.homedir, "S.gpg-agent", NULL);
if (!sockname)
return; /* Out of memory. */
tattr = pth_attr_new();
pth_attr_set (tattr, PTH_ATTR_JOINABLE, 0);
pth_attr_set (tattr, PTH_ATTR_STACK_SIZE, 256*1024);
pth_attr_set (tattr, PTH_ATTR_NAME, "check-own-socket");
if (!pth_spawn (tattr, check_own_socket_thread, sockname))
log_error ("error spawning check_own_socket_thread: %s\n",
strerror (errno) );
pth_attr_destroy (tattr);
}
/* Figure out whether an agent is available and running. Prints an
error if not. If SILENT is true, no messages are printed. Usually
started with MODE 0. Returns 0 if the agent is running. */
static int
check_for_running_agent (int silent, int mode)
{
int rc;
char *infostr, *p;
assuan_context_t ctx;
int prot, pid;
if (!mode)
{
infostr = getenv ("GPG_AGENT_INFO");
if (!infostr || !*infostr)
{
if (!check_for_running_agent (silent, 1))
return 0; /* Okay, its running on the standard socket. */
if (!silent)
log_error (_("no gpg-agent running in this session\n"));
return -1;
}
infostr = xstrdup (infostr);
if ( !(p = strchr (infostr, PATHSEP_C)) || p == infostr)
{
xfree (infostr);
if (!check_for_running_agent (silent, 1))
return 0; /* Okay, its running on the standard socket. */
if (!silent)
log_error (_("malformed GPG_AGENT_INFO environment variable\n"));
return -1;
}
*p++ = 0;
pid = atoi (p);
while (*p && *p != PATHSEP_C)
p++;
prot = *p? atoi (p+1) : 0;
if (prot != 1)
{
xfree (infostr);
if (!silent)
log_error (_("gpg-agent protocol version %d is not supported\n"),
prot);
if (!check_for_running_agent (silent, 1))
return 0; /* Okay, its running on the standard socket. */
return -1;
}
}
else /* MODE != 0 */
{
infostr = make_filename (opt.homedir, "S.gpg-agent", NULL);
pid = (pid_t)(-1);
}
rc = assuan_socket_connect (&ctx, infostr, pid);
xfree (infostr);
if (rc)
{
if (!mode && !check_for_running_agent (silent, 1))
return 0; /* Okay, its running on the standard socket. */
if (!mode && !silent)
log_error ("can't connect to the agent: %s\n", gpg_strerror (rc));
return -1;
}
if (!opt.quiet && !silent)
log_info ("gpg-agent running and available\n");
assuan_disconnect (ctx);
return 0;
}
diff --git a/doc/ChangeLog b/doc/ChangeLog
index a876b6bb0..a03b11116 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,721 +1,727 @@
+2009-06-02 Werner Koch <wk@g10code.com>
+
+ * tools.texi (watchgnupg): Typo fix. Fixes bug#1065.
+
+ * gpg-agent.texi (Agent Commands): Update description of --daemon.
+
2009-05-20 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration Options): Explain new meaning of
--enable-dsa2.
2009-03-16 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (GPG Configuration Options): Document keyserver-options
debug.
2009-03-04 Werner Koch <wk@g10code.com>
* help.txt (gpg.keygen.size): Add a link to web page.
2009-03-03 Werner Koch <wk@g10code.com>
* gpg.texi (Operational GPG Commands): "merge-only" is an
import-option. Reported by Joseph Oreste Bruni.
2009-03-02 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Invoking GPG-AGENT): Modernized instructions.
(Agent Options): Fix spelling of option --lc-ctype.
2009-01-12 Werner Koch <wk@g10code.com>
* faq.raw: Fix bug reorting address.
2008-12-12 Werner Koch <wk@g10code.com>
* gpgsm.texi (General GPGSM Commands): Fix --help, --version and
--warranty wording.
2008-12-08 Werner Koch <wk@g10code.com>
* DETAILS: Clarify the use of "trust" and "validity" as suggested
by Daniel Kahn Gillmor. Fix some typos. Remove the outdated
sections on packet headers and pipemode. Point to the libgcrypt
manual for a description of the key generation.
2008-11-12 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Agent Options): Use Posix $() instead of
backticks to avoid rendering problems.
2008-10-13 Werner Koch <wk@g10code.com>
* gpgsm.texi (Certificate Management): Explain hot to delete the
secret key.
2008-10-01 Werner Koch <wk@g10code.com>
* tools.texi (Controlling gpg-connect-agent): Describe /datafile.
2008-09-23 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (OpenPGP Key Management): Clarify setpref a bit.
2008-08-30 Werner Koch <wk@g10code.com>
* yat2m.c (write_th): Print a note that this is generated source.
(VERSION): Bump up to 1.0.
2008-07-30 Werner Koch <wk@g10code.com>
* gpgsm.texi (GPGSM Configuration): Mention com-cert.pem.
2008-06-25 Werner Koch <wk@g10code.com>
* qualified.txt: Add new BnetzA certs 12R and 13R.
* com-certs.pem: Ditto.
* examples/trustlist.txt: Ditto.
2008-06-19 Werner Koch <wk@g10code.com>
* tools.texi (Listing options): Describe new complect gpgconf type
"alias list".
2008-06-16 Werner Koch <wk@g10code.com>
* DETAILS (group): Document %ask-passphrase.
2008-05-26 Werner Koch <wk@g10code.com>
* gpgv.texi: Minor fixes. Fixes bug#918.
* opt-homedir.texi: Typo fixes. Fixes bug#917.
2008-05-26 Marcus Brinkmann <marcus@g10code.de>
* tools.texi (Invoking gpgconf): Document --list-dirs.
2008-05-20 Marcus Brinkmann <marcus@g10code.de>
* tools.texi (Invoking gpgconf): Add --dry-run and --check-options.
(Checking programs): Document --check-options.
2008-05-15 Marcus Brinkmann <marcus@g10code.de>
* gpg.texi (Operational GPG Commands): Mention the way to change
the default signing key.
2008-05-06 Werner Koch <wk@g10code.com>
* Makefile.am (myman_pages): Add gpg-zip.1.
* tools.texi (gpg-zip): Add new section.
2008-04-08 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration Options): Change subkeys.pgp.net to
keys.gnupg.net. Describe --auto-key-locate mechanisms local and
nodefault.
2008-04-03 Werner Koch <wk@g10code.com>
* yat2m.c (proc_texi_cmd): Remove extra apostrophe from @samp and
use open and close quote to @file and @env.
2008-04-02 Werner Koch <wk@g10code.com>
* opt-homedir.texi: Remove special case for Registry key.
* yat2m.c (proc_texi_cmd): Use the \(aq glyph for @samp. This is
bug#898.
(proc_texi_buffer): Handle backslashs correctly.
2008-03-27 Werner Koch <wk@g10code.com>
* Makefile.am (nobase_dist_doc_DATA, dist_html_DATA): New. Move
relevant files to here.
(install-html-local): Remove.
2008-02-27 Marcus Brinkmann <marcus@g10code.de>
* tools.texi (Listing options): Document new types.
2008-02-26 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration Options): Mention rfc4398.
2008-02-05 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (GPG Esoteric Options): Tweak mention of Tempest font
to add a "claimed" in there.
2008-01-29 Justin Pryzby <jpryzby+d@quoininc.com> (wk)
* gpg-agent.texi (Agent Options): Grammar fixes
* qualified.txt: Spelling fixes.
2008-01-28 Justin Pryzby <jpryzby+d@quoininc.com> (wk)
* gpg-agent.texi, yat2m.c, scdaemon.texi, qualified.txt
* tools.texi, gpgsm.texi: Typo fixes and minor grammer fixes.
2008-01-10 Werner Koch <wk@g10code.com>
* qualified.txt: Add missing country tag to the last entries.
Reported by Marcus Brinkmann.
2008-01-10 Marcus Brinkmann <marcus@g10code.de>
* tools.texi (gpgconf): Some clarifications.
2008-01-02 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Esoteric Options): Mention --log-file.
2007-12-13 Werner Koch <wk@g10code.com>
* qualified.txt: Add 2 root certs from S-Trust for 2008-2012.
* examples/trustlist.txt: Ditto.
* com-certs.pem: Ditto.
* gpgsm.texi (Esoteric Options): Document --extra-digest-algo.
2007-12-12 Werner Koch <wk@g10code.com>
* gpg.texi: Typo fixes. From Christer Andersson.
2007-12-04 Werner Koch <wk@g10code.com>
* help.txt: New online help file.
* help.be.txt, help.ca.txt, help.cs.txt, help.da.txt, help.de.txt
* help.el.txt, help.eo.txt, help.es.txt, help.et.txt, help.fi.txt
* help.fr.txt, help.gl.txt, help.hu.txt, help.id.txt, help.it.txt
* help.ja.txt, help.nb.txt, help.pl.txt, help.pt.txt
* help.pt_BR.txt, help.ro.txt, help.ru.txt, help.sk.txt
* help.sv.txt, help.tr.txt, help.zh_CN.txt, help.zh_TW.txt: New
online file, generated from teh current po files.
* Makefile.am (dist_pkgdata_DATA): Add them.
2007-11-19 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration Options): English Grammar fix.
Thanks to Gerg Troxel.
* gpgsm.texi (Certificate Options): Document
--auto-issuer-key-retrieve.
2007-11-15 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration): Add PINENTRY_USER_DATA.
* gpg-agent.texi (Agent Options): Add xauthority.
2007-10-31 Marcus Brinkmann <marcus@g10code.de>
* gpg-agent.texi (Agent Options): Fix typos, by Bernhard Reiter.
2007-10-27 David Shaw <dshaw@jabberwocky.com>
* gpg.texi: Document --rfc4880 (the new --openpgp).
2007-10-25 David Shaw <dshaw@jabberwocky.com>
* gpg.texi: Clarify --force-v3-sigs, --pgp2, and --pgp6 a bit.
2007-10-23 Werner Koch <wk@g10code.com>
* tools.texi (Listing global options): New.
2007-10-19 Werner Koch <wk@g10code.com>
* tools.texi (Controlling gpg-connect-agent): Updated.
2007-08-29 Werner Koch <wk@g10code.com>
* tools.texi (Checking programs): New.
2007-08-27 Werner Koch <wk@g10code.com>
* examples/pwpattern.list: New.
2007-08-24 Werner Koch <wk@g10code.com>
* debugging.texi (Common Problems): Add "A root certifciate does
not validate."
2007-08-14 Werner Koch <wk@g10code.com>
* glossary.texi (Glossary): Add a more items.
2007-08-13 Werner Koch <wk@g10code.com>
* yat2m.c (proc_texi_cmd): Do not put @samp content between two
newlines.
* gpg-agent.texi (Agent Configuration): Explain the CM flag for
trustlist.txt.
2007-08-09 Werner Koch <wk@g10code.com>
* gpgsm.texi (Certificate Options): Describe --validation-model.
2007-07-23 Werner Koch <wk@g10code.com>
* scdaemon.texi (Scdaemon Commands): Remove obsolete --print-atr.
2007-07-17 Werner Koch <wk@g10code.com>
* gpgsm.texi (Input and Output): Document --default-key.
2007-07-04 Werner Koch <wk@g10code.com>
* gpl.texi: Updated to GPLv3.
2007-06-22 Werner Koch <wk@g10code.com>
* gpg.texi (Operational GPG Commands): Describe the flags used by
--check-sigs.
2007-06-21 Werner Koch <wk@g10code.com>
* gpgsm.texi (Certificate Management): Changed description of
--gen-key.
2007-06-19 Werner Koch <wk@g10code.com>
* glossary.texi (Glossary): Describe PSE.
2007-06-18 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Agent GETINFO): New.
2007-06-06 Werner Koch <wk@g10code.com>
* Makefile.am (yat2m): Use a plain rule to build it for the sake
of cross-compiling.
* yat2m.c (finish_page): Init SECT to NULL.
2007-05-11 Werner Koch <wk@g10code.com>
* gpgsm.texi (--export): Enhanced description.
2007-05-09 Werner Koch <wk@g10code.com>
* examples/gpgconf.conf: Remove active example line.
* Makefile.am (online): Distinguish between released and svn manuals.
2007-05-08 Werner Koch <wk@g10code.com>
* howtos.texi: New.
* howto-create-a-server-cert.texi: New.
* Makefile.am (gnupg_TEXINFOS): Add new files.
* gnupg.texi: Moved the logo for HTML more to the top.
* Makefile.am (install-html-local): New.
(DVIPS): Redefine to include srcdir.
2007-05-04 Werner Koch <wk@g10code.com>
* gnupg.texi (Top): Fix typo and a grammar issue.
* Makefile.am (EXTRA_DIST): Add gnupg-logo.png. Suggested by
Bernard Leak.
2007-04-15 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (OpenPGP Options): Update the personal-foo-preferences
documentation a bit.
2007-04-10 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration Options): Document --batch, no-tty,
--yes and --no.
2007-03-08 Werner Koch <wk@g10code.com>
* gnupg-logo.png, gnupg-logo.eps, gnupg-logo.pdf: New.
* gnupg-badge-openpgp.eps, gnupg-badge-openpgp.eps
* gnupg-badge-openpgp.jpg: Removed.
* gnupg.texi: Use new logo.
2007-03-07 Werner Koch <wk@g10code.com>
* tools.texi (applygnupgdefaults): New.
2007-03-06 Werner Koch <wk@g10code.com>
* examples/gpgconf.conf: New.
2007-03-04 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (GPG Esoteric Options): Document
--allow-multiple-messages.
2007-02-26 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Configuration): Document envvar LANGUAGE.
(GPG Configuration Options): Document show-primary-uid-only.
2007-02-18 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Esoteric Options): No card reader options for gpg2.
2007-02-14 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Agent Options): Doc --pinentry-touch-file.
2007-02-05 Werner Koch <wk@g10code.com>
* debugging.texi (Common Problems): Tell how to export a private
key without a certificate.
2007-01-30 Werner Koch <wk@g10code.com>
* com-certs.pem: Added the current root certifcates of D-Trust and
S-Trust.
2007-01-18 David Shaw <dshaw@jabberwocky.com>
* gpg.texi, specify-user-id.texi: Only some of the mentions of
exclamation marks have an example. Give examples to the rest.
2007-01-17 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (GPG Configuration Options): Make http_proxy option
documentation match reality.
(BUGS): Warn about hibernate/safe-sleep/etc writing main RAM to
disk, despite locking.
2006-12-08 Werner Koch <wk@g10code.com>
* gnupg.texi (direntry): Rename gpg to gpg2.
2006-12-04 Werner Koch <wk@g10code.com>
* gpgv.texi: New.
* tools.texi: Include new file.
2006-12-02 David Shaw <dshaw@jabberwocky.com>
* gpg.texi (GPG Esoteric Options): Document --passphrase-repeat.
2006-11-14 Werner Koch <wk@g10code.com>
* gpgsm.texi (GPGSM EXPORT): Document changes.
2006-11-11 Werner Koch <wk@g10code.com>
* gnupg.texi (Top): Move gpg-agent part before gpg.
2006-11-05 David Shaw <dshaw@jabberwocky.com>
* gpg.texi: Reference to --s2k-count in --s2k-mode.
2006-10-30 Werner Koch <wk@g10code.com>
* faq.raw: Minor corrections.
2006-10-12 Werner Koch <wk@g10code.com>
* Makefile.am (man_MANS): Do not install gnupg.7 due to a conflict
with gpg1.
2006-10-12 David Shaw <dshaw@jabberwocky.com>
* gpg.texi: Document --s2k-count.
2006-09-25 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Examples): Add markup to all options. This is
required to have the double dashs printed correclty.
2006-09-22 Werner Koch <wk@g10code.com>
* instguide.texi (Installation): New.
* assuan.texi (Assuan): Removed. Use the libassuan manual instead.
* gnupg.texi: Reflect these changes.
* gpg.texi: Make some parts depend on the "gpgone" set
command. This allows us to use the same source for gpg1 and gpg2.
* yat2m.c (parse_file): Better parsing of @ifset and ifclear.
(main): Allow definition of "-D gpgone".
(parse_file): Allow macro definitions.
(proc_texi_cmd): Expand macros.
(proc_texi_buffer): Process commands terminated by the closing
brace of the enclosing command.
2006-09-20 Werner Koch <wk@g10code.com>
* texi.css: New. Note that the current vesion of makeinfo has a
bug while copying the @import directive. A pacth has been send to
upstream.
2006-09-19 Werner Koch <wk@g10code.com>
* gpg.texi: Some restructuring.
* Makefile.am (online): New target.
2006-09-18 Werner Koch <wk@g10code.com>
* com-certs.pem: New.
2006-09-13 Werner Koch <wk@g10code.com>
* gpg.texi (GPG Esoteric Options): Fixed typo in
--require-cross-certification and made it the default.
2006-09-11 Werner Koch <wk@g10code.com>
* HACKING: Cleaned up.
2006-09-08 Werner Koch <wk@g10code.com>
* yat2m.c (parse_file): Ignore @node lines immediately.
(proc_texi_cmd): No special @end ifset processing anymore.
* specify-user-id.texi: New. Factored out of gpg.texi and ../README.
2006-09-07 Werner Koch <wk@g10code.com>
* scdaemon.texi (Scdaemon Configuration): New.
* examples/scd-event: Event handler for sdaemon.
* examples/: New directory
2006-08-22 Werner Koch <wk@g10code.com>
* yat2m.c (parse_file): Added code to skip a line after @mansect.
* gnupg7.texi: New.
2006-08-21 Werner Koch <wk@g10code.com>
* Makefile.am: Added other doc files from gpg 1.4.
2006-08-17 Werner Koch <wk@g10code.com>
* Makefile.am: Added rules to build man pages.
* yat2m.c: New.
2006-02-14 Werner Koch <wk@gnupg.org>
* gpgsm.texi (GPGSM Configuration): New section.
2005-11-14 Werner Koch <wk@g10code.com>
* qualified.txt: Added real information.
2005-11-13 Werner Koch <wk@g10code.com>
* qualified.txt: New.
* Makefile.am (dist_pkgdata_DATA): New.
2005-08-16 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Agent Options): Note default file name for
--write-env-file.
2005-06-03 Werner Koch <wk@g10code.com>
* debugging.texi (Architecture Details): New section, mostly empty.
* gnupg-card-architecture.fig: New.
* Makefile.am: Rules to build png and eps versions.
* gpg-agent.texi (Agent UPDATESTARTUPTTY): New.
2005-05-17 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Agent Options): Removed --disable-pth.
2005-04-27 Werner Koch <wk@g10code.com>
* tools.texi (symcryptrun): Added.
* scdaemon.texi: Removed OpenSC specific options.
2005-04-20 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Agent Configuration): New section.
2005-02-24 Werner Koch <wk@g10code.com>
* tools.texi (gpg-connect-agent): New.
2005-02-14 Werner Koch <wk@g10code.com>
* gpgsm.texi (Certificate Management): Document --import.
2005-01-27 Moritz Schulte <moritz@g10code.com>
* gpg-agent.texi: Document ssh-agent emulation layer.
2005-01-04 Werner Koch <wk@g10code.com>
* gnupg.texi: Updated to use @copying.
2004-12-22 Werner Koch <wk@g10code.com>
* gnupg.texi: Reordered.
* contrib.texi: Updated.
2004-12-21 Werner Koch <wk@g10code.com>
* tools.texi (gpg-preset-passphrase): New section.
* gnupg-badge-openpgp.eps, gnupg-badge-openpgp.jpg: New
* gnupg.texi: Add a logo.
* sysnotes.texi: New.
2004-11-05 Werner Koch <wk@g10code.com>
* debugging.texi (Common Problems): Curses pinentry problem.
2004-10-22 Werner Koch <wk@g10code.com>
* tools.texi (Helper Tools): Document gpgsm-gencert.sh.
2004-10-05 Werner Koch <wk@g10code.com>
* gpg-agent.texi (Invoking GPG-AGENT): Tell that GPG_TTY needs to
be set in all cases.
2004-09-30 Werner Koch <wk@g10code.com>
* gpg.texi: New.
* gnupg.texi: Include gpg.texi
* tools.texi: Add a few @command markups.
* gpgsm.texi: Ditto
* gpg-agent.texi: Ditto.
* scdaemon.texi: Ditto.
2004-09-30 Marcus Brinkmann <marcus@g10code.de>
* tools.texi (Changing options): Add documentation for gpgconf.
* contrib.texi (Contributors): Add two missing periods.
2004-09-29 Werner Koch <wk@g10code.com>
* gpgsm.texi (Configuration Options): Add --log-file.
* gpg-agent.texi (Invoking GPG-AGENT): Add a few words about the
expected pinentry filename.
Changed license of the manual stuff to GPL.
* gnupg.texi (Top): New menu item Helper Tools.
* tools.texi (Helper Tools): New.
* Makefile.am (gnupg_TEXINFOS): Add tools.texi.
2004-08-05 Werner Koch <wk@g10code.de>
* scdaemon.texi (Card applications): New section.
2004-06-22 Werner Koch <wk@g10code.com>
* glossary.texi: New.
2004-06-18 Werner Koch <wk@gnupg.org>
* debugging.texi: New.
* gnupg.texi: Include it.
2004-05-11 Werner Koch <wk@gnupg.org>
* gpgsm.texi (Esoteric Options): Add --debug-allow-core-dump.
2004-05-03 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Agent Options): Add --allow-mark-trusted.
2004-02-03 Werner Koch <wk@gnupg.org>
* contrib.texi (Contributors): Updated from the gpg 1.2.3 thanks
list.
* gpgsm.texi, gpg-agent.texi, scdaemon.texi: Language cleanups.
2003-12-01 Werner Koch <wk@gnupg.org>
* gpgsm.texi (Certificate Options): Add --{enable,disable}-ocsp.
2003-11-17 Werner Koch <wk@gnupg.org>
* scdaemon.texi (Scdaemon Options): Added --allow-admin and
--deny-admin.
2003-10-27 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Agent GET_CONFIRMATION): New.
2002-12-04 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Agent Signals): New.
2002-12-03 Werner Koch <wk@gnupg.org>
* gpgsm.texi (Operational Commands): Add --passwd and
--call-protect-tool.
* gpg-agent.texi (Agent PASSWD): New
2002-11-13 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Invoking GPG-AGENT): Tell about GPG_TTY.
2002-11-12 Werner Koch <wk@gnupg.org>
* gpgsm.texi (Operational Commands): Add --call-dirmngr.
2002-09-25 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Agent Options): Add --keep-tty and --keep-display.
2002-09-12 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Invoking GPG-AGENT): Explained how to start only
one instance.
2002-08-28 Werner Koch <wk@gnupg.org>
* gpg-agent.texi (Agent Options): Explained more options.
* scdaemon.texi (Scdaemon Options): Ditto.
2002-08-09 Werner Koch <wk@gnupg.org>
* Makefile.am (gnupg_TEXINFOS): Include contrib.texi.
2002-08-06 Werner Koch <wk@gnupg.org>
* gpgsm.texi: Added more options.
2002-07-26 Werner Koch <wk@gnupg.org>
* assuan.texi: New.
* gpgsm.texi, scdaemon.texi, gpg-agent.texi: Documented the Assuan
protocol used.
2002-07-22 Werner Koch <wk@gnupg.org>
* gnupg.texi, scdaemon.texi, gpg-agent.texi: New.
* contrib.texi, gpl.texi, fdl.texi: New.
* gpgsm.texi: Made this an include file for gnupg.texi.
* Makefile.am: Build gnupg.info instead of gpgsm.info.
2002-06-04 Werner Koch <wk@gnupg.org>
* gpgsm.texi (Invocation): Described the various debug flags.
2002-05-14 Werner Koch <wk@gnupg.org>
* Makefile.am, gpgsm.texi: New.
Copyright 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
modifications, as long as this notice is preserved.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi
index 16dd52197..27946c025 100644
--- a/doc/gpg-agent.texi
+++ b/doc/gpg-agent.texi
@@ -1,1230 +1,1232 @@
@c Copyright (C) 2002 Free Software Foundation, Inc.
@c This is part of the GnuPG manual.
@c For copying conditions, see the file gnupg.texi.
@node Invoking GPG-AGENT
@chapter Invoking GPG-AGENT
@cindex GPG-AGENT command options
@cindex command options
@cindex options, GPG-AGENT command
@manpage gpg-agent.1
@ifset manverb
.B gpg-agent
\- Secret key management for GnuPG
@end ifset
@mansect synopsis
@ifset manverb
.B gpg-agent
.RB [ \-\-homedir
.IR dir ]
.RB [ \-\-options
.IR file ]
.RI [ options ]
.br
.B gpg-agent
.RB [ \-\-homedir
.IR dir ]
.RB [ \-\-options
.IR file ]
.RI [ options ]
.B \-\-server
.br
.B gpg-agent
.RB [ \-\-homedir
.IR dir ]
.RB [ \-\-options
.IR file ]
.RI [ options ]
.B \-\-daemon
.RI [ command_line ]
@end ifset
@mansect description
@command{gpg-agent} is a daemon to manage secret (private) keys
independently from any protocol. It is used as a backend for
@command{gpg} and @command{gpgsm} as well as for a couple of other
utilities.
@noindent
The usual way to run the agent is from the @code{~/.xsession} file:
@example
eval $(gpg-agent --daemon)
@end example
@noindent
If you don't use an X server, you can also put this into your regular
startup file @code{~/.profile} or @code{.bash_profile}. It is best not
to run multiple instance of the @command{gpg-agent}, so you should make
sure that only one is running: @command{gpg-agent} uses an environment
variable to inform clients about the communication parameters. You can
write the content of this environment variable to a file so that you can
test for a running agent. Here is an example using Bourne shell synax:
@smallexample
gpg-agent --daemon --enable-ssh-support \
--write-env-file "$@{HOME@}/.gpg-agent-info"
@end smallexample
This code should only be run once per user session to initially fire up
the agent. In the example the optional support for the included Secure
Shell agent is enabled and the information about the agent is written to
a file in the HOME directory. Note that by running gpg-agent without
arguments you may test whether an agent is already running; however such
a test may lead to a race condition, thus it is not suggested.
@noindent
The second script needs to be run for each interactive session:
@smallexample
if [ -f "$@{HOME@}/.gpg-agent-info" ]; then
. "$@{HOME@}/.gpg-agent-info"
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
fi
@end smallexample
@noindent
It reads the data out of the file and exports the variables. If you
don't use Secure Shell, you don't need the last two export statements.
@noindent
You should always add the following lines to your @code{.bashrc} or
whatever initialization file is used for all shell invocations:
@smallexample
GPG_TTY=$(tty)
export GPG_TTY
@end smallexample
@noindent
It is important that this environment variable always reflects the
output of the @code{tty} command. For W32 systems this option is not
required.
Please make sure that a proper pinentry program has been installed
under the default filename (which is system dependant) or use the
option @option{pinentry-program} to specify the full name of that program.
It is often useful to install a symbolic link from the actual used
pinentry (e.g. @file{/usr/bin/pinentry-gtk}) to the expected
one (e.g. @file{/usr/bin/pinentry}).
@manpause
@noindent
@xref{Option Index},for an index to @command{GPG-AGENT}'s commands and options.
@mancont
@menu
* Agent Commands:: List of all commands.
* Agent Options:: List of all options.
* Agent Configuration:: Configuration files.
* Agent Signals:: Use of some signals.
* Agent Examples:: Some usage examples.
* Agent Protocol:: The protocol the agent uses.
@end menu
@mansect commands
@node Agent Commands
@section Commands
Commands are not distinguished from options except for the fact that
only one command is allowed.
@table @gnupgtabopt
@item --version
@opindex version
Print the program version and licensing information. Not that you can
abbreviate this command.
@item --help
@itemx -h
@opindex help
Print a usage message summarizing the most useful command-line options.
Not that you can abbreviate this command.
@item --dump-options
@opindex dump-options
Print a list of all available options and commands. Not that you can
abbreviate this command.
@item --server
@opindex server
Run in server mode and wait for commands on the @code{stdin}. The
default mode is to create a socket and listen for commands there.
@item --daemon [@var{command line}]
@opindex daemon
-Run the program in the background. This option is required to prevent
-it from being accidently running in the background. A common way to do
-this is:
-@example
-@end example
-$ eval $(gpg-agent --daemon)
+Start the gpg-agent as a daemon; that is, detach it from the console
+and run it in the background. Because @command{gpg-agent} prints out
+important information required for further use, a common way of
+invoking gpg-agent is: @code{eval $(gpg-agent --daemon)} to setup the
+environment variables. The option @option{--write-env-file} is
+another way commonly used to do this. Yet another way is creating
+a new process as a child of gpg-agent: @code{gpg-agent --daemon
+/bin/sh}. This way you get a new shell with the environment setup
+properly; if you exit from this shell, gpg-agent terminates as well.
@end table
-
@mansect options
@node Agent Options
@section Option Summary
@table @gnupgtabopt
@anchor{option --options}
@item --options @var{file}
@opindex options
Reads configuration from @var{file} instead of from the default
per-user configuration file. The default configuration file is named
@file{gpg-agent.conf} and expected in the @file{.gnupg} directory directly
below the home directory of the user.
@anchor{option --homedir}
@include opt-homedir.texi
@item -v
@item --verbose
@opindex v
@opindex verbose
Outputs additional information while running.
You can increase the verbosity by giving several
verbose commands to @command{gpgsm}, such as @samp{-vv}.
@item -q
@item --quiet
@opindex q
@opindex quiet
Try to be as quiet as possible.
@item --batch
@opindex batch
Don't invoke a pinentry or do any other thing requiring human interaction.
@item --faked-system-time @var{epoch}
@opindex faked-system-time
This option is only useful for testing; it sets the system time back or
forth to @var{epoch} which is the number of seconds elapsed since the year
1970.
@item --debug-level @var{level}
@opindex debug-level
Select the debug level for investigating problems. @var{level} may be
one of:
@table @code
@item none
no debugging at all.
@item basic
some basic debug messages
@item advanced
more verbose debug messages
@item expert
even more detailed messages
@item guru
all of the debug messages you can get
@end table
How these messages are mapped to the actual debugging flags is not
specified and may change with newer releases of this program. They are
however carefully selected to best aid in debugging.
@item --debug @var{flags}
@opindex debug
This option is only useful for debugging and the behaviour may change at
any time without notice. FLAGS are bit encoded and may be given in
usual C-Syntax. The currently defined bits are:
@table @code
@item 0 (1)
X.509 or OpenPGP protocol related data
@item 1 (2)
values of big number integers
@item 2 (4)
low level crypto operations
@item 5 (32)
memory allocation
@item 6 (64)
caching
@item 7 (128)
show memory statistics.
@item 9 (512)
write hashed data to files named @code{dbgmd-000*}
@item 10 (1024)
trace Assuan protocol
@item 12 (4096)
bypass all certificate validation
@end table
@item --debug-all
@opindex debug-all
Same as @code{--debug=0xffffffff}
@item --debug-wait @var{n}
@opindex debug-wait
When running in server mode, wait @var{n} seconds before entering the
actual processing loop and print the pid. This gives time to attach a
debugger.
@item --no-detach
@opindex no-detach
Don't detach the process from the console. This is mainly useful for
debugging.
@item -s
@itemx --sh
@itemx -c
@itemx --csh
@opindex s
@opindex sh
@opindex c
@opindex csh
Format the info output in daemon mode for use with the standard Bourne
shell or the C-shell respectively. The default is to guess it based on
the environment variable @code{SHELL} which is correct in almost all
cases.
@item --write-env-file @var{file}
@opindex write-env-file
Often it is required to connect to the agent from a process not being an
inferior of @command{gpg-agent} and thus the environment variable with
the socket name is not available. To help setting up those variables in
other sessions, this option may be used to write the information into
@var{file}. If @var{file} is not specified the default name
@file{$@{HOME@}/.gpg-agent-info} will be used. The format is suitable
to be evaluated by a Bourne shell like in this simple example:
@example
eval $(cat @var{file})
eval $(cut -d= -f 1 < @var{file} | xargs echo export)
@end example
@item --no-grab
@opindex no-grab
Tell the pinentry not to grab the keyboard and mouse. This option
should in general not be used to avoid X-sniffing attacks.
@item --log-file @var{file}
@opindex log-file
Append all logging output to @var{file}. This is very helpful in
seeing what the agent actually does.
@anchor{option --allow-mark-trusted}
@item --allow-mark-trusted
@opindex allow-mark-trusted
Allow clients to mark keys as trusted, i.e. put them into the
@file{trustlist.txt} file. This is by default not allowed to make it
harder for users to inadvertently accept Root-CA keys.
@item --ignore-cache-for-signing
@opindex ignore-cache-for-signing
This option will let @command{gpg-agent} bypass the passphrase cache for all
signing operation. Note that there is also a per-session option to
control this behaviour but this command line option takes precedence.
@item --default-cache-ttl @var{n}
@opindex default-cache-ttl
Set the time a cache entry is valid to @var{n} seconds. The default is
600 seconds.
@item --default-cache-ttl-ssh @var{n}
@opindex default-cache-ttl
Set the time a cache entry used for SSH keys is valid to @var{n}
seconds. The default is 1800 seconds.
@item --max-cache-ttl @var{n}
@opindex max-cache-ttl
Set the maximum time a cache entry is valid to @var{n} seconds. After
this time a cache entry will be expired even if it has been accessed
recently. The default is 2 hours (7200 seconds).
@item --max-cache-ttl-ssh @var{n}
@opindex max-cache-ttl-ssh
Set the maximum time a cache entry used for SSH keys is valid to @var{n}
seconds. After this time a cache entry will be expired even if it has
been accessed recently. The default is 2 hours (7200 seconds).
@item --enforce-passphrase-constraints
@opindex enforce-passphrase-constraints
Enforce the passphrase constraints by not allowing the user to bypass
them using the ``Take it anyway'' button.
@item --min-passphrase-len @var{n}
@opindex min-passphrase-len
Set the minimal length of a passphrase. When entering a new passphrase
shorter than this value a warning will be displayed. Defaults to 8.
@item --min-passphrase-nonalpha @var{n}
@opindex min-passphrase-nonalpha
Set the minimal number of digits or special characters required in a
passphrase. When entering a new passphrase with less than this number
of digits or special characters a warning will be displayed. Defaults
to 1.
@item --check-passphrase-pattern @var{file}
@opindex check-passphrase-pattern
Check the passphrase against the pattern given in @var{file}. When
entering a new passphrase matching one of these pattern a warning will
be displayed. @var{file} should be an absolute filename. The default is
not to use any pattern file.
Security note: It is known that checking a passphrase against a list of
pattern or even against a complete dictionary is not very effective to
enforce good passphrases. Users will soon figure up ways to bypass such
a policy. A better policy is to educate users on good security
behavior and optionally to run a passphrase cracker regularly on all
users passphrases to catch the very simple ones.
@item --max-passphrase-days @var{n}
@opindex max-passphrase-days
Ask the user to change the passphrase if @var{n} days have passed since
the last change. With @option{--enforce-passphrase-constraints} set the
user may not bypass this check.
@item --enable-passphrase-history
@opindex enable-passphrase-history
This option does nothing yet.
@item --pinentry-program @var{filename}
@opindex pinentry-program
Use program @var{filename} as the PIN entry. The default is installation
dependent and can be shown with the @code{--version} command.
@item --pinentry-touch-file @var{filename}
@opindex pinentry-touch-file
By default the filename of the socket gpg-agent is listening for
requests is passed to Pinentry, so that it can touch that file before
exiting (it does this only in curses mode). This option changes the
file passed to Pinentry to @var{filename}. The special name
@code{/dev/null} may be used to completely disable this feature. Note
that Pinentry will not create that file, it will only change the
modification and access time.
@item --scdaemon-program @var{filename}
@opindex scdaemon-program
Use program @var{filename} as the Smartcard daemon. The default is
installation dependent and can be shown with the @code{--version}
command.
@item --disable-scdaemon
@opindex disable-scdaemon
Do not make use of the scdaemon tool. This option has the effect of
disabling the ability to do smartcard operations. Note, that enabling
this option at runtime does not kill an already forked scdaemon.
@item --use-standard-socket
@itemx --no-use-standard-socket
@opindex use-standard-socket
@opindex no-use-standard-socket
By enabling this option @command{gpg-agent} will listen on the socket
named @file{S.gpg-agent}, located in the home directory, and not create
a random socket below a temporary directory. Tools connecting to
@command{gpg-agent} should first try to connect to the socket given in
environment variable @var{GPG_AGENT_INFO} and then fall back to this
socket. This option may not be used if the home directory is mounted as
a remote file system. Note, that @option{--use-standard-socket} is the
default on Windows systems.
@item --display @var{string}
@itemx --ttyname @var{string}
@itemx --ttytype @var{string}
@itemx --lc-ctype @var{string}
@itemx --lc-messages @var{string}
@itemx --xauthority @var{string}
@opindex display
@opindex ttyname
@opindex ttytype
@opindex lc-ctype
@opindex lc-messages
@opindex xauthority
These options are used with the server mode to pass localization
information.
@item --keep-tty
@itemx --keep-display
@opindex keep-tty
@opindex keep-display
Ignore requests to change the current @code{tty} or X window system's
@code{DISPLAY} variable respectively. This is useful to lock the
pinentry to pop up at the @code{tty} or display you started the agent.
@anchor{option --enable-ssh-support}
@item --enable-ssh-support
@opindex enable-ssh-support
Enable emulation of the OpenSSH Agent protocol.
In this mode of operation, the agent does not only implement the
gpg-agent protocol, but also the agent protocol used by OpenSSH
(through a separate socket). Consequently, it should be possible to use
the gpg-agent as a drop-in replacement for the well known ssh-agent.
SSH Keys, which are to be used through the agent, need to be added to
the gpg-agent initially through the ssh-add utility. When a key is
added, ssh-add will ask for the password of the provided key file and
send the unprotected key material to the agent; this causes the
gpg-agent to ask for a passphrase, which is to be used for encrypting
the newly received key and storing it in a gpg-agent specific
directory.
Once a key has been added to the gpg-agent this way, the gpg-agent
will be ready to use the key.
Note: in case the gpg-agent receives a signature request, the user might
need to be prompted for a passphrase, which is necessary for decrypting
the stored key. Since the ssh-agent protocol does not contain a
mechanism for telling the agent on which display/terminal it is running,
gpg-agent's ssh-support will use the TTY or X display where gpg-agent
has been started. To switch this display to the current one, the
following command may be used:
@smallexample
echo UPDATESTARTUPTTY | gpg-connect-agent
@end smallexample
@end table
All the long options may also be given in the configuration file after
stripping off the two leading dashes.
@mansect files
@node Agent Configuration
@section Configuration
There are a few configuration files needed for the operation of the
agent. By default they may all be found in the current home directory
(@pxref{option --homedir}).
@table @file
@item gpg-agent.conf
@cindex gpg-agent.conf
This is the standard configuration file read by @command{gpg-agent} on
startup. It may contain any valid long option; the leading
two dashes may not be entered and the option may not be abbreviated.
This file is also read after a @code{SIGHUP} however only a few
options will actually have an effect. This default name may be
changed on the command line (@pxref{option --options}).
@item trustlist.txt
This is the list of trusted keys. Comment lines, indicated by a leading
hash mark, as well as empty lines are ignored. To mark a key as trusted
you need to enter its fingerprint followed by a space and a capital
letter @code{S}. Colons may optionally be used to separate the bytes of
a fingerprint; this allows to cut and paste the fingerprint from a key
listing output. If the line is prefixed with a @code{!} the key is
explicitly marked as not trusted.
Here is an example where two keys are marked as ultimately trusted
and one as not trusted:
@example
# CN=Wurzel ZS 3,O=Intevation GmbH,C=DE
A6935DD34EF3087973C706FC311AA2CCF733765B S
# CN=PCA-1-Verwaltung-02/O=PKI-1-Verwaltung/C=DE
DC:BD:69:25:48:BD:BB:7E:31:6E:BB:80:D3:00:80:35:D4:F8:A6:CD S
# CN=Root-CA/O=Schlapphuete/L=Pullach/C=DE
!14:56:98:D3:FE:9C:CA:5A:31:6E:BC:81:D3:11:4E:00:90:A3:44:C2 S
@end example
Before entering a key into this file, you need to ensure its
authenticity. How to do this depends on your organisation; your
administrator might have already entered those keys which are deemed
trustworthy enough into this file. Places where to look for the
fingerprint of a root certificate are letters received from the CA or
the website of the CA (after making 100% sure that this is indeed the
website of that CA). You may want to consider allowing interactive
updates of this file by using the @xref{option --allow-mark-trusted}.
This is however not as secure as maintaining this file manually. It is
even advisable to change the permissions to read-only so that this file
can't be changed inadvertently.
As a special feature a line @code{include-default} will include a global
list of trusted certificates (e.g. @file{/etc/gnupg/trustlist.txt}).
This global list is also used if the local list is not available.
It is possible to add further flags after the @code{S} for use by the
caller:
@table @code
@item relax
Relax checking of some root certificate requirements. This is for
example required if the certificate is missing the basicConstraints
attribute (despite that it is a MUST for CA certificates).
@item cm
If validation of a certificate finally issued by a CA with this flag set
fails, try again using the chain validation model.
@end table
@item sshcontrol
This file is used when support for the secure shell agent protocol has
been enabled (@pxref{option --enable-ssh-support}). Only keys present
in this file are used in the SSH protocol. The @command{ssh-add} tool
may be used to add new entries to this file; you may also add them
manually. Comment lines, indicated by a leading hash mark, as well as
empty lines are ignored. An entry starts with optional whitespace,
followed by the keygrip of the key given as 40 hex digits, optionally
followed by the caching TTL in seconds and another optional field for
arbitrary flags. A non-zero TTL overrides the global default as
set by @option{--default-cache-ttl-ssh}.
The keygrip may be prefixed with a @code{!} to disable an entry entry.
The following example lists exactly one key. Note that keys available
through a OpenPGP smartcard in the active smartcard reader are
implicitly added to this list; i.e. there is no need to list them.
@example
# Key added on 2005-02-25 15:08:29
5A6592BF45DC73BD876874A28FD4639282E29B52 0
@end example
@item private-keys-v1.d/
This is the directory where gpg-agent stores the private keys. Each
key is stored in a file with the name made up of the keygrip and the
suffix @file{key}.
@end table
Note that on larger installations, it is useful to put predefined
files into the directory @file{/etc/skel/.gnupg/} so that newly created
users start up with a working configuration. For existing users the
a small helper script is provided to create these files (@pxref{addgnupghome}).
@c
@c Agent Signals
@c
@mansect signals
@node Agent Signals
@section Use of some signals.
A running @command{gpg-agent} may be controlled by signals, i.e. using
the @command{kill} command to send a signal to the process.
Here is a list of supported signals:
@table @gnupgtabopt
@item SIGHUP
@cpindex SIGHUP
This signal flushes all cached passphrases and if the program has been
started with a configuration file, the configuration file is read again.
Only certain options are honored: @code{quiet}, @code{verbose},
@code{debug}, @code{debug-all}, @code{debug-level}, @code{no-grab},
@code{pinentry-program}, @code{default-cache-ttl}, @code{max-cache-ttl},
@code{ignore-cache-for-signing}, @code{allow-mark-trusted} and
@code{disable-scdaemon}. @code{scdaemon-program} is also supported but
due to the current implementation, which calls the scdaemon only once,
it is not of much use unless you manually kill the scdaemon.
@item SIGTERM
@cpindex SIGTERM
Shuts down the process but waits until all current requests are
fulfilled. If the process has received 3 of these signals and requests
are still pending, a shutdown is forced.
@item SIGINT
@cpindex SIGINT
Shuts down the process immediately.
@item SIGUSR1
@cpindex SIGUSR1
Dump internal information to the log file.
@item SIGUSR2
@cpindex SIGUSR2
This signal is used for internal purposes.
@end table
@c
@c Examples
@c
@mansect examples
@node Agent Examples
@section Examples
The usual way to invoke @command{gpg-agent} is
@example
$ eval $(gpg-agent --daemon)
@end example
An alternative way is by replacing @command{ssh-agent} with
@command{gpg-agent}. If for example @command{ssh-agent} is started as
part of the Xsession initialization, you may simply replace
@command{ssh-agent} by a script like:
@cartouche
@example
#!/bin/sh
exec /usr/local/bin/gpg-agent --enable-ssh-support --daemon \
--write-env-file $@{HOME@}/.gpg-agent-info "$@@"
@end example
@end cartouche
@noindent
and add something like (for Bourne shells)
@cartouche
@example
if [ -f "$@{HOME@}/.gpg-agent-info" ]; then
. "$@{HOME@}/.gpg-agent-info"
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
fi
@end example
@end cartouche
@noindent
to your shell initialization file (e.g. @file{~/.bashrc}).
@c
@c Assuan Protocol
@c
@manpause
@node Agent Protocol
@section Agent's Assuan Protocol
Note: this section does only document the protocol, which is used by
GnuPG components; it does not deal with the ssh-agent protocol.
The @command{gpg-agent} should be started by the login shell and set an
environment variable to tell clients about the socket to be used.
Clients should deny to access an agent with a socket name which does
not match its own configuration. An application may choose to start
an instance of the gpgagent if it does not figure that any has been
started; it should not do this if a gpgagent is running but not
usable. Because @command{gpg-agent} can only be used in background mode, no
special command line option is required to activate the use of the
protocol.
To identify a key we use a thing called keygrip which is the SHA-1 hash
of an canoncical encoded S-Expression of the the public key as used in
Libgcrypt. For the purpose of this interface the keygrip is given as a
hex string. The advantage of using this and not the hash of a
certificate is that it will be possible to use the same keypair for
different protocols, thereby saving space on the token used to keep the
secret keys.
@menu
* Agent PKDECRYPT:: Decrypting a session key
* Agent PKSIGN:: Signing a Hash
* Agent GENKEY:: Generating a Key
* Agent IMPORT:: Importing a Secret Key
* Agent EXPORT:: Exporting a Secret Key
* Agent ISTRUSTED:: Importing a Root Certificate
* Agent GET_PASSPHRASE:: Ask for a passphrase
* Agent GET_CONFIRMATION:: Ask for confirmation
* Agent HAVEKEY:: Check whether a key is available
* Agent LEARN:: Register a smartcard
* Agent PASSWD:: Change a Passphrase
* Agent UPDATESTARTUPTTY:: Change the Standard Display
* Agent GETEVENTCOUNTER:: Get the Event Counters
* Agent GETINFO:: Return information about the process
@end menu
@node Agent PKDECRYPT
@subsection Decrypting a session key
The client asks the server to decrypt a session key. The encrypted
session key should have all information needed to select the
appropriate secret key or to delegate it to a smartcard.
@example
SETKEY <keyGrip>
@end example
Tell the server about the key to be used for decryption. If this is
not used, @command{gpg-agent} may try to figure out the key by trying to
decrypt the message with each key available.
@example
PKDECRYPT
@end example
The agent checks whether this command is allowed and then does an
INQUIRY to get the ciphertext the client should then send the cipher
text.
@example
S: INQUIRE CIPHERTEXT
C: D (xxxxxx
C: D xxxx)
C: END
@end example
Please note that the server may send status info lines while reading the
data lines from the client. The data send is a SPKI like S-Exp with
this structure:
@example
(enc-val
(<algo>
(<param_name1> <mpi>)
...
(<param_namen> <mpi>)))
@end example
Where algo is a string with the name of the algorithm; see the libgcrypt
documentation for a list of valid algorithms. The number and names of
the parameters depend on the algorithm. The agent does return an error
if there is an inconsistency.
If the decryption was successful the decrypted data is returned by
means of "D" lines.
Here is an example session:
@example
C: PKDECRYPT
S: INQUIRE CIPHERTEXT
C: D (enc-val elg (a 349324324)
C: D (b 3F444677CA)))
C: END
S: # session key follows
S: D (value 1234567890ABCDEF0)
S: OK descryption successful
@end example
@node Agent PKSIGN
@subsection Signing a Hash
The client ask the agent to sign a given hash value. A default key
will be chosen if no key has been set. To set a key a client first
uses:
@example
SIGKEY <keyGrip>
@end example
This can be used multiple times to create multiple signature, the list
of keys is reset with the next PKSIGN command or a RESET. The server
test whether the key is a valid key to sign something and responds with
okay.
@example
SETHASH --hash=<name>|<algo> <hexstring>
@end example
The client can use this command to tell the server about the data <hexstring>
(which usually is a hash) to be signed. <algo> is the decimal encoded hash
algorithm number as used by Libgcrypt. Either <algo> or --hash=<name>
must be given. Valid names for <name> are:
@table @code
@item sha1
@item sha256
@item rmd160
@item md5
@item tls-md5sha1
@end table
@noindent
The actual signing is done using
@example
PKSIGN <options>
@end example
Options are not yet defined, but my later be used to choosen among
different algorithms. The agent does then some checks, asks for the
passphrase and as a result the server returns the signature as an SPKI
like S-expression in "D" lines:
@example
(sig-val
(<algo>
(<param_name1> <mpi>)
...
(<param_namen> <mpi>)))
@end example
The operation is affected by the option
@example
OPTION use-cache-for-signing=0|1
@end example
The default of @code{1} uses the cache. Setting this option to @code{0}
will lead @command{gpg-agent} to ignore the passphrase cache. Note, that there is
also a global command line option for @command{gpg-agent} to globally disable the
caching.
Here is an example session:
@example
C: SIGKEY <keyGrip>
S: OK key available
C: SIGKEY <keyGrip>
S: OK key available
C: PKSIGN
S: # I did ask the user whether he really wants to sign
S: # I did ask the user for the passphrase
S: INQUIRE HASHVAL
C: D ABCDEF012345678901234
C: END
S: # signature follows
S: D (sig-val rsa (s 45435453654612121212))
S: OK
@end example
@node Agent GENKEY
@subsection Generating a Key
This is used to create a new keypair and store the secret key inside the
active PSE --- which is in most cases a Soft-PSE. An not yet defined
option allows to choose the storage location. To get the secret key out
of the PSE, a special export tool has to be used.
@example
GENKEY
@end example
Invokes the key generation process and the server will then inquire
on the generation parameters, like:
@example
S: INQUIRE KEYPARM
C: D (genkey (rsa (nbits 1024)))
C: END
@end example
The format of the key parameters which depends on the algorithm is of
the form:
@example
(genkey
(algo
(parameter_name_1 ....)
....
(parameter_name_n ....)))
@end example
If everything succeeds, the server returns the *public key* in a SPKI
like S-Expression like this:
@example
(public-key
(rsa
(n <mpi>)
(e <mpi>)))
@end example
Here is an example session:
@example
C: GENKEY
S: INQUIRE KEYPARM
C: D (genkey (rsa (nbits 1024)))
C: END
S: D (public-key
S: D (rsa (n 326487324683264) (e 10001)))
S OK key created
@end example
@node Agent IMPORT
@subsection Importing a Secret Key
This operation is not yet supportted by GpgAgent. Specialized tools
are to be used for this.
There is no actual need because we can expect that secret keys
created by a 3rd party are stored on a smartcard. If we have
generated the key ourself, we do not need to import it.
@node Agent EXPORT
@subsection Export a Secret Key
Not implemented.
Should be done by an extra tool.
@node Agent ISTRUSTED
@subsection Importing a Root Certificate
Actually we do not import a Root Cert but provide a way to validate
any piece of data by storing its Hash along with a description and
an identifier in the PSE. Here is the interface desription:
@example
ISTRUSTED <fingerprint>
@end example
Check whether the OpenPGP primary key or the X.509 certificate with the
given fingerprint is an ultimately trusted key or a trusted Root CA
certificate. The fingerprint should be given as a hexstring (without
any blanks or colons or whatever in between) and may be left padded with
00 in case of an MD5 fingerprint. GPGAgent will answer with:
@example
OK
@end example
The key is in the table of trusted keys.
@example
ERR 304 (Not Trusted)
@end example
The key is not in this table.
Gpg needs the entire list of trusted keys to maintain the web of
trust; the following command is therefore quite helpful:
@example
LISTTRUSTED
@end example
GpgAgent returns a list of trusted keys line by line:
@example
S: D 000000001234454556565656677878AF2F1ECCFF P
S: D 340387563485634856435645634856438576457A P
S: D FEDC6532453745367FD83474357495743757435D S
S: OK
@end example
The first item on a line is the hexified fingerprint where MD5
ingerprints are @code{00} padded to the left and the second item is a
flag to indicate the type of key (so that gpg is able to only take care
of PGP keys). P = OpenPGP, S = S/MIME. A client should ignore the rest
of the line, so that we can extend the format in the future.
Finally a client should be able to mark a key as trusted:
@example
MARKTRUSTED @var{fingerprint} "P"|"S"
@end example
The server will then pop up a window to ask the user whether she
really trusts this key. For this it will probably ask for a text to
be displayed like this:
@example
S: INQUIRE TRUSTDESC
C: D Do you trust the key with the fingerprint @@FPR@@
C: D bla fasel blurb.
C: END
S: OK
@end example
Known sequences with the pattern @@foo@@ are replaced according to this
table:
@table @code
@item @@FPR16@@
Format the fingerprint according to gpg rules for a v3 keys.
@item @@FPR20@@
Format the fingerprint according to gpg rules for a v4 keys.
@item @@FPR@@
Choose an appropriate format to format the fingerprint.
@item @@@@
Replaced by a single @code{@@}
@end table
@node Agent GET_PASSPHRASE
@subsection Ask for a passphrase
This function is usually used to ask for a passphrase to be used for
conventional encryption, but may also be used by programs which need
special handling of passphrases. This command uses a syntax which helps
clients to use the agent with minimum effort.
@example
GET_PASSPHRASE [--data] [--check] [--no-ask] [--repeat[=N]] [--qualitybar] @var{cache_id} [@var{error_message} @var{prompt} @var{description}]
@end example
@var{cache_id} is expected to be a string used to identify a cached
passphrase. Use a @code{X} to bypass the cache. With no other
arguments the agent returns a cached passphrase or an error. By
convention either the hexified fingerprint of the key shall be used for
@var{cache_id} or an arbitrary string prefixed with the name of the
calling application and a colon: Like @code{gpg:somestring}.
@var{error_message} is either a single @code{X} for no error message or
a string to be shown as an error message like (e.g. "invalid
passphrase"). Blanks must be percent escaped or replaced by @code{+}'.
@var{prompt} is either a single @code{X} for a default prompt or the
text to be shown as the prompt. Blanks must be percent escaped or
replaced by @code{+}.
@var{description} is a text shown above the entry field. Blanks must be
percent escaped or replaced by @code{+}.
The agent either returns with an error or with a OK followed by the hex
encoded passphrase. Note that the length of the strings is implicitly
limited by the maximum length of a command. If the option
@option{--data} is used, the passphrase is not returned on the OK line
but by regular data lines; this is the preferred method.
If the option @option{--check} is used, the standard passphrase
constraints checks are applied. A check is not done if the passphrase
has been found in the cache.
If the option @option{--no-ask} is used and the passphrase is not in the
cache the user will not be asked to enter a passphrase but the error
code @code{GPG_ERR_NO_DATA} is returned.
If the option @option{--qualitybar} is used and a minimum passphrase
length has been configured, a visual indication of the entered
passphrase quality is shown.
@example
CLEAR_PASSPHRASE @var{cache_id}
@end example
may be used to invalidate the cache entry for a passphrase. The
function returns with OK even when there is no cached passphrase.
@node Agent GET_CONFIRMATION
@subsection Ask for confirmation
This command may be used to ask for a simple confirmation by
presenting a text and 2 bottonts: Okay and Cancel.
@example
GET_CONFIRMATION @var{description}
@end example
@var{description}is displayed along with a Okay and Cancel
button. Blanks must be percent escaped or replaced by @code{+}. A
@code{X} may be used to display confirmation dialog with a default
text.
The agent either returns with an error or with a OK. Note, that the
length of @var{description} is implicitly limited by the maximum
length of a command.
@node Agent HAVEKEY
@subsection Check whether a key is available
This can be used to see whether a secret key is available. It does
not return any information on whether the key is somehow protected.
@example
HAVEKEY @var{keygrip}
@end example
The Agent answers either with OK or @code{No_Secret_Key} (208). The
caller may want to check for other error codes as well.
@node Agent LEARN
@subsection Register a smartcard
@example
LEARN [--send]
@end example
This command is used to register a smartcard. With the --send
option given the certificates are send back.
@node Agent PASSWD
@subsection Change a Passphrase
@example
PASSWD @var{keygrip}
@end example
This command is used to interactively change the passphrase of the key
indentified by the hex string @var{keygrip}.
@node Agent UPDATESTARTUPTTY
@subsection Change the standard display
@example
UPDATESTARTUPTTY
@end example
Set the startup TTY and X-DISPLAY variables to the values of this
session. This command is useful to direct future pinentry invocations
to another screen. It is only required because there is no way in the
ssh-agent protocol to convey this information.
@node Agent GETEVENTCOUNTER
@subsection Get the Event Counters
@example
GETEVENTCOUNTER
@end example
This function return one status line with the current values of the
event counters. The event counters are useful to avoid polling by
delaying a poll until something has changed. The values are decimal
numbers in the range @code{0} to @code{UINT_MAX} and wrapping around to
0. The actual values should not be relied upon; they shall only be used
to detect a change.
The currently defined counters are are:
@table @code
@item ANY
Incremented with any change of any of the other counters.
@item KEY
Incremented for added or removed private keys.
@item CARD
Incremented for changes of the card readers stati.
@end table
@node Agent GETINFO
@subsection Return information about the process
This is a multipurpose function to return a variety of information.
@example
GETINFO @var{what}
@end example
The value of @var{what} specifies the kind of information returned:
@table @code
@item version
Return the version of the program.
@item pid
Return the process id of the process.
@item socket_name
Return the name of the socket used to connect the agent.
@item ssh_socket_name
Return the name of the socket used for SSH connections. If SSH support
has not been enabled the error @code{GPG_ERR_NO_DATA} will be returned.
@end table
@mansect see also
@ifset isman
@command{gpg2}(1),
@command{gpgsm}(1),
@command{gpg-connect-agent}(1),
@command{scdaemon}(1)
@end ifset
@include see-also-note.texi
diff --git a/doc/tools.texi b/doc/tools.texi
index 506529065..fa794fc2b 100644
--- a/doc/tools.texi
+++ b/doc/tools.texi
@@ -1,1670 +1,1670 @@
@c Copyright (C) 2004, 2008 Free Software Foundation, Inc.
@c This is part of the GnuPG manual.
@c For copying conditions, see the file GnuPG.texi.
@node Helper Tools
@chapter Helper Tools
GnuPG comes with a couple of smaller tools:
@menu
* watchgnupg:: Read logs from a socket.
* gpgv:: Verify OpenPGP signatures.
* addgnupghome:: Create .gnupg home directories.
* gpgconf:: Modify .gnupg home directories.
* applygnupgdefaults:: Run gpgconf for all users.
* gpgsm-gencert.sh:: Generate an X.509 certificate request.
* gpg-preset-passphrase:: Put a passphrase into the cache.
* gpg-connect-agent:: Communicate with a running agent.
* gpgparsemail:: Parse a mail message into an annotated format
* symcryptrun:: Call a simple symmetric encryption tool.
* gpg-zip:: Encrypt or sign files into an archive.
@end menu
@c
@c WATCHGNUPG
@c
@manpage watchgnupg.1
@node watchgnupg
@section Read logs from a socket
@ifset manverb
.B watchgnupg
\- Read and print logs from a socket
@end ifset
@mansect synopsis
@ifset manverb
.B watchgnupg
.RB [ \-\-force ]
.RB [ \-\-verbose ]
.I socketname
@end ifset
@mansect description
-Most of the main utilities are able to write there log files to a
+Most of the main utilities are able to write their log files to a
Unix Domain socket if configured that way. @command{watchgnupg} is a simple
listener for such a socket. It ameliorates the output with a time
stamp and makes sure that long lines are not interspersed with log
output from other utilities.
@noindent
@command{watchgnupg} is commonly invoked as
@example
watchgnupg --force ~/.gnupg/S.log
@end example
@manpause
@noindent
This starts it on the current terminal for listening on the socket
@file{~/.gnupg/S.log}.
@mansect options
@noindent
@command{watchgnupg} understands these options:
@table @gnupgtabopt
@item --force
@opindex force
Delete an already existing socket file.
@item --verbose
@opindex verbose
Enable extra informational output.
@item --version
@opindex version
Print version of the program and exit.
@item --help
@opindex help
Display a brief help page and exit.
@end table
@mansect see also
@ifset isman
@command{gpg}(1),
@command{gpgsm}(1),
@command{gpg-agent}(1),
@command{scdaemon}(1)
@end ifset
@include see-also-note.texi
@c
@c GPGV
@c
@include gpgv.texi
@c
@c ADDGNUPGHOME
@c
@manpage addgnupghome.8
@node addgnupghome
@section Create .gnupg home directories.
@ifset manverb
.B addgnupghome
\- Create .gnupg home directories
@end ifset
@mansect synopsis
@ifset manverb
.B addgnupghome
.I account_1
.IR account_2 ... account_n
@end ifset
@mansect description
If GnuPG is installed on a system with existing user accounts, it is
sometimes required to populate the GnuPG home directory with existing
files. Especially a @file{trustlist.txt} and a keybox with some
initial certificates are often desired. This scripts help to do this
by copying all files from @file{/etc/skel/.gnupg} to the home
directories of the accounts given on the command line. It takes care
not to overwrite existing GnuPG home directories.
@noindent
@command{addgnupghome} is invoked by root as:
@example
addgnupghome account1 account2 ... accountn
@end example
@c
@c GPGCONF
@c
@manpage gpgconf.1
@node gpgconf
@section Modify .gnupg home directories.
@ifset manverb
.B gpgconf
\- Modify .gnupg home directories
@end ifset
@mansect synopsis
@ifset manverb
.B gpgconf
.RI [ options ]
.B \-\-list-components
.br
.B gpgconf
.RI [ options ]
.B \-\-list-options
.I component
.br
.B gpgconf
.RI [ options ]
.B \-\-change-options
.I component
@end ifset
@mansect description
The @command{gpgconf} is a utility to automatically and reasonable
safely query and modify configuration files in the @file{.gnupg} home
directory. It is designed not to be invoked manually by the user, but
automatically by graphical user interfaces (GUI).@footnote{Please note
that currently no locking is done, so concurrent access should be
avoided. There are some precautions to avoid corruption with
concurrent usage, but results may be inconsistent and some changes may
get lost. The stateless design makes it difficult to provide more
guarantees.}
@command{gpgconf} provides access to the configuration of one or more
components of the GnuPG system. These components correspond more or
less to the programs that exist in the GnuPG framework, like GnuPG,
GPGSM, DirMngr, etc. But this is not a strict one-to-one
relationship. Not all configuration options are available through
@command{gpgconf}. @command{gpgconf} provides a generic and abstract
method to access the most important configuration options that can
feasibly be controlled via such a mechanism.
@command{gpgconf} can be used to gather and change the options
available in each component, and can also provide their default
values. @command{gpgconf} will give detailed type information that
can be used to restrict the user's input without making an attempt to
commit the changes.
@command{gpgconf} provides the backend of a configuration editor. The
configuration editor would usually be a graphical user interface
program, that allows to display the current options, their default
values, and allows the user to make changes to the options. These
changes can then be made active with @command{gpgconf} again. Such a
program that uses @command{gpgconf} in this way will be called GUI
throughout this section.
@menu
* Invoking gpgconf:: List of all commands and options.
* Format conventions:: Formatting conventions relevant for all commands.
* Listing components:: List all gpgconf components.
* Checking programs:: Check all programs know to gpgconf.
* Listing options:: List all options of a component.
* Changing options:: Changing options of a component.
* Listing global options:: List all global options.
* Files used by gpgconf:: What files are used by gpgconf.
@end menu
@manpause
@node Invoking gpgconf
@subsection Invoking gpgconf
@mansect commands
One of the following commands must be given:
@table @gnupgtabopt
@item --list-components
List all components. This is the default command used if none is
specified.
@item --check-programs
List all available backend programs and test whether they are runnable.
@item --list-options @var{component}
List all options of the component @var{component}.
@item --change-options @var{component}
Change the options of the component @var{component}.
@item --check-options @var{component}
Check the options for the component @var{component}.
@item --apply-defaults
Update all configuration files with values taken from the global
configuration file (usually @file{/etc/gnupg/gpgconf.conf}).
@item --list-dirs
Lists the directories used by @command{gpgconf}. One directory is
listed per line, and each line consists of a colon-separated list where
the first field names the directory type (for example @code{sysconfdir})
and the second field contains the percent-escaped directory. Although
they are not directories, the socket file names used by
@command{gpg-agent} and @command{dirmngr} are printed as well. Note
that the socket file names and the @code{homedir} lines are the default
names and they may be overridden by command line switches.
@item --list-config [@var{filename}]
List the global configuration file in a colon separated format. If
@var{filename} is given, check that file instead.
@item --check-config [@var{filename}]
Run a syntax check on the global configuration file. If @var{filename}
is given, check that file instead.
@end table
@mansect options
The following options may be used:
@table @gnupgtabopt
@c FIXME: Not yet supported.
@c @item -o @var{file}
@c @itemx --output @var{file}
@c Use @var{file} as output file.
@item -v
@itemx --verbose
Outputs additional information while running. Specifically, this
extends numerical field values by human-readable descriptions.
@item -n
@itemx --dry-run
Do not actually change anything. This is currently only implemented
for @code{--change-options} and can be used for testing purposes.
@item -r
@itemx --runtime
Only used together with @code{--change-options}. If one of the
modified options can be changed in a running daemon process, signal
the running daemon to ask it to reparse its configuration file after
changing.
This means that the changes will take effect at run-time, as far as
this is possible. Otherwise, they will take effect at the next start
of the respective backend programs.
@manpause
@end table
@node Format conventions
@subsection Format conventions
Some lines in the output of @command{gpgconf} contain a list of
colon-separated fields. The following conventions apply:
@itemize @bullet
@item
The GUI program is required to strip off trailing newline and/or
carriage return characters from the output.
@item
@command{gpgconf} will never leave out fields. If a certain version
provides a certain field, this field will always be present in all
@command{gpgconf} versions from that time on.
@item
Future versions of @command{gpgconf} might append fields to the list.
New fields will always be separated from the previously last field by
a colon separator. The GUI should be prepared to parse the last field
it knows about up until a colon or end of line.
@item
Not all fields are defined under all conditions. You are required to
ignore the content of undefined fields.
@end itemize
There are several standard types for the content of a field:
@table @asis
@item verbatim
Some fields contain strings that are not escaped in any way. Such
fields are described to be used @emph{verbatim}. These fields will
never contain a colon character (for obvious reasons). No de-escaping
or other formatting is required to use the field content. This is for
easy parsing of the output, when it is known that the content can
never contain any special characters.
@item percent-escaped
Some fields contain strings that are described to be
@emph{percent-escaped}. Such strings need to be de-escaped before
their content can be presented to the user. A percent-escaped string
is de-escaped by replacing all occurences of @code{%XY} by the byte
that has the hexadecimal value @code{XY}. @code{X} and @code{Y} are
from the set @code{0-9a-f}.
@item localised
Some fields contain strings that are described to be @emph{localised}.
Such strings are translated to the active language and formatted in
the active character set.
@item @w{unsigned number}
Some fields contain an @emph{unsigned number}. This number will
always fit into a 32-bit unsigned integer variable. The number may be
followed by a space, followed by a human readable description of that
value (if the verbose option is used). You should ignore everything
in the field that follows the number.
@item @w{signed number}
Some fields contain a @emph{signed number}. This number will always
fit into a 32-bit signed integer variable. The number may be followed
by a space, followed by a human readable description of that value (if
the verbose option is used). You should ignore everything in the
field that follows the number.
@item @w{boolean value}
Some fields contain a @emph{boolean value}. This is a number with
either the value 0 or 1. The number may be followed by a space,
followed by a human readable description of that value (if the verbose
option is used). You should ignore everything in the field that follows
the number; checking just the first character is sufficient in this
case.
@item option
Some fields contain an @emph{option} argument. The format of an
option argument depends on the type of the option and on some flags:
@table @asis
@item no argument
The simplest case is that the option does not take an argument at all
(@var{type} @code{0}). Then the option argument is an unsigned number
that specifies how often the option occurs. If the @code{list} flag
is not set, then the only valid number is @code{1}. Options that do
not take an argument never have the @code{default} or @code{optional
arg} flag set.
@item number
If the option takes a number argument (@var{alt-type} is @code{2} or
@code{3}), and it can only occur once (@code{list} flag is not set),
then the option argument is either empty (only allowed if the argument
is optional), or it is a number. A number is a string that begins
with an optional minus character, followed by one or more digits. The
number must fit into an integer variable (unsigned or signed,
depending on @var{alt-type}).
@item number list
If the option takes a number argument and it can occur more than once,
then the option argument is either empty, or it is a comma-separated
list of numbers as described above.
@item string
If the option takes a string argument (@var{alt-type} is 1), and it
can only occur once (@code{list} flag is not set) then the option
argument is either empty (only allowed if the argument is optional),
or it starts with a double quote character (@code{"}) followed by a
percent-escaped string that is the argument value. Note that there is
only a leading double quote character, no trailing one. The double
quote character is only needed to be able to differentiate between no
value and the empty string as value.
@item string list
If the option takes a number argument and it can occur more than once,
then the option argument is either empty, or it is a comma-separated
list of string arguments as described above.
@end table
@end table
The active language and character set are currently determined from
the locale environment of the @command{gpgconf} program.
@c FIXME: Document the active language and active character set. Allow
@c to change it via the command line?
@mansect usage
@node Listing components
@subsection Listing components
The command @code{--list-components} will list all components that can
be configured with @command{gpgconf}. Usually, one component will
correspond to one GnuPG-related program and contain the options of
that programs configuration file that can be modified using
@command{gpgconf}. However, this is not necessarily the case. A
component might also be a group of selected options from several
programs, or contain entirely virtual options that have a special
effect rather than changing exactly one option in one configuration
file.
A component is a set of configuration options that semantically belong
together. Furthermore, several changes to a component can be made in
an atomic way with a single operation. The GUI could for example
provide a menu with one entry for each component, or a window with one
tabulator sheet per component.
The command argument @code{--list-components} lists all available
components, one per line. The format of each line is:
@code{@var{name}:@var{description}:@var{pgmname}:}
@table @var
@item name
This field contains a name tag of the component. The name tag is used
to specify the component in all communication with @command{gpgconf}.
The name tag is to be used @emph{verbatim}. It is thus not in any
escaped format.
@item description
The @emph{string} in this field contains a human-readable description
of the component. It can be displayed to the user of the GUI for
informational purposes. It is @emph{percent-escaped} and
@emph{localized}.
@item pgmname
The @emph{string} in this field contains the absolute name of the
program's file. It can be used to unambiguously invoke that program.
It is @emph{percent-escaped}.
@end table
Example:
@example
$ gpgconf --list-components
gpg:GPG for OpenPGP:/usr/local/bin/gpg2:
gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:
scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:
gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:
dirmngr:Directory Manager:/usr/local/bin/dirmngr:
@end example
@node Checking programs
@subsection Checking programs
The command @code{--check-programs} is similar to
@code{--list-components} but works on backend programs and not on
components. It runs each program to test wether it is installed and
runnable. This also includes a syntax check of all config file options
of the program.
The command argument @code{--check-programs} lists all available
programs, one per line. The format of each line is:
@code{@var{name}:@var{description}:@var{pgmname}:@var{avail}:@var{okay}:@var{cfgfile}:@var{line}:@var{error}:}
@table @var
@item name
This field contains a name tag of the program which is identical to the
name of the component. The name tag is to be used @emph{verbatim}. It
is thus not in any escaped format. This field may be empty to indicate
a continuation of error descriptions for the last name. The description
and pgmname fields are then also empty.
@item description
The @emph{string} in this field contains a human-readable description
of the component. It can be displayed to the user of the GUI for
informational purposes. It is @emph{percent-escaped} and
@emph{localized}.
@item pgmname
The @emph{string} in this field contains the absolute name of the
program's file. It can be used to unambiguously invoke that program.
It is @emph{percent-escaped}.
@item avail
The @emph{boolean value} in this field indicates whether the program is
installed and runnable.
@item okay
The @emph{boolean value} in this field indicates whether the program's
config file is syntactically okay.
@item cfgfile
If an error occured in the configuraion file (as indicated by a false
value in the field @code{okay}), this field has the name of the failing
configuration file. It is @emph{percent-escaped}.
@item line
If an error occured in the configuration file, this field has the line
number of the failing statement in the configuration file.
It is an @emph{unsigned number}.
@item error
If an error occured in the configuration file, this field has the error
text of the failing statement in the configuration file. It is
@emph{percent-escaped} and @emph{localized}.
@end table
@noindent
In the following example the @command{dirmngr} is not runnable and the
configuration file of @command{scdaemon} is not okay.
@example
$ gpgconf --check-programs
gpg:GPG for OpenPGP:/usr/local/bin/gpg2:1:1:
gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:1:1:
scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:1:0:
gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:1:1:
dirmngr:Directory Manager:/usr/local/bin/dirmngr:0:0:
@end example
@noindent
The command @w{@code{--check-options @var{component}}} will verify the
configuration file in the same manner as @code{--check-programs}, but
only for the component @var{component}.
@node Listing options
@subsection Listing options
Every component contains one or more options. Options may be gathered
into option groups to allow the GUI to give visual hints to the user
about which options are related.
The command argument @code{@w{--list-options @var{component}}} lists
all options (and the groups they belong to) in the component
@var{component}, one per line. @var{component} must be the string in
the field @var{name} in the output of the @code{--list-components}
command.
There is one line for each option and each group. First come all
options that are not in any group. Then comes a line describing a
group. Then come all options that belong into each group. Then comes
the next group and so on. There does not need to be any group (and in
this case the output will stop after the last non-grouped option).
The format of each line is:
@code{@var{name}:@var{flags}:@var{level}:@var{description}:@var{type}:@var{alt-type}:@var{argname}:@var{default}:@var{argdef}:@var{value}}
@table @var
@item name
This field contains a name tag for the group or option. The name tag
is used to specify the group or option in all communication with
@command{gpgconf}. The name tag is to be used @emph{verbatim}. It is
thus not in any escaped format.
@item flags
The flags field contains an @emph{unsigned number}. Its value is the
OR-wise combination of the following flag values:
@table @code
@item group (1)
If this flag is set, this is a line describing a group and not an
option.
@end table
The following flag values are only defined for options (that is, if
the @code{group} flag is not used).
@table @code
@item optional arg (2)
If this flag is set, the argument is optional. This is never set for
@var{type} @code{0} (none) options.
@item list (4)
If this flag is set, the option can be given multiple times.
@item runtime (8)
If this flag is set, the option can be changed at runtime.
@item default (16)
If this flag is set, a default value is available.
@item default desc (32)
If this flag is set, a (runtime) default is available. This and the
@code{default} flag are mutually exclusive.
@item no arg desc (64)
If this flag is set, and the @code{optional arg} flag is set, then the
option has a special meaning if no argument is given.
@item no change (128)
If this flag is set, gpgconf ignores requests to change the value. GUI
frontends should grey out this option. Note, that manual changes of the
configuration files are still possible.
@end table
@item level
This field is defined for options and for groups. It contains an
@emph{unsigned number} that specifies the expert level under which
this group or option should be displayed. The following expert levels
are defined for options (they have analogous meaning for groups):
@table @code
@item basic (0)
This option should always be offered to the user.
@item advanced (1)
This option may be offered to advanced users.
@item expert (2)
This option should only be offered to expert users.
@item invisible (3)
This option should normally never be displayed, not even to expert
users.
@item internal (4)
This option is for internal use only. Ignore it.
@end table
The level of a group will always be the lowest level of all options it
contains.
@item description
This field is defined for options and groups. The @emph{string} in
this field contains a human-readable description of the option or
group. It can be displayed to the user of the GUI for informational
purposes. It is @emph{percent-escaped} and @emph{localized}.
@item type
This field is only defined for options. It contains an @emph{unsigned
number} that specifies the type of the option's argument, if any. The
following types are defined:
Basic types:
@table @code
@item none (0)
No argument allowed.
@item string (1)
An @emph{unformatted string}.
@item int32 (2)
A @emph{signed number}.
@item uint32 (3)
An @emph{unsigned number}.
@end table
Complex types:
@table @code
@item pathname (32)
A @emph{string} that describes the pathname of a file. The file does
not necessarily need to exist.
@item ldap server (33)
A @emph{string} that describes an LDAP server in the format:
@code{@var{hostname}:@var{port}:@var{username}:@var{password}:@var{base_dn}}
@item key fingerprint (34)
A @emph{string} with a 40 digit fingerprint specifying a certificate.
@item pub key (35)
A @emph{string} that describes a certificate by user ID, key ID or
fingerprint.
@item sec key (36)
A @emph{string} that describes a certificate with a key by user ID,
key ID or fingerprint.
@item alias list (37)
A @emph{string} that describes an alias list, like the one used with
gpg's group option. The list consists of a key, an equal sign and space
separated values.
@end table
More types will be added in the future. Please see the @var{alt-type}
field for information on how to cope with unknown types.
@item alt-type
This field is identical to @var{type}, except that only the types
@code{0} to @code{31} are allowed. The GUI is expected to present the
user the option in the format specified by @var{type}. But if the
argument type @var{type} is not supported by the GUI, it can still
display the option in the more generic basic type @var{alt-type}. The
GUI must support all the defined basic types to be able to display all
options. More basic types may be added in future versions. If the
GUI encounters a basic type it doesn't support, it should report an
error and abort the operation.
@item argname
This field is only defined for options with an argument type
@var{type} that is not @code{0}. In this case it may contain a
@emph{percent-escaped} and @emph{localised string} that gives a short
name for the argument. The field may also be empty, though, in which
case a short name is not known.
@item default
This field is defined only for options for which the @code{default} or
@code{default desc} flag is set. If the @code{default} flag is set,
its format is that of an @emph{option argument} (@xref{Format
conventions}, for details). If the default value is empty, then no
default is known. Otherwise, the value specifies the default value
for this option. If the @code{default desc} flag is set, the field is
either empty or contains a description of the effect if the option is
not given.
@item argdef
This field is defined only for options for which the @code{optional
arg} flag is set. If the @code{no arg desc} flag is not set, its
format is that of an @emph{option argument} (@xref{Format
conventions}, for details). If the default value is empty, then no
default is known. Otherwise, the value specifies the default argument
for this option. If the @code{no arg desc} flag is set, the field is
either empty or contains a description of the effect of this option if
no argument is given.
@item value
This field is defined only for options. Its format is that of an
@emph{option argument}. If it is empty, then the option is not
explicitely set in the current configuration, and the default applies
(if any). Otherwise, it contains the current value of the option.
Note that this field is also meaningful if the option itself does not
take a real argument (in this case, it contains the number of times
the option appears).
@end table
@node Changing options
@subsection Changing options
The command @w{@code{--change-options @var{component}}} will attempt
to change the options of the component @var{component} to the
specified values. @var{component} must be the string in the field
@var{name} in the output of the @code{--list-components} command. You
have to provide the options that shall be changed in the following
format on standard input:
@code{@var{name}:@var{flags}:@var{new-value}}
@table @var
@item name
This is the name of the option to change. @var{name} must be the
string in the field @var{name} in the output of the
@code{--list-options} command.
@item flags
The flags field contains an @emph{unsigned number}. Its value is the
OR-wise combination of the following flag values:
@table @code
@item default (16)
If this flag is set, the option is deleted and the default value is
used instead (if applicable).
@end table
@item new-value
The new value for the option. This field is only defined if the
@code{default} flag is not set. The format is that of an @emph{option
argument}. If it is empty (or the field is omitted), the default
argument is used (only allowed if the argument is optional for this
option). Otherwise, the option will be set to the specified value.
@end table
@noindent
The output of the command is the same as that of
@code{--check-options} for the modified configuration file.
Examples:
To set the force option, which is of basic type @code{none (0)}:
@example
$ echo 'force:0:1' | gpgconf --change-options dirmngr
@end example
To delete the force option:
@example
$ echo 'force:16:' | gpgconf --change-options dirmngr
@end example
The @code{--runtime} option can influence when the changes take
effect.
@node Listing global options
@subsection Listing global options
Sometimes it is useful for applications to look at the global options
file @file{gpgconf.conf}.
The colon separated listing format is record oriented and uses the first
field to identify the record type:
@table @code
@item k
This describes a key record to start the definition of a new ruleset for
a user/group. The format of a key record is:
@code{k:@var{user}:@var{group}:}
@table @var
@item user
This is the user field of the key. It is percent escaped. See the
definition of the gpgconf.conf format for details.
@item group
This is the group field of the key. It is percent escaped.
@end table
@item r
This describes a rule record. All rule records up to the next key record
make up a rule set for that key. The format of a rule record is:
@code{r:::@var{component}:@var{option}:@var{flags}:@var{value}:}
@table @var
@item component
This is the component part of a rule. It is a plain string.
@item option
This is the option part of a rule. It is a plain string.
@item flag
This is the flags part of a rule. There may be only one flag per rule
but by using the same component and option, several flags may be
assigned to an option. It is a plain string.
@item value
This is the optional value for the option. It is a percent escaped
string with a single quotation mark to indicate a string. The quotation
mark is only required to distinguish between no value specified and an
empty string.
@end table
@end table
@noindent
Unknown record typs should be ignored. Note that there is intentionally
no feature to change the global option file through @command{gpgconf}.
@mansect files
@node Files used by gpgconf
@subsection Files used by gpgconf
@table @file
@item /etc/gnupg/gpgconf.conf
@cindex gpgconf.conf
If this file exists, it is processed as a global configuration file.
A commented example can be found in the @file{examples} directory of
the distribution.
@end table
@mansect see also
@ifset isman
@command{gpg}(1),
@command{gpgsm}(1),
@command{gpg-agent}(1),
@command{scdaemon}(1),
@command{dirmngr}(1)
@end ifset
@include see-also-note.texi
@c
@c APPLYGNUPGDEFAULTS
@c
@manpage applygnupgdefaults.8
@node applygnupgdefaults
@section Run gpgconf for all users.
@ifset manverb
.B applygnupgdefaults
\- Run gpgconf --apply-defaults for all users.
@end ifset
@mansect synopsis
@ifset manverb
.B applygnupgdefaults
@end ifset
@mansect description
This script is a wrapper around @command{gpgconf} to run it with the
command @code{--apply-defaults} for all real users with an existing
GnuPG home directory. Admins might want to use this script to update he
GnuPG configuration files for all users after
@file{/etc/gnupg/gpgconf.conf} has been changed. This allows to enforce
certain policies for all users. Note, that this is not a bulletproof of
forcing a user to use certain options. A user may always directly edit
the configuration files and bypass gpgconf.
@noindent
@command{applygnupgdefaults} is invoked by root as:
@example
applygnupgdefaults
@end example
@c
@c GPGSM-GENCERT.SH
@c
@node gpgsm-gencert.sh
@section Generate an X.509 certificate request
@manpage gpgsm-gencert.sh.1
@ifset manverb
.B gpgsm-gencert.sh
\- Generate an X.509 certificate request
@end ifset
@mansect synopsis
@ifset manverb
.B gpgsm-gencert.sh
@end ifset
@mansect description
This is a simple tool to interactivly generate a certificate request
which will be printed to stdout.
@manpause
@noindent
@command{gpgsm-gencert.sh} is invoked as:
@samp{gpgsm-cencert.sh}
@mansect see also
@ifset isman
@command{gpgsm}(1),
@command{gpg-agent}(1),
@command{scdaemon}(1)
@end ifset
@include see-also-note.texi
@c
@c GPG-PRESET-PASSPHRASE
@c
@node gpg-preset-passphrase
@section Put a passphrase into the cache.
@manpage gpg-preset-passphrase.1
@ifset manverb
.B gpg-preset-passphrase
\- Put a passphrase into gpg-agent's cache
@end ifset
@mansect synopsis
@ifset manverb
.B gpg-preset-passphrase
.RI [ options ]
.RI [ command ]
.I cache-id
@end ifset
@mansect description
The @command{gpg-preset-passphrase} is a utility to seed the internal
cache of a running @command{gpg-agent} with passphrases. It is mainly
useful for unattended machines, where the usual @command{pinentry} tool
may not be used and the passphrases for the to be used keys are given at
machine startup.
Passphrases set with this utility don't expire unless the
@option{--forget} option is used to explicitly clear them from the cache
--- or @command{gpg-agent} is either restarted or reloaded (by sending a
SIGHUP to it). It is necessary to allow this passphrase presetting by
starting @command{gpg-agent} with the
@option{--allow-preset-passphrase}.
@menu
* Invoking gpg-preset-passphrase:: List of all commands and options.
@end menu
@manpause
@node Invoking gpg-preset-passphrase
@subsection List of all commands and options.
@mancont
@noindent
@command{gpg-preset-passphrase} is invoked this way:
@example
gpg-preset-passphrase [options] [command] @var{cacheid}
@end example
@var{cacheid} is either a 40 character keygrip of hexadecimal
characters identifying the key for which the passphrase should be set
or cleared. The keygrip is listed along with the key when running the
command: @code{gpgsm --dump-secret-keys}. Alternatively an arbitrary
string may be used to identify a passphrase; it is suggested that such
a string is prefixed with the name of the application (e.g
@code{foo:12346}).
@noindent
One of the following command options must be given:
@table @gnupgtabopt
@item --preset
@opindex preset
Preset a passphrase. This is what you usually will
use. @command{gpg-preset-passphrase} will then read the passphrase from
@code{stdin}.
@item --forget
@opindex forget
Flush the passphrase for the given cache ID from the cache.
@end table
@noindent
The following additional options may be used:
@table @gnupgtabopt
@item -v
@itemx --verbose
@opindex verbose
Output additional information while running.
@item -P @var{string}
@itemx --passphrase @var{string}
@opindex passphrase
Instead of reading the passphrase from @code{stdin}, use the supplied
@var{string} as passphrase. Note that this makes the passphrase visible
for other users.
@end table
@mansect see also
@ifset isman
@command{gpg}(1),
@command{gpgsm}(1),
@command{gpg-agent}(1),
@command{scdaemon}(1)
@end ifset
@include see-also-note.texi
@c
@c GPG-CONNECT-AGENT
@c
@node gpg-connect-agent
@section Communicate with a running agent.
@manpage gpg-connect-agent.1
@ifset manverb
.B gpg-connect-agent
\- Communicate with a running agent
@end ifset
@mansect synopsis
@ifset manverb
.B gpg-connect-agent
.RI [ options ] [commands]
@end ifset
@mansect description
The @command{gpg-connect-agent} is a utility to communicate with a
running @command{gpg-agent}. It is useful to check out the commands
gpg-agent provides using the Assuan interface. It might also be useful
for scripting simple applications. Inputis expected at stdin and out
put gets printed to stdout.
It is very similar to running @command{gpg-agent} in server mode; but
here we connect to a running instance.
@menu
* Invoking gpg-connect-agent:: List of all options.
* Controlling gpg-connect-agent:: Control commands.
@end menu
@manpause
@node Invoking gpg-connect-agent
@subsection List of all options.
@noindent
@command{gpg-connect-agent} is invoked this way:
@example
gpg-connect-agent [options] [commands]
@end example
@mancont
@noindent
The following options may be used:
@table @gnupgtabopt
@item -v
@itemx --verbose
@opindex verbose
Output additional information while running.
@item -q
@item --quiet
@opindex q
@opindex quiet
Try to be as quiet as possible.
@include opt-homedir.texi
@item -S
@itemx --raw-socket @var{name}
@opindex S
@opindex raw-socket
Connect to socket @var{name} assuming this is an Assuan style server.
Do not run any special initializations or environment checks. This may
be used to directly connect to any Assuan style socket server.
@item -E
@itemx --exec
@opindex exec
Take the rest of the command line as a program and it's arguments and
execute it as an assuan server. Here is how you would run @command{gpgsm}:
@smallexample
gpg-connect-agent --exec gpgsm --server
@end smallexample
Note that you may not use options on the command line in this case.
@item --no-ext-connect
@opindex no-ext-connect
When using @option{-S} or @option{--exec}, @command{gpg-connect-agent}
connects to the assuan server in extended mode to allow descriptor
passing. This option makes it use the old mode.
@item --run @var{file}
@opindex run
Run the commands from @var{file} at startup and then continue with the
regular input method. Note, that commands given on the command line are
executed after this file.
@item -s
@itemx --subst
@opindex subst
Run the command @code{/subst} at startup.
@item --hex
@opindex hex
Print data lines in a hex format and the ASCII representation of
non-control characters.
@item --decode
@opindex decode
Decode data lines. That is to remove percent escapes but make sure that
a new line always starts with a D and a space.
@end table
@mansect control commands
@node Controlling gpg-connect-agent
@subsection Control commands.
While reading Assuan commands, gpg-agent also allows a few special
commands to control its operation. These control commands all start
with a slash (@code{/}).
@table @code
@item /echo @var{args}
Just print @var{args}.
@item /let @var{name} @var{value}
Set the variable @var{name} to @var{value}. Variables are only
substituted on the input if the @command{/subst} has been used.
Variables are referenced by prefixing the name with a dollr sign and
optionally include the name in curly braces. The rules for a valid name
are identically to those of the standard bourne shell. This is not yet
enforced but may be in the future. When used with curly braces no
leading or trailing white space is allowed.
If a variable is not found, it is searched in the environment and if
found copied to the table of variables.
Variable functions are available: The name of the function must be
followed by at least one space and the at least one argument. The
following functions are available:
@table @code
@item get
Return a value described by the argument. Available arguments are:
@table @code
@item cwd
The current working directory.
@item homedir
The gnupg homedir.
@item sysconfdir
GnuPG's system configuration directory.
@item bindir
GnuPG's binary directory.
@item libdir
GnuPG's library directory.
@item libexecdir
GnuPG's library directory for executable files.
@item datadir
GnuPG's data directory.
@item serverpid
The PID of the current server. Command @command{/serverpid} must
have been given to return a useful value.
@end table
@item unescape @var{args}
Remove C-style escapes from @var{args}. Note that @code{\0} and
@code{\x00} terminate the returned string implicitly. The string to be
converted are the entire arguments right behind the delimiting space of
the function name.
@item unpercent @var{args}
@itemx unpercent+ @var{args}
Remove percent style ecaping from @var{args}. Note that @code{%00}
terminates the string implicitly. The string to be converted are the
entire arguments right behind the delimiting space of the function
name. @code{unpercent+} also maps plus signs to a spaces.
@item percent @var{args}
@itemx percent+ @var{args}
Escape the @var{args} using percent style ecaping. Tabs, formfeeds,
linefeeds, carriage returns and colons are escaped. @code{percent+} also
maps spaces to plus signs.
@item errcode @var{arg}
@itemx errsource @var{arg}
@itemx errstring @var{arg}
Assume @var{arg} is an integer and evaluate it using @code{strtol}. Return
the gpg-error error code, error source or a formatted string with the
error code and error source.
@item +
@itemx -
@itemx *
@itemx /
@itemx %
Evaluate all arguments as long integers using @code{strtol} and apply
this operator. A division by zero yields an empty string.
@item !
@itemx |
@itemx &
Evaluate all arguments as long integers using @code{strtol} and apply
the logical oeprators NOT, OR or AND. The NOT operator works on the
last argument only.
@end table
@item /definq @var{name} @var{var}
Use content of the variable @var{var} for inquiries with @var{name}.
@var{name} may be an asterisk (@code{*}) to match any inquiry.
@item /definqfile @var{name} @var{file}
Use content of @var{file} for inquiries with @var{name}.
@var{name} may be an asterisk (@code{*}) to match any inquiry.
@item /definqprog @var{name} @var{prog}
Run @var{prog} for inquiries matching @var{name} and pass the
entire line to it as command line arguments.
@item /datafile @var{name}
Write all data lines from the server to the file @var{name}. The file
is opened for writing and created if it does not exists. An existsing
file is first truncated to 0. The data written to the file fully
decoded. Using a singel dash for @var{name} writes to stdout. The
file is kept open until a new file is set using this command or this
command is used without an argument.
@item /showdef
Print all definitions
@item /cleardef
Delete all definitions
@item /sendfd @var{file} @var{mode}
Open @var{file} in @var{mode} (which needs to be a valid @code{fopen}
mode string) and send the file descriptor to the server. This is
usually followed by a command like @code{INPUT FD} to set the
input source for other commands.
@item /recvfd
Not yet implemented.
@item /open @var{var} @var{file} [@var{mode}]
Open @var{file} and assign the file descriptor to @var{var}. Warning:
This command is experimental and might change in future versions.
@item /close @var{fd}
Close the file descriptor @var{fd}. Warning: This command is
experimental and might change in future versions.
@item /showopen
Show a list of open files.
@item /serverpid
Send the Assuan command @command{GETINFO pid} to the server and store
the returned PID for internal purposes.
@item /sleep
Sleep for a second.
@item /hex
@itemx /nohex
Same as the command line option @option{--hex}.
@item /decode
@itemx /nodecode
Same as the command line option @option{--decode}.
@item /subst
@itemx /nosubst
Enable and disable variable substitution. It defaults to disabled
unless the command line option @option{--subst} has been used.
If /subst as been enabled once, leading whitespace is removed from
input lines which makes scripts easier to read.
@item /while @var{condition}
@itemx /end
These commands provide a way for executing loops. All lines between the
@code{while} and the corresponding @code{end} are executed as long as
the evaluation of @var{condition} yields a non-zero value. The
evaluation is done by passing @var{condition} to the @code{strtol}
function. Example:
@smallexample
/subst
/let i 3
/while $i
/echo loop couter is $i
/let i $@{- $i 1@}
/end
@end smallexample
@item /run @var{file}
Run commands from @var{file}.
@item /bye
Terminate the connection and the program
@item /help
Print a list of available control commands.
@end table
@ifset isman
@mansect see also
@command{gpg-agent}(1),
@command{scdaemon}(1)
@include see-also-note.texi
@end ifset
@c
@c GPGPARSEMAIL
@c
@node gpgparsemail
@section Parse a mail message into an annotated format
@manpage gpgparsemail.1
@ifset manverb
.B gpgparsemail
\- Parse a mail message into an annotated format
@end ifset
@mansect synopsis
@ifset manverb
.B gpgparsemail
.RI [ options ]
.RI [ file ]
@end ifset
@mansect description
The @command{gpgparsemail} is a utility currently only useful for
debugging. Run it with @code{--help} for usage information.
@c
@c SYMCRYPTRUN
@c
@node symcryptrun
@section Call a simple symmetric encryption tool.
@manpage symcryptrun.1
@ifset manverb
.B symcryptrun
\- Call a simple symmetric encryption tool
@end ifset
@mansect synopsis
@ifset manverb
.B symcryptrun
.B \-\-class
.I class
.B \-\-program
.I program
.B \-\-keyfile
.I keyfile
.RB [ --decrypt | --encrypt ]
.RI [ inputfile ]
@end ifset
@mansect description
Sometimes simple encryption tools are already in use for a long time and
there might be a desire to integrate them into the GnuPG framework. The
protocols and encryption methods might be non-standard or not even
properly documented, so that a full-fledged encryption tool with an
interface like gpg is not doable. @command{symcryptrun} provides a
solution: It operates by calling the external encryption/decryption
module and provides a passphrase for a key using the standard
@command{pinentry} based mechanism through @command{gpg-agent}.
Note, that @command{symcryptrun} is only available if GnuPG has been
configured with @samp{--enable-symcryptrun} at build time.
@menu
* Invoking symcryptrun:: List of all commands and options.
@end menu
@manpause
@node Invoking symcryptrun
@subsection List of all commands and options.
@noindent
@command{symcryptrun} is invoked this way:
@example
symcryptrun --class CLASS --program PROGRAM --keyfile KEYFILE
[--decrypt | --encrypt] [inputfile]
@end example
@mancont
For encryption, the plain text must be provided on STDIN or as the
argument @var{inputfile}, and the ciphertext will be output to STDOUT.
For decryption vice versa.
@var{CLASS} describes the calling conventions of the external tool.
Currently it must be given as @samp{confucius}. @var{PROGRAM} is the
the full filename of that external tool.
For the class @samp{confucius} the option @option{--keyfile} is
required; @var{keyfile} is the name of a file containing the secret key,
which may be protected by a passphrase. For detailed calling
conventions, see the source code.
@noindent
Note, that @command{gpg-agent} must be running before starting
@command{symcryptrun}.
@noindent
The following additional options may be used:
@table @gnupgtabopt
@item -v
@itemx --verbose
@opindex verbose
Output additional information while running.
@item -q
@item --quiet
@opindex q
@opindex quiet
Try to be as quiet as possible.
@include opt-homedir.texi
@item --log-file @var{file}
@opindex log-file
Append all logging output to @var{file}. Default is to write logging
informaton to STDERR.
@end table
@noindent
The possible exit status codes of @command{symcryptrun} are:
@table @code
@item 0
Success.
@item 1
Some error occured.
@item 2
No valid passphrase was provided.
@item 3
The operation was canceled by the user.
@end table
@mansect see also
@ifset isman
@command{gpg}(1),
@command{gpgsm}(1),
@command{gpg-agent}(1),
@end ifset
@include see-also-note.texi
@c
@c GPG-ZIP
@c
@c The original manpage on which this section is based was written
@c by Colin Tuckley <colin@tuckley.org> and Daniel Leidert
@c <daniel.leidert@wgdd.de> for the Debian distribution (but may be used by
@c others).
@manpage gpg-zip.1
@node gpg-zip
@section Encrypt or sign files into an archive
@ifset manverb
.B gpg-zip \- Encrypt or sign files into an archive
@end ifset
@mansect synopsis
@ifset manverb
.B gpg-zip
.RI [ options ]
.I filename1
.I [ filename2, ... ]
.I directory1
.I [ directory2, ... ]
@end ifset
@mansect description
@command{gpg-zip} encrypts or signs files into an archive. It is an
gpg-ized tar using the same format as used by PGP's PGP Zip.
@manpause
@noindent
@command{gpg-zip} is invoked this way:
@example
gpg-zip [options] @var{filename1} [@var{filename2}, ...] @var{directory} [@var{directory2}, ...]
@end example
@mansect options
@noindent
@command{gpg-zip} understands these options:
@table @gnupgtabopt
@item --encrypt
@itemx -e
@opindex encrypt
Encrypt data. This option may be combined with @option{--symmetric} (for output that may be decrypted via a secret key or a passphrase).
@item --decrypt
@itemx -d
@opindex decrypt
Decrypt data.
@item --symmetric
@itemx -c
Encrypt with a symmetric cipher using a passphrase. The default
symmetric cipher used is CAST5, but may be chosen with the
@option{--cipher-algo} option to @command{gpg}.
@item --sign
@itemx -s
Make a signature. See @command{gpg}.
@item --recipient @var{user}
@itemx -r @var{user}
@opindex recipient
Encrypt for user id @var{user}. See @command{gpg}.
@item --local-user @var{user}
@itemx -u @var{user}
@opindex local-user
Use @var{user} as the key to sign with. See @command{gpg}.
@item --list-archive
@opindex list-archive
List the contents of the specified archive.
@item --output @var{file}
@itemx -o @var{file}
@opindex output
Write output to specified file @var{file}.
@item --gpg @var{gpgcmd}
@opindex gpg
Use the specified command @var{gpgcmd} instead of @command{gpg}.
@item --gpg-args @var{args}
@opindex gpg-args
Pass the specified options to @command{gpg}.
@item --tar @var{tarcmd}
@opindex tar
Use the specified command @var{tarcmd} instead of @command{tar}.
@item --tar-args @var{args}
@opindex tar-args
Pass the specified options to @command{tar}.
@item --version
@opindex version
Print version of the program and exit.
@item --help
@opindex help
Display a brief help page and exit.
@end table
@mansect diagnostics
@noindent
The program returns 0 if everything was fine, 1 otherwise.
@mansect examples
@ifclear isman
@noindent
Some examples:
@end ifclear
@noindent
Encrypt the contents of directory @file{mydocs} for user Bob to file
@file{test1}:
@example
gpg-zip --encrypt --output test1 --gpg-args -r Bob mydocs
@end example
@noindent
List the contents of archive @file{test1}:
@example
gpg-zip --list-archive test1
@end example
@mansect see also
@ifset isman
@command{gpg}(1),
@command{tar}(1),
@end ifset
@include see-also-note.texi
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 623ea22e3..cbc4e778e 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,10627 +1,10631 @@
+2009-06-02 Werner Koch <wk@g10code.com>
+
+ * card-util.c (get_manufacturer): Add new manufacturer.
+
2009-05-26 Werner Koch <wk@g10code.com>
* parse-packet.c (mpi_read): Workaround for zero-length MPI bug in
libgcrypt<1.5.0.
2009-05-22 Werner Koch <wk@g10code.com>
* signal.c (got_fatal_signal): Call new function
tty_cleanup_after_signal.
2009-05-20 Werner Koch <wk@g10code.com>
* gpg.c (main): Fix --fingerprint/--with-fingerprint command
detection. Fixes bug#1044.
* keygen.c (ask_keysize): Allow selection of DSA key size even
without --enable-dsa2.
(gen_dsa): Remove size check.
* keygen.c (ask_key_flags): Fix bug in the translation check.
Fixes bug#1056.
2009-05-18 Daiki Ueno <ueno@unixuser.org> (wk)
* encode.c (encode_simple): Tell passphrase_to_dek to cache
the passphrase.
(setup_symkey): Ditto.
* mainproc.c (proc_symkey_enc): Tell passphrase_to_dek to cache
the passphrase.
(proc_encrypted): Ditto.
* passphrase.c (hash_passphrase): Remove arg CREATE.
(passphrase_to_dek): New mode 3 and 4 for caching passphrase for
symmetric encryption.
2009-05-17 Werner Koch <wk@g10code.com>
* keygen.c (ask_algo): Add arg R_SUBKEY_ALGO. Change return value
semantics. Change presented order of algorithms. Make RSA+RSA
the default.
(generate_keypair): Adjust for change.
(ask_keysize): Add arg PRIMARY_KEYSIZE for subkey creation.
Change callers.
2009-05-15 Werner Koch <wk@g10code.com>
* keygen.c (gen_card_key_with_backup): Get the size of the key
from the card.
* call-agent.h (struct agent_card_info_s): Add field KEY_ATTR.
* call-agent.c (learn_status_cb): Support KEY-ATTR.
* card-util.c (card_status): Print key attributes.
2009-05-15 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (gpgconf_list): Remove dead entry "allow-pka-lookup" (a
verify option for a couple of years now).
2009-05-14 Werner Koch <wk@g10code.com>
* call-agent.c (agent_get_passphrase): Add arg CHECK.
* passphrase.c (passphrase_get): Pass new arg.
* keygen.c (gen_card_key_with_backup): Print a status error.
(do_generate_keypair): Ditto.
(do_ask_passphrase): Add arg MODE.
(generate_raw_key): Call with mode 1.
* passphrase.c (ask_passphrase): Remove becuase it is not used.
(passphrase_to_dek): Factor code out to ...
(passphrase_to_dek_ext): .. New. Add args CUSTDESC and CUSTPROMPT.
2009-05-13 Werner Koch <wk@g10code.com>
* keygen.c (parse_expire_string): Base ISO date string at noon.
Also allow full ISO timestamp.
2009-05-11 Werner Koch <wk@g10code.com>
* parse-packet.c (parse_key): Print the key id in list mode.
* skclist.c (build_sk_list): Use log_info for "duplicated entry".
Fixes bug#1045.
* encode.c (encode_simple): Print empty file warning only in
verbose mode. Closes bug#1039.
(encode_crypt): Ditto.
* sign.c (write_plaintext_packet): Ditto.
2009-05-10 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_typemap): gpgkeys_hkp handles hkps as
well. From 1.4.
2009-05-06 Werner Koch <wk@g10code.com>
* getkey.c (finish_lookup): Remove dead code.
* keyring.c (keyring_get_keyblock): Fix memory leak due to ring
trust packets. Fixes bug#1034.
2009-04-03 Werner Koch <wk@g10code.com>
* gpgv.c (main): Open keyrings readonly.
* keydb.c (keydb_add_resource): Add readonly flag bit.
(keydb_rebuild_caches): Don't act on readonly resources.
* keyring.c (keyring_register_filename): Add arg READONLY.
(struct keyring_name): Add field READONLY.
(keyring_is_writable): Implement readonly feature.
(keyring_update_keyblock): Return GPG_ERR_EACCES for readonly
keyrings.
(keyring_insert_keyblock, keyring_delete_keyblock):
2009-04-01 Werner Koch <wk@g10code.com>
* gpg.c (main): Properly handle UTF8 usernames with --sign-key and
--lsign-key. From 1.4, David 2008-12-21.
2009-03-20 David Shaw <dshaw@jabberwocky.com> (wk)
* keyring.c (rename_tmp_file): Force a fsync (via iobuf_ioctl) on
secret keyring files to be extra safe on filesystems that may not
sync data and metadata together (ext4). Also check return code
from the cache invalidation to make sure we're safe over NFS and
similar.
2009-03-31 Werner Koch <wk@g10code.com>
* passphrase.c (ask_passphrase): Use percent_plus_unescape.
* misc.c (unescape_percent_string): Remove.
* call-agent.c (unescape_status_string): Chnage to use
percent_plus_unescape.
2009-03-25 Werner Koch <wk@g10code.com>
* mainproc.c (print_pkenc_list): Use snprintf.
2009-03-17 Werner Koch <wk@g10code.com>
* call-agent.c (my_percent_plus_escape): Remove.
(agent_get_passphrase): Rewrite using percent_plus_escape.
2009-03-17 Daiki Ueno <ueno@unixuser.org>
* passphrase.c (passphrase_get): Add extra arg REPEAT and adjust
callers; remove special treatment for MODE==2.
(passphrase_to_dek): Move --passphrase-repeat handling to
gpg-agent.
* call-agent.c (agent_get_passphrase): Add extra arg REPEAT.
* call-agent.h: Ditto.
2009-03-16 Werner Koch <wk@g10code.com>
* gpg.c (my_strusage): Revert last change. Systems w/o a gpg1 may,
and actually do, install gpg2 as gpg.
* gpgv.c (my_strusage): Ditto.
2009-03-14 David Shaw <dshaw@jabberwocky.com>
* gpg.c (my_strusage): gpg2 and gpgv2 (not gpg and gpgv).
* gpgv.c (my_strusage): Same.
* gpgv.c (my_strusage): Fix name of program in "Syntax" line.
2009-02-27 Werner Koch <wk@g10code.com>
* call-agent.c (agent_scd_pksign, agent_scd_pkdecrypt): First send
the SERIALNO command.
2009-02-24 Werner Koch <wk@g10code.com>
* pkglue.c (pk_verify): Return an error for improper DATA instead
of calling BUG().
2009-02-09 Werner Koch <wk@g10code.com>
* keylist.c (print_capabilities): Take care of cert-only keys.
Fixes bug#998.
* keyedit.c (show_key_with_all_names_colon): Print the capabilities.
2009-01-26 Werner Koch <wk@g10code.com>
* card-util.c (card_status): Detect a Geldkarte.
2009-01-13 Werner Koch <wk@g10code.com>
* call-agent.c (dummy_data_cb): New.
(agent_learn): Use it.
* card-util.c (card_status): Print type of non-OpenPGP card.
* call-agent.h (agent_card_info_s): Add field APPTYPE.
2009-01-12 Werner Koch <wk@g10code.com>
* getkey.c (finish_lookup): Take care of keys with a zero
timestamp. Reported by Peter Gutmann.
2009-01-08 Werner Koch <wk@g10code.com>
* misc.c (has_invalid_email_chars): Let non-ascii pass through.
* cpr.c [USE_SHM_COPROCESSING]: Remove this code.
2008-12-12 Werner Koch <wk@g10code.com>
* passphrase.c (passphrase_get): Write a STATUS_ERROR.
* cpr.c (write_status_error): New.
* Makefile.am (common_source): Add rmd160.h.
2008-12-11 Werner Koch <wk@g10code.com>
* sig-check.c (signature_check2): Change algorithm used to compute
the SIG_ID.
(check_revocation_keys): Close message digest.
* rmd160.c, rmd160.h: New. Based on code from GnuPG-1.4.
* t-rmd160.c: New.
* Makefile.am: Add support to run tests.
* keyid.c (namehash_from_uid): Use rmd160_hash_buffer.
2008-12-10 Werner Koch <wk@g10code.com>
* trustdb.h (NAMEHASH_HASH): Remove unsued constant.
* gpg.c (print_mds): Print RMD160 only is enabled.
* keygen.c (keygen_set_std_prefs): Include RMD160 only if
available.
2008-12-09 Werner Koch <wk@g10code.com>
* gpg.c (main) [IS_DEVELOPMENT_VERSION]: Fix strusage use.
2008-12-09 Werner Koch <wk@g10code.com>
* keygen.c (proc_parameter_file): Check that key and subkey usages
are allowed.
2008-12-09 David Shaw <dshaw@jabberwocky.com> (wk)
* trustdb.c (validate_one_keyblock): Fix the trust signature
calculations so that we lower the trust depth of signatures to fit
within the current chain, rather than discarding any signature
that does not fit within the trust depth.
2008-12-09 Werner Koch <wk@g10code.com>
* keyserver.c (show_prompt): Flush stdout.
* gpg.c (open_info_file): Add arg BINARY and adjust callers.
* gpg.c (main): Call i18n_init before init_common_subsystems.
* gpgv.c (main): Ditto.
* keylist.c (set_attrib_fd): Do not close ATTRIB_FP if it is the
log stream.
(set_attrib_fd) [W32]: Set to binary mode.
(dump_attribs): Flush the stream after writing.
2008-12-05 Werner Koch <wk@g10code.com>
* call-agent.c (percent_plus_escape): Rename to
my_percent_plus_escape and also escape the percent character.
Change all callers.
2008-11-18 Werner Koch <wk@g10code.com>
* gpg.c (build_lib_list): Remove.
(make_libversion): New.
(my_strusage): Use it.
* gpgv.c (make_libversion): New.
(my_strusage): Print libgcrypt version.
2008-11-13 Werner Koch <wk@g10code.com>
* gpgv.c: Use new ARGPARSE macros and re-indent.
2008-11-11 Werner Koch <wk@g10code.com>
* gpg.c (opts): Use new ARGPARSE macros for clarity.
2008-10-24 Werner Koch <wk@g10code.com>
* keyedit.c (change_passphrase): Clear passphrase cache.
2008-10-20 Werner Koch <wk@g10code.com>
* gpgv.c: Mark all args of the stub fucntions as unused.
* card-util.c (generate_card_keys): Remove unused arg SERIALNO and
adjust caller.
* build-packet.c (write_sign_packet_header): Mark unused arg.
* gpg.c (gpg_init_default_ctrl, gpg_deinit_default_ctrl): Ditto.
* getkey.c (skip_unusable): Ditto.
(write_version): Ditto.
* keydb.c (keydb_locate_writable): Ditto.
* keyring.c (update_offset_hash_table): Ditto.
(keyring_lock): Ditto.
* misc.c (register_secured_file): Ditto.
(unregister_secured_file): Ditto.
(is_secured_file): Ditto.
(is_secured_filename): Ditto.
* parse-packet.c (parse_marker): Ditto.
(parse_key, parse_attribute): Ditto.
(parse_trust, parse_compressed, parse_mdc, parse_gpg_control): Ditto.
* cpr.c (progress_cb): Ditto.
* passphrase.c (passphrase_clear_cache): Ditto.
(ask_passphrase): Ditto.
* keyedit.c (keyedit_completion): Ditto.
* import.c (import_revoke_cert): Ditto.
(chk_self_sigs, delete_inv_parts, append_uid): Ditto.
(merge_sigs, merge_keysigs, append_key): Ditto.
* trustdb.c (list_trust_path): Ditto.
(enum_cert_paths, enum_cert_paths_print): Ditto.
* tdbdump.c (list_trustdb): Ditto.
* keygen.c (keygen_upd_std_prefs): Ditto.
(genhelp_factors): Ditto.
* call-agent.c (agent_scd_setattr): Ditto.
(agent_scd_writekey, agent_scd_change_pin, agent_scd_genkey): Ditto.
(agent_clear_pin_cache): Ditto.
* server.c (option_handler): Mark non yet used arg.
(input_notify, output_notify): Ditto.
(cmd_recipient, cmd_signer, cmd_encrypt, cmd_decrypt, cmd_verify)
(cmd_sign, cmd_import, cmd_export, cmd_delkeys, do_listkeys)
(cmd_genkey): Ditto.
* verify.c (gpg_verify): Ditto.
2008-10-17 Werner Koch <wk@g10code.com>
* main.h (idea_cipher_warn): Use do while construct in place of an
empty definition.
2008-10-03 David Shaw <dshaw@jabberwocky.com>
* main.h, mainproc.c (check_sig_and_print)
* keylist.c (list_keyblock_print)
* pkclist.c (do_edit_ownertrust)
* keyedit.c (menu_showphoto)
* photoid.c (generate_photo_id, show_photos)
* misc.c (pct_expando): Add %v and %V expandos so
that displaying photo IDs can show the attribute validity
tag (%v) and string (%V). Originally by Daniel Gillmor.
2008-09-29 Werner Koch <wk@g10code.com>
* gpg.c (main): Remove -sat kludge. Note that we printed a
warning for two years.
* seskey.c (encode_md_value): Remove extra gcry_md_test_algo since
it is not needed with Libgcrypt 1.4.
* skclist.c (random_is_faked): Simplify.
* sign.c (match_dsa_hash): Remove runtime check for SHA224.
* gpg.c (print_mds): Use GCRY_MD_SHA224 constant.
2008-09-25 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (keyedit_menu): Fix bug where a modified keyring loses
its modified status after a "clean" or "minimize" that doesn't
need to do anything.
2008-09-25 Werner Koch <wk@g10code.com>
* parse-packet.c (parse): Remove special treatment for compressed
new style packets. Fixes bug#931.
* card-util.c (change_pin): Support setting of the reset code.
2008-09-24 Werner Koch <wk@g10code.com>
* call-agent.h (struct agent_card_info_s): Add field IS_V2.
* call-agent.c (learn_status_cb): That that field.
* card-util.c (change_pin): Rename first arg to UNBLOCK_v2 and use
it this way.
(card_edit): Add new command UNBLOCK.
2008-09-23 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (select_algo_from_prefs): Redo function to rank prefs
and pick a consensus winner across all keys.
2008-09-16 Werner Koch <wk@g10code.com>
* card-util.c (fpr_is_ff): New.
(card_status): Do not print general key info for an all-ff fpr.
(change_login, change_private_do): Factor common code out to ...
(get_data_from_file): .. new.
(change_cert): New.
(card_edit): Add command "writecert".
* call-agent.c (writecert_parm_s): New.
(inq_writecert_parms, agent_scd_writecert): New.
2008-09-04 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_import_cert): Allow keyserver URLs in
addition to full URLs in CERT records.
2008-08-11 Werner Koch <wk@g10code.com>
* keygen.c (ask_expire_interval): Check for time overflow of an
u32. Fixes bug #947.
2008-08-01 Werner Koch <wk@g10code.com>
* tdbio.c (open_db) [!EROFS]: Move closing parens out of the
ifdef. Reported by Ken Takusagawa.
2008-06-25 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (enum cmd_and_opt_values): Remove option
oEnableW32HandleTranslation.
(opts): Remove option --enable-w32-handle-translation.
(main): Remove variable w32_handle_translation.
2008-06-19 Werner Koch <wk@g10code.com>
* gpg.c (gpgconf_list): Add "group".
2008-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (enum cmd_and_opt_values): New option
oEnableW32HandleTranslation.
(opts): New option --enable-w32-handle-translation.
(main): New variable w32_handle_translation to keep track of
option.
2008-06-16 Werner Koch <wk@g10code.com>
* keygen.c (output_control_s): Add ASK_PASSPHRASE.
(read_parameter_file): Add commands %ask-passphrase and
%no-ask-passphrase.
2008-06-11 Werner Koch <wk@g10code.com>
* gpg.c: Make --fixed-list-mode a dummy.
* options.h (struct): Removed FIXED_LIST_MODE.
* keyid.c (colon_strtime, colon_datestr_from_pk)
(colon_datestr_from_sk, colon_datestr_from_sig)
(colon_expirestr_from_sig): Remove fixed_list_mode case.
* keylist.c (list_keyblock_colon): Ditto. Remove all now unsed
code and reindent.
2008-05-31 Werner Koch <wk@g10code.com>
* keygen.c (ask_user_id): Change the string printed as header of
the user ID generation. Use code to not break existing
translations. Suggested by Eric Tetz.
2008-05-08 Werner Koch <wk@g10code.com>
* sig-check.c (do_check_messages): Print a revocation diagnostic
in verbose mode.
2008-05-07 Werner Koch <wk@g10code.com>
* gpg.c: New command --locate-keys. New options --with-sig-list
and --with-sig-check.
* keylist.c (locate_one): New.
(public_key_list): Add arg LOCATE_MODE and use locate_one.
* getkey.c (get_pubkey_byname): Fix nodefault case. Add option
RETCTX, change all callers.
(struct getkey_ctx_s): Add field extra_ptr;
(get_pubkey_end): Free it.
2008-04-18 Werner Koch <wk@g10code.com>
* misc.c (map_cipher_openpgp_to_gcry, map_cipher_gcry_to_openpgp)
(openpgp_cipher_test_algo): Add camellia-192.
(openpgp_cipher_blocklen): New.
* parse-packet.c (parse_key): Use new function here.
2008-04-15 David Shaw <dshaw@jabberwocky.com>
* getkey.c (merge_selfsigs_subkey): If there are multiple 0x19
backsigs, take the most recent one.
2008-04-08 Werner Koch <wk@g10code.com>
* options.h (opt): Add AKL_NODEFAULT and AKL_LOCAL.
* getkey.c (parse_auto_key_locate): Parse them.
(get_pubkey_byname): Implement them. Add arg NO_AKL and use that
in all cases where a local key is expected.
* import.c (import_one): Fill in the fingerprint in all cases.
Use log_get_stream.
* keyserver.c (keyserver_import_pka): Set FPR to NULL on error.
Return G10ERR_NO_PUBKEY if no PKA info is available or no key URI
is given in the PKA record..
(keyserver_import_cert): Return G10ERR_NO_PUBKEY if a CERT record
was not found.
* getkey.c (get_pubkey_byname): Release FPR in the error case.
Continue with next mechanism on error. Better diagnostics.
2008-04-07 Werner Koch <wk@g10code.com>
* keyserver.c (parse_keyserver_uri): Allow a default host name.
* getkey.c (get_pubkey_byname): Replace sprintf by bin2hex.
2008-04-02 Werner Koch <wk@g10code.com>
* gpg.c (main): Do not allow DSA2 with a too old Libgcrypt.
2008-03-26 Werner Koch <wk@g10code.com>
* tdbio.c (lookup_hashtable): Make cmp args const.
(cmp_trec_fpr): Make FPR const.
(tdbio_search_trust_byfpr): Remove cast.
2008-03-25 Werner Koch <wk@g10code.com>
* keyserver.c (parse_keyrec): Take care of char defaulting to
unsigned when using hextobyte.
2008-03-25 David Shaw <dshaw@jabberwocky.com> (wk)
* import.c (collapse_uids): Fix bug 894: possible memory
corruption around deduplication of user IDs.
2008-03-25 Werner Koch <wk@g10code.com>
* parse-packet.c (parse_key): Parse a secret key encrypted with
Camellia.
* options.skel: Make the default keyserver keys.gnupg.net.
2008-03-18 Werner Koch <wk@g10code.com>
* seckey-cert.c (do_check): Use GCRYMPI_FMT_PGP for v3 keys.
Reported by Petr Cerny.
2008-03-13 Werner Koch <wk@g10code.com>
* passphrase.c (PROMPTSTRING): Change string to me more similar to
the X.509 prompt.
2008-02-26 Werner Koch <wk@g10code.com>
* getkey.c (get_pubkey_byname): Fix comment.
2008-02-14 Werner Koch <wk@g10code.com>
* call-agent.c (default_inq_cb): New.
(agent_learn, agent_scd_getattr, agent_scd_pksign)
(agent_scd_pkdecrypt, agent_scd_change_pin, agent_scd_checkpin)
(agent_get_passphrase, agent_clear_passphrase): Use new callback.
(inq_writekey_parms): Fall back to the new callback for other
inquiries.
(start_agent): Tell agent that we accept pinentry notifications.
2008-02-11 Werner Koch <wk@g10code.com>
* server.c (cmd_getinfo): New.
(register_commands): Register GETINFO.
2008-02-09 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (main): New variable default_configname. Use it if
save_configname is NULL (can happen if default configfile does
not exist). Move default configname determination to ...
(get_default_configname): ... this new function.
2008-01-30 Werner Koch <wk@g10code.com>
* keydb.c (maybe_create_keyring): Fixed last change.
* tdbio.c (tdbio_set_dbname): Also test for forward slash.
2008-01-29 Werner Koch <wk@g10code.com>
* keydb.c (maybe_create_keyring): Take care of a missing slash.
(maybe_create_keyring) [W32]: Also test for forward slash.
2008-01-26 Werner Koch <wk@g10code.com>
* card-util.c (get_manufacturer): Add vendor 0004.
2008-01-02 Werner Koch <wk@g10code.com>
* gpg.c: Add --logger-file as an alias for log-file.
2007-12-14 Werner Koch <wk@g10code.com>
* gpg.c (main): Set opt.no_homedir_creation during the first option
parsing pass.
2007-12-12 Werner Koch <wk@g10code.com>
* misc.c (print_pubkey_algo_note): Print a warning if a type 20
key is used.
(openpgp_pk_test_algo, openpgp_pk_test_algo2)
(openpgp_pk_algo_usage): Allow type 20 keys only in rfc2440 mode.
2007-12-12 David Shaw <dshaw@jabberwocky.com> (wk)
* trustdb.c (sanitize_regexp): New. Protect against dangerous
regexps (malloc bombs) by force-commenting any characters aside
from the ones we explicitly want.
(check_regexp): Use it here before passing the regexp to
regcomp().
2007-12-12 Werner Koch <wk@g10code.com>
* misc.c (map_cipher_openpgp_to_gcry): New. Used to map Camellia
algorithms to Gcrypt.
(openpgp_cipher_test_algo): Call new map function. Replace
all remaining calls to gcry_cipher_test_algo by a call to this.
(openpgp_cipher_algo_name): New. Replace all remaining calls to
gcry_cipher_algo_name by a call to this.
(map_cipher_gcry_to_openpgp): New.
(string_to_cipher_algo): Use it.
* gpg.c (main): Print a warning if Camellia support is build in.
* gpg.c (print_algo_names): New. From the 1.4 branch by David.
(list_config): Use it here for the "ciphername" and "digestname"
config items so we can get a script-parseable list of the names.
* parse-packet.c (parse_onepass_sig): Sigclass is hex, so include
the 0x.
* sign.c (match_dsa_hash): Remove conditional builds dending on
USE_SHAxxx. We don't need this becuase it can be expected that
libgcrypt provides it. However we need to runtime test for SHA244
becuase that is only available with libgcrypt 2.4.
2007-12-11 Werner Koch <wk@g10code.com>
* mainproc.c (proc_pubkey_enc): Allow type 20 Elgamal key for
decryption.
2007-12-10 Werner Koch <wk@g10code.com>
* import.c (auto_create_card_key_stub): Do not clear the entire
fingerprint. This finally makes the stub creation work. My past
tests seemed to work because there was a key with a all zero
fingerprint available (Elgamal signing keys).
2007-12-08 Werner Koch <wk@g10code.com>
* misc.c (openpgp_pk_algo_usage): Allow Elgamal type 20 for
encryption.
2007-12-04 Werner Koch <wk@g10code.com>
* helptext.c (get_help_from_file): New.
(display_online_help): Use it to geting the help through a file.
(helptexts): Remove.
2007-12-03 Werner Koch <wk@g10code.com>
* keygen.c (ask_key_flags): Add a translation remark and implement
a workaround.
* gpg.c (reopen_std): Moved to ../common and renamed to
gnupg_reopen_std.
* gpg.c: Remove second inclusion of fcntl.h.
2007-11-19 Werner Koch <wk@g10code.com>
* keyedit.c (keyedit_menu): String grammar fix.
2007-11-15 Werner Koch <wk@g10code.com>
* gpg.c (main): New option --xauthority.
* call-agent.c (start_agent): Adjust changed start_new_gpg_agent.
2007-11-12 Werner Koch <wk@g10code.com>
* cpr.c (do_get_from_fd): s/bool/getbool/ to overcome problems
with Mac OS 10.5 which seems to include stdbool.h silently.
2007-11-07 Werner Koch <wk@g10code.com>
Replace all includes of errors.h by status.h (found in common/).
* status.h: Remove.
* status.h: Move prototypes to main.h.
* status.c: Rename to ..
* cpr.c: .. this.
(get_status_string): Remove. We take this now from common/.
2007-10-25 David Shaw <dshaw@jabberwocky.com> (wk)
From 1.4 (October):
* gpg.c (main): Add --require-cross-certification to
--openpgp/--rfc4880 mode.
* gpg.c (main): Disable --rfc2440-text and --force-v3-sigs by
default. Enable --require-cross-certification by default.
--openpgp (--rfc4880) is the same as --rfc2440 except with
"--enable-dsa2 --no-rfc2440-text --escape-from-lines".
* misc.c (compliance_option_string, compliance_failure): Minor
cleanup.
* armor.c (is_armor_header): Comment about 4880.
* options.h, gpg.c (main): Add --rfc4880, and make --openpgp an
alias to it. --rfc2440 now stands alone. For now, use the old
2440 defaults for 4880.
* misc.c (compliance_option_string): Ditto.
* keyedit.c (keyedit_menu): Use compliance_option_string() instead
of printing the compliance modes here.
2007-10-25 David Shaw <dshaw@jabberwocky.com> (wk)
From 1.4 (September):
* import.c (collapse_uids): Significant speedup for de-duping user
IDs.
2007-10-25 David Shaw <dshaw@jabberwocky.com> (wk)
From 1.4 (July):
* armor.c (parse_header_line): Improve test so that the header
test only allows "Hash" in the signed data section.
* armor.c (is_armor_tag): New. Detect if an armor header matches
2440bis-21.
(parse_header_line): Call it here, as bis-21 requires warning the
user (but continuing to process the message) when seeing an
unknown header.
* encode.c (encode_crypt): Missed one call to
setup_plaintext_name(). This is bug#809.
* sign.c (mk_notation_policy_etc): Expect all sigs that this is
called for are >=v4.
(write_signature_packets, make_keysig_packet): Only call it for
>=v4 sigs. This allows --force-v3-sigs and --force-v4-certs to
enable or disable notations, policies, and keyserver URLs. This
is bug#800.
2007-10-19 Werner Koch <wk@g10code.com>
* passphrase.c (passphrase_get): Use new utf8 switching fucntions.
2007-09-14 Werner Koch <wk@g10code.com>
* gpg.c (build_lib_list): New.
(my_strusage): Print lib info.
2007-08-27 Werner Koch <wk@g10code.com>
* trustdb.c (USE_INTERNAL_REGEX): Remove support.
2007-08-24 Werner Koch <wk@g10code.com>
* keyring.c (keyring_register_filename): Use same_file_p().
2007-08-21 Werner Koch <wk@g10code.com>
* misc.c (openpgp_md_test_algo): Remove rfc2440bis hash algorithms.
(openpgp_cipher_test_algo): Likewise for algos 5 and 6.
2007-08-02 Werner Koch <wk@g10code.com>
* gpg.c: Include gc-opt-flags.h and remove their definition here.
2007-07-17 Werner Koch <wk@g10code.com>
* gpg.c (gpgconf_list): Declare --encrypt-to and --default-key.
* card-util.c (get_manufacturer): Add the unmanaged S/N range.
2007-07-12 Werner Koch <wk@g10code.com>
* gpg.c (main): Use translate_sys2libc_fd_int when passing an int
value.
* gpgv.c (main): Ditto.
2007-07-05 Werner Koch <wk@g10code.com>
* card-util.c (card_generate_subkey, card_store_subkey): Enable
the code also for GnuPG-2.
* keygen.c (make_backsig): Add arg TIMESTAMP.
(write_keybinding): Add arg TIMESTAMP, pass it to make_backsig.
(write_direct_sig, write_selfsigs): Add arg TIMESTAMP.
(gen_elg, gen_dsa, gen_rsa): Add arg TIMESTAMP.
(do_create): Ditto.
(do_generate_keypair): Use the same timestamp for key creation
time and all key signatures. Return an error if write_direct_sig
for the secret key fails.
(generate_subkeypair): Ditto.
(gen_card_key): New arg TIMESTAMP.
(generate_card_subkeypair): Pass current time to gen_card_key.
(gen_card_key_with_backup): New arg TIMESTAMP.
(read_parameter_file): Add option Creation-Date.
(parse_creation_string): New.
(do_generate_keypair): Use the Creation-Date if available.
(save_unprotected_key_to_card): Use P for P and not D.
* call-agent.c (agent_scd_genkey): Add arg CREATETIME.
* keyedit.c (menu_backsign): Use the same timestamp for all backsigs.
2007-06-26 Werner Koch <wk@g10code.com>
* openfile.c (try_make_homedir): Support W32; use standard_homedir.
2007-06-25 Werner Koch <wk@g10code.com>
* gpg.c, gpgv.c: Include sysutils.h.
(main): Replace iobuf_translate_file_handle by
translate_sys2libc_fd.
2007-06-21 Werner Koch <wk@g10code.com>
* main.h: Include util.h.
* call-agent.c (start_agent): Factored almost all code out to
../common/asshelp.c.
* gpg.h (ctrl_t): Remove. It is now declared in ../common/util.h.
2007-06-20 Werner Koch <wk@g10code.com>
* misc.c (setsysinfo, trap_unaligned): Remove. It is also in
common/sysutils.c.
(disable_core_dumps, get_session_marker):
* sign.c (sleep): Remove sleep wrapper.
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpg.c (gpgconf_list): Percent escape output of --gpgconf-list.
2007-06-14 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Use gnupg_module_name.
2007-06-12 Werner Koch <wk@g10code.com>
* openfile.c (copy_options_file): Use gnupg_datadir.
* misc.c (get_libexecdir): Remove. Changed all callers to use
gnupg_libexecdir.
* gpg.c (check_permissions): Use gnupg_libdir.
* gpg.c (main): Replace some calls by init_common_subsystems.
* gpgv.c (main): Ditto.
2007-06-11 Werner Koch <wk@g10code.com>
* Makefile.am (needed_libs): Use libcommonstd macro.
* gpgv.c (main) [W32]: Call pth_init.
* gpg.c (main) [W32]: Call pth_init.
2007-06-08 Werner Koch <wk@g10code.com>
* Makefile.am (gpg2_LDADD): Syntax fix.
2007-06-06 Werner Koch <wk@g10code.com>
* passphrase.c (passphrase_get) [!ENABLE_NLS]: Do not define
orig_codeset.
* Makefile.am (gpgv2_LDADD, gpg2_LDADD): Include LDADD before
libgcrypt.
* plaintext.c (handle_plaintext): Replace eof by eof_seen as W32's
io.h has a symbol with that name.
* misc.c: Do not include dynload.h.
(w32_shgetfolderpath): Remove. It is now in common/homedir.c.
* gpgv.c (i18n_init): Remove.
* gpg.c (i18n_init): Remove.
(main): Make --load-extension a dummy
2007-05-19 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (passphrase_get): Use PACKAGE_GT, not PACKAGE.
* passphrase.c (passphrase_get): Free ORIG_CODESET on error.
2007-05-16 Werner Koch <wk@g10code.com>
* sig-check.c (check_backsig): Check the digest algorithm before
using it. Fixed bug 797.
2007-05-09 Werner Koch <wk@g10code.com>
* openfile.c (overwrite_filep, open_outfile) [W32]: Need to use
just "nul". Though, I am pretty sure that some MSDOS versions
grok the extra /dev/.
2007-05-07 Werner Koch <wk@g10code.com>
* openfile.c (open_outfile, overwrite_filep) [W32]: Use "/dev/nul".
2007-05-02 David Shaw <dshaw@jabberwocky.com>
* packet.h, mainproc.c (reset_literals_seen): New function to
reset the literals count.
* verify.c (verify_one_file), decrypt.c (decrypt_messages): Call
it here so we allow multiple literals in --multifile mode (in
different files - not concatenated together).
2007-04-26 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (passphrase_to_dek): Write missing passphrase
status message in case of cancellation.
2007-04-16 Werner Koch <wk@g10code.com>
* build-packet.c (mpi_write): Made buffer a bit larger. Reported
by Alexander Feigl.
2007-04-13 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Don't use log_error when using the
fallback hack to start the agent. This is bug 782.
2007-04-05 David Shaw <dshaw@jabberwocky.com>
From STABLE-BRANCH-1-4
* parse-packet.c (parse_marker): New. Enforce that the marker
contains 'P', 'G', 'P', and nothing but.
(parse): Call it here.
(skip_packet): No longer need to handle marker packets here.
2007-03-14 David Shaw <dshaw@jabberwocky.com>
From STABLE-BRANCH-1-4
* keyserver.c: Windows Vista doesn't grok X_OK and so fails
access() tests. Previous versions interpreted X_OK as F_OK
anyway, so we'll just use F_OK directly.
2007-03-09 David Shaw <dshaw@jabberwocky.com>
From STABLE-BRANCH-1-4
* parse-packet.c (parse_signature): It's hex.
* getkey.c (merge_selfsigs_subkey): Avoid listing the contents of
a backsig when list mode is on. Noted by Timo Schulz.
2007-03-08 Werner Koch <wk@g10code.com>
* plaintext.c (handle_plaintext): Add two extra fflush for stdout.
2007-03-08 David Shaw <dshaw@jabberwocky.com> (wk)
* keyedit.c (keyedit_menu): If we modify the keyblock (via
fix_keyblock() or collapse_uids()) make sure we reprocess the
keyblock so the flags are correct. Noted by Robin H. Johnson.
* getkey.c (fixup_uidnode): Properly clear flags that don't apply
to us (revoked, expired) so that we can reprocess a uid.
2007-03-05 Werner Koch <wk@g10code.com>
Converted this file to UTF-8.
Ported David and my multiple messages changes from 1.4.7.
* options.h, gpg.c (main), mainproc.c (check_sig_and_print): Allow
multiple sig verification again as this is protected via the
multiple-messages code. New option --allow-multiple-messages and
--no variant.
* status.h (STATUS_ERROR): New status code.
* status.c (get_status_string): Ditto.
* mainproc.c (proc_plaintext): Emit it if multiple messages are
detected. Error out if more than one plaintext packet is
encountered.
* mainproc.c (literals_seen): New.
2007-02-26 Werner Koch <wk@g10code.com>
* gpg.c (main): Add verify option show-primary-uid-only.
* options.h (VERIFY_SHOW_PRIMARY_UID_ONLY): New.
* mainproc.c (check_sig_and_print): Implement it.
2007-02-22 Werner Koch <wk@g10code.com>
* encr-data.c (decrypt_data): Correctly test for unknown algorithm.
* import.c (check_prefs): Ditto.
* keyedit.c (show_prefs): Ditto.
* mainproc.c (proc_symkey_enc): Ditto.
2007-02-06 Werner Koch <wk@g10code.com>
* export.c (do_export_stream): Allow reset-subkey-passwd along
with sexp-format.
2007-02-04 Werner Koch <wk@g10code.com>
* parse-packet.c (parse_signature): Limit bytes read for an
unknown alogorithm. Fixes Debian bug#402592.
2007-01-31 Werner Koch <wk@g10code.com>
* verify.c (verify_signatures): Do no dereference a NULL afx.
* passphrase.c (passphrase_get): Set the cancel flag on all error
from the agent. Fixes a bug reported by Tom Duerbusch.
2007-01-30 Werner Koch <wk@g10code.com>
* 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.
2007-01-29 Werner Koch <wk@g10code.com>
* pkclist.c (do_we_trust_pre): Issue a user-id-hint status code.
2007-01-15 Werner Koch <wk@g10code.com>
* parse-packet.c (read_protected_v3_mpi): Make sure to stop
reading even for corrupted packets.
* keygen.c (generate_user_id): Need to allocate one byte more.
Reported by Felix von Leitner.
2006-12-21 Werner Koch <wk@g10code.com>
* gpg.c (main): New command --server.
* gpg.h (struct server_control_s, ctrl_t): New.
* server.c: New.
* verify.c (gpg_verify): New.
* mainproc.c (mainproc_context): Made SIGNED_DATA a structure.
(proc_signature_packets_by_fd): New.
(proc_compressed_cb): Divert depending on SIGNED_DATA.
* plaintext.c (hash_datafile_by_fd): New.
* mainproc.c (proc_tree): Use it here.
* verify.c (verify_signatures): Init AFX only when needed.
Don't leak a context on error.
(verify_one_file): Don't leak a context on error.
2006-12-07 Werner Koch <wk@g10code.com>
* openfile.c (copy_options_file): Use log_info instead of
log_error to avoid an error return of gpg due to a missing
skeleton file.
2006-12-07 David Shaw <dshaw@jabberwocky.com>
* Makefile.am: Link to iconv for jnlib dependency.
2006-12-05 Werner Koch <wk@g10code.com>
* passphrase.c (passphrase_to_dek): Handle a Cancel request
correctly. [Bug#737]
* mainproc.c (proc_symkey_enc): Removed workaround for bogus cancel
processing.
* encode.c (encode_simple): Distinguish error message between
cancel and invalid passphrase.
(setup_symkey): Ditto.
* sign.c (sign_symencrypt_file): Ditto
* keyedit.c (change_passphrase): Allow cancellation.
* keygen.c (do_ask_passphrase): New arg R_CANCELED.
(generate_keypair): Handle a passphrase cancellation.
(generate_raw_key): Ditto.
(generate_subkeypair): Ditto.
2006-12-04 Werner Koch <wk@g10code.com>
* filter.h (armor_filter_context_t): New element REFCOUNT.
* armor.c (armor_filter): Made static.
(push_armor_filter, release_armor_context, new_armor_context): New.
(armor_filter): Release the context.
* gpg.c (main): Use new armor context functions and
push_armor_filter.
* export.c (do_export): Ditto.
* encode.c (encode_simple, encode_crypt): Ditto.
* decrypt.c (decrypt_message, decrypt_messages): Ditto.
* dearmor.c (dearmor_file, enarmor_file): Ditto.
* verify.c (verify_signatures, verify_one_file): Ditto.
* sign.c (sign_file, clearsign_file, sign_symencrypt_file): Ditto.
* revoke.c (gen_desig_revoke, gen_revoke): Ditto.
* keyserver.c (keyserver_spawn): Ditto.
* keygen.c (output_control_s): Turn AFX fields into pointers.
(read_parameter_file): Allocate and release AFX fields.
(do_generate_keypair): Use push_armor_filter.
* import.c (import): Replace iobuf_push_filter2 hack by the new
armor context stuff.
2006-12-03 Werner Koch <wk@g10code.com>
* filter.h: New element REFCOUNT.
(handle_progress): Remove prototype.
* progress.c (new_progress_context, release_progress_context): New.
(progress_filter): Use new function to release context. Made static.
(handle_progress): Bumb reference counter. No more check for
enabled progress as this is handled by new_progress_context.
* verify.c (verify_signatures, verify_one_file): Replace stack
based progress context by a heap based one.
* sign.c (sign_file, clearsign_file, sign_symencrypt_file): Ditto.
* plaintext.c (ask_for_detached_datafile, hash_datafiles): Ditto.
* encode.c (encode_simple, encode_crypt): Ditto.
* decrypt.c (decrypt_message, decrypt_messages): Ditto.
* keyedit.c (menu_clean): Made strings translatable.
2006-12-03 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_clean): Show "already minimized" rather than
"already clean" when a minimized key is minimized again. From
Dirk Traulsen.
2006-12-02 David Shaw <dshaw@jabberwocky.com>
* options.h, gpg.c (main), passphrase.c (passphrase_to_dek): Add
--passphrase-repeat option to control how many times gpg will
re-prompt for a passphrase to ensure the user has typed it
correctly. Defaults to 1.
2006-12-02 Werner Koch <wk@g10code.com>
* encr-data.c: Allocate DFX context on the heap and not on the
stack. Changes at several places. Fixes CVE-2006-6235.
2006-11-27 Werner Koch <wk@g10code.com>
* openfile.c (ask_outfile_name): Fixed buffer overflow occurring
if make_printable_string returns a longer string. Fixes bug 728.
2006-11-21 Werner Koch <wk@g10code.com>
* Makefile.am (needed_libs): libgnu needs to come after libcommon.
* keygen.c (ask_expire_interval): Print y2038 warning only for 32
bit time_t.
(save_unprotected_key_to_card): Made RSA_N_LEN et al a size_t.
Cast printf args.
(get_parameter_algo): Allow "ELG" as alias for "ELG-E".
* seckey-cert.c (do_check): Made NBYTES a size_t.
(do_check): Made NDATA a size_t.
(protect_secret_key): Made NARR a size_t.
(protect_secret_key): Made NVYES a size_t.
* pubkey-enc.c (get_it): Made INDATALEN a size_t.
(get_it): Made NFRAME a size_t.
* keyid.c (hash_public_key): Made NBITS an unsigned int.
* misc.c (checksum_mpi): Made NBYTES a size_t.
(openpgp_pk_test_algo2): Made USE_BUF a size_t.
* seskey.c (encode_session_key): Made NFRAME a size_t.
(do_encode_md): Ditto.
(encode_md_value): Cast size_t argument of printf.
(encode_md_value): Ditto.
2006-11-10 Werner Koch <wk@g10code.com>
* parse-packet.c (mpi_read): Changed NREAD to size_t to match the
gcry_mpi-scan prototype.
(mpi_read): Fixed double increment of bytes read to correctly
detect overlong MPIs.
2006-11-05 Werner Koch <wk@g10code.com>
* gpg.c (main): Remove the default --require-cross-certification.
* options.skel: Enable require-cross-certification.
2006-10-31 Werner Koch <wk@g10code.com>
* pkclist.c (warn_missing_aes_from_pklist): New.
* encode.c (encrypt_filter, encode_crypt): Use it here.
2006-10-27 Werner Koch <wk@g10code.com>
* pkclist.c (warn_missing_mdc_from_pklist): New.
* encode.c (use_mdc): Use it here.
2006-10-24 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS).
2006-10-23 Werner Koch <wk@g10code.com>
* gpg.c (main): New command --gpgconf-test.
* Makefile.am (bzip2_source): New.
2006-10-20 Werner Koch <wk@g10code.com>
* getkey.c (classify_user_id): Reserve '&' for search by keygrip.
2006-10-19 Werner Koch <wk@g10code.com>
* keygen.c (get_parameter_algo): Add special case for ELG_E which
is not supported by libgcrypt's mapping function.
2006-10-18 Werner Koch <wk@g10code.com>
* keyid.c (v3_keyid): Don't use mempcy as we need to hold the
keyids in the native endian format.
* import.c (import_print_stats): Use log_printf.
* build-packet.c (do_public_key): Care about mpi_write errors.
(do_secret_key, do_pubkey_enc, do_signature): Ditto.
(mpi_write): Print an extra warning on error.
2006-10-17 Werner Koch <wk@g10code.com>
* Makefile.am (LDADD): Replaced W32LIBS by NETLIBS.
2006-10-12 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (parse_symkeyenc): Show the unpacked as well as
the packed s2k iteration count.
* main.h, options.h, gpg.c (encode_s2k_iterations, main),
passphrase.c (hash_passphrase): Add --s2k-count option to specify
the number of s2k hash iterations.
2006-10-08 Werner Koch <wk@g10code.com>
* gpgv.c: Remove the tty stubs as we are now required to link to
tty anyway (it is included in libcommand and has dependencies to
other modules as well).
* keyedit.c (keyedit_menu): Use keyedit_completion only if
readline is available. It would be better to move this code into
gpgrlhelp.c
2006-10-06 Werner Koch <wk@g10code.com>
* Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
2006-10-06 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Write the 16-digit keyid rather
than whatever key selector the user used on the command line.
2006-10-05 Werner Koch <wk@g10code.com>
* status.c (progress_cb): Changed to libgcrypt API.
(set_status_fd): Register the progress cb.
* seskey.c (encode_md_value): Check that the hash algo is valid
before getting the OID.
2006-10-04 Werner Koch <wk@g10code.com>
* passphrase.c: Allow for a static passphrase in batch mode.
* call-agent.c (agent_havekey): Removed.
(percent_plus_escape): New.
(agent_get_passphrase): New.
(agent_clear_passphrase): New.
* passphrase.c: Changed so that we always require the agent.
(agent_send_option, agent_send_all_options, agent_open): Removed.
(agent_get_passphrase): Cleaned up. Does now use the call-agent
functions. Renamed to
(passphrase_get): .. this. Changed all callers.
(passphrase_clear_cache): Rewritten.
(passphrase_to_dek, hash_passphrase): Re-indented.
* gpg.c (main): Made --use-agent a dummy option.
* seckey-cert.c (check_secret_key): We require the agent, so always
allow for 3 tries.
* gpg.c (main): Print a warning if -sat has been used.
(main): Removed the special treatment of the -k option. -k is now
an alias for --list-keys.
(main): Removed --list-ownertrust.
2006-10-02 Werner Koch <wk@g10code.com>
* encr-data.c (decrypt_data, mdc_decode_filter): Check the MDC
right here and don't let parse-packet handle the MDC.
2006-09-29 Werner Koch <wk@g10code.com>
* compress.c (do_uncompress): Removed use of Z_PARTIAL_FLUSH.
This is outdated and old zlib versions which still require it have
security problems.
2006-09-27 Werner Koch <wk@g10code.com>
Replaced all STRLIST by strlist_t.
2006-09-21 Werner Koch <wk@g10code.com>
* signal.c (got_fatal_signal): Replaced readline stuff by a tty
function.
* Makefile.am (LDADD): Include libgpgrl.a.
* gpg.c (main): Call gpg_rl_initialize.
* keyedit.c: Removed double inclusion of stdio.h.
2006-09-20 Werner Koch <wk@g10code.com>
* call-agent.c: Include asshelp.h.
(start_agent): Use send_pinentry_environment.
2006-09-14 Werner Koch <wk@g10code.com>
Replaced all call gpg_error_from_errno(errno) by
gpg_error_from_syserror().
2006-09-13 Werner Koch <wk@g10code.com>
* gpg.c (main): Made --require-cross-certification the default.
2006-09-06 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (gpg2_LDADD, gpgv2_LDADD): Replace -lassuan and
-lgpg-error with $(LIBASSUAN_LIBS) and $(GPG_ERROR_LIBS).
(AM_CFLAGS): Add $(LIBASSUAN_CFLAGS) and $(GPG_ERROR_CFLAGS).
2006-09-06 Werner Koch <wk@g10code.com>
* gpg.c (main): Enable new assuan API.
* call-agent.c: Changed to new Assuan API.
2006-09-01 Werner Koch <wk@g10code.com>
* call-agent.c: Do not force using the pipe server.
* gpg.c (main): Enable card related commands.
2006-08-22 Werner Koch <wk@g10code.com>
* mainproc.c (proc_plaintext): Fixed a #warning
2006-08-21 Werner Koch <wk@g10code.com>
* skclist.c (random_is_faked): Implemented.
(is_insecure): Also test for the old uppercase version of the
insecure string.
* gpg.c (main): Renamed --quick-random to debug-quick-quick-random.
* gpg.c (print_mds): Do not use the USE_SHA macros.
* mainproc.c (proc_encrypted): Remove assign inside condition for
better readibility.
* packet.h: Moved consts to new header ../common/openpgpdefs.h.
2006-08-16 Werner Koch <wk@g10code.com>
* keyserver.c (GPGKEYS_PREFIX): Rename to gpg2keys_. This is so
that we can install helpers from 1.4 and 2 without conflicts and
first of all don't get lost with weird bug reports.
* keyid.c (serialno_and_fpr_from_sk): New. Actually lost during
the last 1.4 to 1.9 merge.
* gpg.c (list_config): Output ccid-reader-id only for gnupg 1.
* call-agent.c (agent_scd_writekey): New.
(inq_writekey_parms): New.
* gpgv.c: Include call-agent.h for use by stubs.
* misc.c: Include call-agent.h for use by get_signature_count.
2006-07-27 Werner Koch <wk@g10code.com>
* parse-packet.c (parse_comment): Cap comments at 65k.
(parse_gpg_control): Skip too large control packets.
2006-07-24 David Shaw <dshaw@jabberwocky.com> (wk)
* keydb.h, pkclist.c (select_algo_from_prefs, algo_available):
Pass a union for preference hints rather than doing void * games.
* sign.c (sign_file): Use it here.
* sign.c (sign_file): When signing with multiple DSA keys, one
being DSA1 and one being DSA2 and encrypting at the same time, if
the recipient preferences give a hash that can work with the DSA2
key, then allow the DSA1 key to be promoted rather than giving up
and using hash_for().
* pkclist.c (algo_available): Automatically enable DSA2 mode when
handling a key that clearly isn't DSA1 (i.e. q!=160).
2006-06-30 Werner Koch <wk@g10code.com>
* misc.c (checksum_mpi): No need for nbits as they are alredy
included in the buffer.
2006-06-29 Werner Koch <wk@g10code.com>
* parse-packet.c (parse_signature, parse_key): Need store the
length of opaque data as number of bits.
* card-util.c (card_store_subkey): Ditto.
* mainproc.c (print_pkenc_list, check_sig_and_print): Replaced
log_get_stream by calls to log_printf. This avoids the extra LFs
inserted by the logging function. They are a bit too smart
sometimes.
* pkclist.c (do_show_revocation_reason): Print final LF through
log_printf to avoid extra LFs.
* pubkey-enc.c (get_it): Ditto.
* seskey.c (encode_md_value): Fix call to gcry.
2006-06-27 Werner Koch <wk@g10code.com>
Applied patches from 1.4.x (2006-05-22 to 2006-06-23) from David:
* keygen.c (keygen_upd_std_prefs, keygen_add_std_prefs)
(proc_parameter_file): Add --default-keyserver-url to specify a
keyserver URL at key generation time, and "Keyserver:" keyword for
doing the same through a batch file.
* options.h, gpg.c (main): Ditto.
* sign.c (do_sign): For now don't accept a truncated hash even
for DSA1 keys (be liberal in what you accept, etc).
* import.c (import_one): Add a flag (from_sk) so we don't check
prefs on an autoconverted public key. The check should only
happen on the sk side. Noted by Dirk Traulsen.
* keygen.c (gen_card_key): Add optional argument to return a
pointer (not a copy) of the stub secret key for the secret key we
just generated on the card.
(generate_card_subkeypair): Use it here so that the signing key on
the card can use the card to generate the 0x19 backsig on the
primary key. Noted by Janko Heilgeist and Jonas Oberg.
* parse-packet.c (parse_user_id): Cap the user ID size at 2048
bytes. This prevents a memory allocation attack with a very large
user ID. A very large packet length could even cause the
allocation (a u32) to wrap around to a small number. Noted by
Evgeny Legerov on full-disclosure.
* keygen.c (gen_dsa): Allow generating DSA2 keys. Allow
specifying sizes > 1024 when --enable-dsa2 is set. The size of q
is set automatically based on the key size.
(ask_keysize, generate_keypair): Ask for DSA size when
--enable-dsa2 is set.
* exec.c (make_tempdir) [W32]: Fix bug with a temporary directory
on W32 that is over 256 bytes long. Noted by Israel G. Lugo.
* gpg.c (reopen_std): New function to reopen fd 0, 1, or 2 if we
are called with them closed. This is to protect our
keyring/trustdb files from corruption if they get attached to one
of the standard fds. Print a warning if possible that this has
happened, and fail completely if we cannot reopen (should never
happen).
(main): Call it here.
* parse-packet.c (dump_sig_subpkt, parse_signature): Fix meaning
of key expiration and sig expiration subpackets - zero means
"never expire" according to 2440, not "expire instantly".
* build-packet.c (build_sig_subpkt_from_sig): Ditto.
* getkey.c (fixup_uidnode, merge_selfsigs_main)
(merge_selfsigs_subkey): Ditto.
* keygen.c (keygen_add_key_expire): Ditto.
* getkey.c (get_pubkey_byname)
* import.c (import_one): Fix key selection problem when
auto-key-locate returns a list of keys, not all of which are
usable (revoked, expired, etc). Noted by Simon Josefsson.
2006-05-24 Werner Koch <wk@g10code.com>
* keyid.c (hash_public_key): Do not double hash the length bytes,
they are already included by mpi_print.
* misc.c (openpgp_pk_test_algo2): Get test call right.
* misc.c (string_to_cipher_algo, string_to_digest_algo): New.
* keygen.c (keygen_set_std_prefs): use them here.
* gpg.c (main): and here.
2006-05-23 Werner Koch <wk@g10code.com>
* card-util.c (generate_card_keys): Removed temporary kludge for
generate_keypair.
* call-agent.c (agent_scd_setattr): Add arg SERIALNO.
(agent_scd_genkey): Ditto.
(agent_scd_change_pin): Ditto.
* call-agent.h (struct agent_card_info_s): Updated to match the
one of 1.4.3.
* Makefile.am (LDADD): Include ZLIBS.
* gpgv.c: Removed stubs not anymore useful due to libgcrypt.
2006-05-22 Werner Koch <wk@g10code.com>
* keyserver.c (keyidlist): Replaced mpi_get_keyid by v3_keyid.
* keydb.h (v3_keyid): Added.
* import.c (import): Better initialize KEYBLOCK as to quiet
compiler warning.
* skclist.c (random_is_faked): New.
* mainproc.c: Include pka.h.
2006-05-19 Werner Koch <wk@g10code.com>
* misc.c (openpgp_pk_test_algo2): Need to use gcry_pk_algo_info
directly.
(string_count_chr): New.
* armor.c (parse_header_line): Use renamed function
length_sans_trailing_ws.
* options.h, gpg.c: Option --strict is not used thus removed code
but kept option.
2006-04-28 David Shaw <dshaw@jabberwocky.com> (wk)
* keyserver.c (direct_uri_map): New.
(keyserver_spawn): Used here to add "_uri" to certain gpgkeys_xxx
helpers when the meaning is different if a path is provided (i.e.
ldap).
(keyserver_import_cert): Show warning if there is a CERT
fingerprint, but no --keyserver set.
* keyserver.c: Fix build problem with platforms that stick libcurl
in a place not in the regular include search path.
* options.h, gpg.c (main): Add --enable-dsa2 and --disable-dsa2.
Defaults to disable.
* pkclist.c (algo_available): If --enable-dsa2 is set, we're
allowed to truncate hashes to fit DSA keys.
* sign.c (match_dsa_hash): New. Return the best match hash for a
given q size.
(do_sign, hash_for, sign_file): When signing with a DSA key, if it
has q==160, assume it is an old DSA key and don't allow truncation
unless --enable-dsa2 is also set. q!=160 always allows truncation
since they must be DSA2 keys.
(make_keysig_packet): If the user doesn't specify a
--cert-digest-algo, use match_dsa_hash to pick the best hash for
key signatures.
* gpg.c (print_mds): Add SHA-224.
* armor.c (armor_filter, parse_hash_header): Add SHA-224.
* sign.c (write_plaintext_packet):
Factor common literal packet setup code from here, to...
* encode.c (encode_simple): .. there.
* 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.
* keyedit.c (menu_backsign): Give some more verbose errors when we
have no need to backsign.
* getkey.c (parse_auto_key_locate): Fix dupe-removal code.
* keyedit.c (menu_backsign): Allow backsigning even if the secret
subkey doesn't have a binding signature.
* armor.c (radix64_read): Don't report EOF when reading only a pad
(=) character. The EOF actually starts after the pad.
* gpg.c (main): Make --export, --send-keys, --recv-keys,
--refresh-keys, and --fetch-keys follow their arguments from left
to right. Suggested by Peter Palfrader.
2006-04-18 Werner Koch <wk@g10code.com>
* tdbio.c (open_db, migrate_from_v2): Removed feature to migration
from old trustdb version 2.
* gpg.c, mainproc.c: Removed pipemode feature.
* status.c: Removed shared memory coprocess stuff
Merged with current gpg 1.4.3 code.
* keygen.c, keyid.c, misc.c, openfile.c, verify.c, trustdb.c
* textfilter.c, tdbio.c, tdbdump.c, status.c, skclist.c, signal.c
* sign.c, sig-check.c, seskey.c, seckey-cert.c, revoke.c
* pubkey-enc.c, progress.c, plaintext.c, pkclist.c, photoid.c
* passphrase.c, parse-packet.c, mdfilter.c, mainproc.c
* keyserver.c, keyring.c, keylist.c, keyedit.c, keydb.c, kbnode.c
* import.c, getkey.c, gpgv.c, helptext.c, free-packet.c
* build-packet.c, cipher.c, compress.c, dearmor.c, decrypt.c
* delkey.c, encr-data.c, encode.c, exec.c, export.c
* gpg.c, armor.c: Updated from gnupg-1.4.3 and merged back gcry and
gnupg-1.9 related changes.
* trustdb.h, tdbio.h, status.h, photoid.h, packet.h, options.h
* main.h, keyserver-internal.h, keyring.h, keydb.h, filter.h
* exec.h: Ditto.
* global.h: Removed after merging constants with gpg.h.
* comment.c, pipemode.c: Removed.
* card-util.c: Updated from gnupg-1.4.3.
* compress-bz2.c: New.
2005-06-15 Werner Koch <wk@g10code.com>
* g10.c (print_hashline, add_group): Fixes for signed/unsigned
pointer mismatch warnings.
2005-06-01 Werner Koch <wk@g10code.com>
* mkdtemp.c: Removed.
* exec.c: Include mkdtemp.h
2004-12-21 Werner Koch <wk@g10code.com>
* gpgv.c, g10.c (main): Use default_hoemdir ().
2004-12-18 Werner Koch <wk@g10code.com>
* gpg.h (map_assuan_err): Define in terms of
map_assuan_err_with_source.
2004-12-15 Werner Koch <wk@g10code.com>
* Makefile.am (LDADD): Remove ZLIBS.
2004-10-22 Werner Koch <wk@g10code.com>
* g10.c (main): Display a bit fat warning that this gpg should not
be used.
* card-util.c (fetch_url): Disable for gnupg 1.9
(card_generate_subkey): Ditto.
(card_store_subkey): Ditto.
2004-09-30 Werner Koch <wk@g10code.com>
* gpgv.c (i18n_init): Always use LC_ALL.
* Makefile.am (LDADD): Adjusted for gettext 0.14.
2004-09-20 Werner Koch <wk@g10code.com>
* keyedit.c (show_key_with_all_names): Print the card S/N.
2004-09-11 Moritz Schulte <moritz@g10code.com>
* openfile.c (copy_options_file): Fixed last commit (added a `+').
2004-08-31 Werner Koch <wk@g10code.de>
* openfile.c (copy_options_file): Use gpg-conf.skel. Better take
the length of SKELEXT into account, someone might make it larger.
* Makefile.am: Install options.skel as gpg-conf.skel.
2004-08-18 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (agent_get_passphrase): Fix detection of gpg-agent
cancellation.
2004-07-01 Werner Koch <wk@gnupg.org>
* card-util.c (change_login): Kludge to allow reading data from a
file.
(card_edit): Pass ARG_STRING to change_login.
(card_status): Print CA fingerprints.
(change_cafpr): New.
(card_edit): New command CAFPR.
* call-agent.h: Add members for CA fingerprints.
* call-agent.c (agent_release_card_info): Invalid them.
(learn_status_cb): Store them.
2004-04-30 Werner Koch <wk@gnupg.org>
* g10.c (main) <gpgconf>: Use gpg.conf and not /dev/null as
default filename.
2004-04-28 Werner Koch <wk@gnupg.org>
* card-util.c (card_edit): Remove PIN verification.
(generate_card_keys): New arg SERIALNO. Do PIN verification here
after resetting forced_chv1.
2004-04-26 Werner Koch <wk@gnupg.org>
* card-util.c (change_name): Check that the NAME is not too long.
(change_url): Likewise.
(change_login): Likewise.
2004-03-23 Werner Koch <wk@gnupg.org>
* g10.c: New options --gpgconf-list, --debug-level and --log-file
(set_debug): Add arg DEBUG_LEVEL.
(main): Look at less and less version specific config files. From
gnupg 1.3.
2004-02-17 Werner Koch <wk@gnupg.org>
* call-agent.c (start_agent): Ignore an empty GPG_AGENT_INFO.
* passphrase.c (agent_open): Ditto.
2004-02-12 Werner Koch <wk@gnupg.org>
* gpgv.c: Removed g10defs.h.
* Makefile.am: Include cmacros.am for common flags.
2004-02-11 Werner Koch <wk@gnupg.org>
* openfile.c (try_make_homedir): Use GNUPG_DEFAULT_HOMEDIR.
* gpgv.c (main): Ditto.
* g10.c (main): Ditto.
2004-01-19 Moritz Schulte <mo@g10code.com>
* keygen.c (do_generate_keypair): Print member fname, instead of
newfname, again.
(do_generate_keypair): Don't try to execute certain pieces of code
in case an error occured.
(gen_card_key): Don't print out a message, which is already
printed by do_generate_keypair().
2004-01-18 Moritz Schulte <mo@g10code.com>
* keygen.c (do_generate_keypair): Print member fname, instead of
newfname.
2003-12-17 Werner Koch <wk@gnupg.org>
* card-util.c (print_name): Fixed bad format string usage.
(print_isoname): Ditto.
* trustdb.c (check_regexp): s/exp/expr/.
* keyedit.c (trustsig_prompt): Removed a "> 255" term; it is
always false due to the data type.
* passphrase.c (agent_get_passphrase): Use xasprintf and avoid
non-literal format strings.
* tdbio.c (upd_hashtable, drop_from_hashtable, lookup_hashtable):
Fixed log_error format string bugs. Kudos to the now working
gcc-3.3 -Wformat-nonliteral and Florian Weimer's investigations in
gnupg 1.2.3.
2003-12-15 Werner Koch <wk@gnupg.org>
* seckey-cert.c (protect_secret_key): Use gry_create_nonce for the
IV; there is not need for real strong random here and it even
better protect the random bits used for the key.
2003-11-16 Moritz Schulte <mo@g10code.com>
* signal.c: Removed unused file.
2003-11-10 Moritz Schulte <mo@g10code.com>
* Makefile.am (INCLUDES): Added: @LIBGCRYPT_CFLAGS@.
2003-10-25 Werner Koch <wk@gnupg.org>
* call-agent.c (learn_status_cb, scd_genkey_cb): Fixed faulty use
of !spacep().
2003-10-20 Werner Koch <wk@gnupg.org>
* card-util.c (card_edit): New command "passwd". Add logic to
check the PIN in advance.
(card_status): Add new args to return the serial number. Changed
all callers.
* call-agent.c (agent_scd_checkpin): New.
2003-10-08 Werner Koch <wk@gnupg.org>
* call-agent.c (agent_scd_getattr): Don't clear the passed info
structure, so that it can indeed be updated.
* card-util.c (fpr_is_zero): New.
(generate_card_keys): New.
(card_edit): New command "generate".
* keygen.c (generate_keypair): New arg CARD_SERIALNO, removed call
to check_smartcard.
(check_smartcard,show_smartcard): Removed.
(show_sha1_fpr,fpr_is_zero): Removed.
2003-10-01 Werner Koch <wk@gnupg.org>
* card-util.c: Tweaked to use this source also under 1.3.
2003-09-30 Werner Koch <wk@gnupg.org>
* keylist.c (print_card_serialno): New.
(list_keyblock_print): Use it here.
* card-util.c (toggle_forcesig): New.
(card_edit): New command "forcesig".
* card-util.c (print_name, print_isoname): Use 0 and not LF fro
the max_n arg of tty_print_utf8_string2.
* call-agent.c (agent_scd_getattr): New.
(learn_status_cb): Release values before assignment so that it can
be used by getattr to update the structure.
* card-util.c (change_pin): Simplified. We now have only a PIN
and an Admin PIN.
2003-09-27 Werner Koch <wk@gnupg.org>
* sign.c (do_sign): Removed disabled testcode.
2003-09-26 Timo Schulz <twoaday@freakmail.de>
* card_status (card_status): Do not use fputs since the fp
parameter can be NULL. This fixes a segv.
2003-09-24 Werner Koch <wk@gnupg.org>
* card-util.c (print_isoname,card_status): Handle opt.with_colons.
(print_sha1_fpr_colon): New.
2003-09-23 Werner Koch <wk@gnupg.org>
Merged most of David Shaw's changes in 1.3 since 2003-06-03.
* Makefile.am: Include W32LIBS where appropriate.
* armor.c (parse_hash_header,armor_filter): Drop TIGER/192 support.
* g10.c (print_hex,print_mds): Ditto.
* pkclist.c (algo_available): Ditto.
* armor.c (armor_filter): Allow using --comment multiple times to
get multiple Comment header lines. --no-comments resets list.
* options.h, g10.c (main): Ditto. Deprecate --default-comment in
favor of --no-comments.
* g10.c (main): Trim --help to commonly used options. Remove -f.
* g10.c (main): Add --multifile as an alias to turn --encrypt into
--encrypt-files (plus --verify-files, --decrypt-files). Error out
if --multifile is used with the commands that don't support it yet.
* encode.c (use_mdc), g10.c (main): Use RFC1991 and RFC2440
directly to check for MDC usability. Do not set the force_mdc or
disable_mdc flags since there is no point any longer.
* g10.c (main): Use "keyserver-url" instead of
"preferred-keyserver" for the sake of short and simple commands.
(add_keyserver_url): Clarify a few strings. It's a
"preferred keyserver URL".
* keyedit.c (keyedit_menu): Ditto.
* sign.c (mk_notation_policy_etc): Ditto.
* main.h, keygen.c (keygen_add_keyserver_url): Signature callback
for adding a keyserver URL.
* keyedit.c (keyedit_menu, menu_set_keyserver_url): New command to
set preferred keyserver to specified (or all) user IDs.
* build-packet.c (build_sig_subpkt): Set preferred keyserver flag
while building a preferred keyserver subpacket.
* keylist.c (show_policy_url, show_keyserver_url): URLs might be
UTF8.
* keyedit.c (menu_addrevoker): Fix leaking a few bytes.
* keyedit.c (show_key_with_all_names): Use list-option
show-long-keyid in main --edit-key display.
* keyedit.c (print_and_check_one_sig): Use list-option
show-long-keyid in --edit-key "check" function.
* passphrase.c (agent_send_all_options): Make use of $GPG_TTY.
* g10.c (main): Disable use-agent if passphrase-fd is given
later. Suggested by Kurt Garloff.
* exec.c, g10.c, gpgv.c, passphrase.c, photoid.c:
s/__MINGW32__/_WIN32/ to help building on native Windows
compilers. Requested by Brian Gladman. From Werner on stable
branch.
* options.h, g10.c (main): Add list-option
list-preferred-keyserver.
* keyedit.c (change_passphrase): When responding 'no' to the blank
passphrase question, re-prompt for a new passphrase. This is bug
#202.
* mainproc.c (check_sig_and_print): Use two different preferred
keyserver displays - one if the key is not present (to tell the
user where to get the key), the other if it is present (to tell
the user where the key can be refreshed).
* packet.h, parse-packet.c (parse_signature): Set flag if a
preferred keyserver is present.
* keylist.c (list_keyblock_print): Show keyserver url in listings
with list-option show-keyserver-url.
* mainproc.c (check_sig_and_print): Get the uid validity before
printing any sig results to avoid munging the output with trustdb
warnings.
* g10.c (main): Don't include --show-keyring in --help as it is
deprecated.
* options.skel: Note that keyserver.pgp.com isn't synchronized,
and explain the roundrobin a bit better.
* sig-check.c (check_key_signature2), import.c (import_one,
import_revoke_cert, chk_self_sigs, delete_inv_parts,
collapse_uids, merge_blocks): Make much quieter during import of
slightly munged, but recoverable, keys. Use log_error for
unrecoverable import failures.
* keyring.c (keyring_rebuild_cache): Comment.
* sign.c (mk_notation_and_policy): Making a v3 signature with
notations or policy urls is an error, not an info (i.e. increment
the errorcount). Don't print the notation or policy url to stdout
since it can be mixed into the output stream when piping and munge
the stream.
* packet.h, sig-check.c (signature_check2, do_check,
do_check_messages): Provide a signing-key-is-revoked flag. Change
all callers.
* status.h, status.c (get_status_string): New REVKEYSIG status tag
for a good signature from a revoked key.
* mainproc.c (do_check_sig, check_sig_and_print): Use it here.
* import.c (import_revoke_cert, merge_blocks, merge_sigs): Compare
actual signatures on import rather than using keyid or class
matching. This does not change actual behavior with a key, but
does mean that all sigs are imported whether they will be used or
not.
* parse-packet.c (parse_signature): Don't give "signature packet
without xxxx" warnings for experimental pk algorithms. An
experimental algorithm may not have a notion of (for example) a
keyid (i.e. PGP's x.509 stuff).
* options.h, g10.c (main), keylist.c (list_keyblock_print),
keyedit.c (print_and_check_one_sig): New "show-sig-expire"
list-option to show signature expiration dates (if any).
* options.h, g10.c (main, add_keyserver_url): Add
--sig-preferred-keyserver to implant a "where to get my key"
subpacket into a signature.
* sign.c (mk_notation_and_policy): Rename to
mk_notation_policy_etc and add preferred keyserver support for
signatures.
* keygen.c (do_add_key_flags): Don't set the certify flag for
subkeys.
(ask_algo): Provide key flags for DSA, Elgamal_e, and Elgamal
subkeys.
(generate_keypair): Provide key flags for the default DSA/Elgamal
keys.
* sig-check.c (signature_check, signature_check2,
check_key_signature, check_key_signature2): Allow passing NULLs
for unused parameters in the x2 form of each function to avoid the
need for dummy variables. getkey.c, mainproc.c: Change all
callers.
* trustdb.h, trustdb.c (read_trust_options): New. Returns items
from the trustdb version record.
* keylist.c (public_key_list): Use it here for the new "tru"
record.
* gpgv.c (read_trust_options): Stub.
* keyedit.c (show_key_with_all_names): Use list-option
show-validity in --edit-key interface as well.
* options.h, g10.c (main), mainproc.c (check_sig_and_print): Add
verify-options "show-validity" and "show-long-keyid" to show
trustdb validity and long keyids during (file) signature
verification.
* packet.h, main.h, sig-check.c (signature_check2)
(check_key_signature2, do_check): If ret_pk is set, fill in the pk
used to verify the signature. Change all callers in getkey.c,
mainproc.c, and sig-check.c.
* keylist.c (list_keyblock_colon): Use the ret_pk from above to
put the fingerprint of the signing key in "sig" records during a
--with-colons --check-sigs. This requires --no-sig-cache as well
since we don't cache fingerprints.
* parse-packet.c (parse_signature): No need to reserve 8 bytes for
the unhashed signature cache any longer.
* misc.c (pct_expando): Add two new expandos - signer's
fingerprint (%g), and signer's primary fingerprint (%p).
* g10.c (main): Add --rfc2440 alias for --openpgp since in a few
months, they won't be the same thing.
* keyserver.c (parse_keyserver_uri): Accept "http" as an alias for
"hkp", since it is occasionally written that way.
(keyserver_spawn): Use ascii_isspace to avoid locale issues.
* keygen.c (ask_user_id): Make --allow-freeform-uid apply to the
email field as well as the name field, and allow mixing fields
when it is set.
* trustdb.c (validate_one_keyblock): Certifications on revoked or
expired uids do not count in the web of trust.
* signal.c (init_one_signal, pause_on_sigusr, do_block): Only use
sigprocmask() if we have sigset_t, and only use sigaction() if we
have struct sigaction. This is for Forte c89 on Solaris which
seems to define only the function call half of the two pairs by
default.
(pause_on_sigusr): Typo.
(do_block): If we can't use sigprocmask() and sigset_t, try to get
the number of signals from NSIG as well as MAXSIG, and if we
can't, fail with an explanation.
* signal.c, tdbio.c: Comment out the transaction code. It was not
used in this version, and was causing some build problems on
quasi-posix platforms (Solaris and Forte c89).
* keylist.c (list_keyblock_colon): Don't include validity values
when listing secret keys since they can be incorrect and/or
misleading. This is a temporary kludge, and will be handled
properly in 1.9/2.0.
* mainproc.c (check_sig_and_print): Only show the "key available
from" preferred keyserver line if the key is not currently
present.
* keyedit.c (sign_uids): Do not sign expired uids without --expert
(same behavior as revoked uids). Do not allow signing a user ID
without a self-signature. --expert overrides. Add additional
prompt to the signature level question.
(menu_expire): When changing expiration dates, don't replace
selfsigs on revoked uids since this would effectively unrevoke
them. There is also no point in replacing expired selfsigs. This
is bug #181
* g10.c (add_notation_data): Make sure that only ascii is passed
to iscntrl. Noted by Christian Biere.
* getkey.c (classify_user_id2): Replaced isspace by spacep
* keygen.c (ask_user_id): Ditto.
(get_parameter_algo): Ditto.
* keyedit.c (keyedit_menu): Ditto.
* tdbdump.c (import_ownertrust): Ditto. s/isxdigit/hexdigitp/.
* revoke.c (ask_revocation_reason):
* keyserver.c (keyserver_spawn): Dito.
* parse-packet.c (parse): Disallow old style partial length for
all key material packets to avoid possible corruption of keyrings.
* import.c (import_keys_internal): Invalidate the cache so that
the file descriptor gets closed. Fixes bug reported by Juan
F. Codagnone.
* options.h, g10.c (main), main.h, keylist.c (show_keyserver_url),
mainproc.c (check_sig_and_print), parse-packet.c (dump_sig_subpkt,
parse_one_sig_subpkt, can_handle_critical): Add read-only support
for preferred keyserver subpackets. They're basically policy URLs
with a different name. Add a verify-option
"show-preferred-keyserver" to turn them on and off (on by default,
as per stable branch).
* g10.c (main): Add "--set-notation" as alias to "--notation-data"
this is to make things consistent with --set-policy-url meaning
both sigs and certs.
* options.h, g10.c (main), keylist.c (list_keyblock_print): Add
"show-validity" and "show-long-keyid" list-options.
* gpgv.c (get_validity, trust_value_to_string): Stubs.
* g10.c (main): Use SAFE_VERSION instead of VERSION in the
version-specific gpg.conf file so it can be overridden on RISCOS.
* keyedit.c (show_key_with_all_names): Fix assertion failure when
using toggle to see a secret key. Reported by Maxim Britov.
2003-09-22 Timo Schulz <twoaday@freakmail.de>
* card-util.c (card_status): Free pk in case of an error
and return if the card is no OpenPGP card.
2003-09-18 Werner Koch <wk@gnupg.org>
* g10.c: New command --card-edit.
* card-util.c (card_status): Use tty_fprintf for all output.
(print_sha1_fpr, print_isoname): Ditto.
(get_one_name,change_name, change_url, change_login,change_lang)
(change_sex): New; taken from keygen.c.
* keygen.c (smartcard_get_one_name, smartcard_change_name)
(smartcard_change_url, smartcard_change_login_data)
(smartcard_change_lang, smartcard_change_sex): Removed.
(check_smartcard): Removed most menu items.
2003-09-06 Werner Koch <wk@gnupg.org>
* misc.c (openpgp_pk_algo_usage): Allow AUTH where SIGN is allowed.
* keygen.c (ask_passphrase): No need to allocated S2K in secure
memory.
2003-09-04 Werner Koch <wk@gnupg.org>
* keygen.c (do_add_key_flags, parse_parameter_usage)
(do_generate_keypair): Add support the proposed AUTH key flag.
* getkey.c (fixup_uidnode, merge_selfsigs_main)
(merge_selfsigs_subkey, premerge_public_with_secret): Ditto.
* keylist.c (print_capabilities): Ditto.
2003-08-25 Timo Schulz <twoaday@freakmail.de>
* pkglue.c (mpi_from_sexp): New. Used to factor out
some common code.
2003-08-24 Werner Koch <wk@gnupg.org>
* keygen.c (do_generate_keypair): Print a reminder to use --gen-revoke.
2003-08-18 Timo Schulz <twoaday@freakmail.de>
* encode.c (encode_sesskey): Checked the code and removed
the warning since all compatibility checks with PGP succeeded.
* mainproc.c (symkey_decrypt_sesskey): Better check for the
algorithm and check the return values of some functions.
* mdc.c (use_mdc): Simplified.
2003-08-07 Werner Koch <wk@gnupg.org>
* pkglue.c (pk_sign): Fix last change.
(pk_verify): Check for valid DATA array so that we don't segv in
Libgcrypt.
(pk_verify): Ditto.
2003-08-06 Werner Koch <wk@gnupg.org>
* pkglue.c (pk_sign): Allow signing using RSA.
2003-08-05 Werner Koch <wk@gnupg.org>
* Makefile.am (install-data-local): Dropped check for the ancient
gpgm tool.
(bin_PROGRAMS): Renamed gpg to gpg2 and gpgv to gpgv2. This is so
that it won't conflict with the current stable version of gpg.
* pkglue.c (pk_check_secret_key): New.
* seckey-cert.c (do_check): Reenable this test here again.
* g10.c (main): Add command -K as an alias for
--list-secret-keys. Command "-k" is now an alias to --list-keys.
Remove special treatment of -kv and -kvv.
(set_cmd): Ditto.
(main): Strip a "-cvs" suffix when testing for a version specific
config file.
* status.h, status.c, g10.c [USE_SHM_COPROCESSING]: Removed. This
is not any longer available.
2003-07-29 Werner Koch <wk@gnupg.org>
* g10.c (main): Add secmem features and set the random seed file.
(g10_exit): Update the random seed file.
* parse-packet.c (parse_signature,read_protected_v3_mpi)
(parse_key): Fixed use of mpi_set_opaque.
* keygen.c (gen_card_key): Ditto.
2003-07-28 Werner Koch <wk@gnupg.org>
* status.c (progress_cb): Adjusted for use with Libcgrypt.
(set_status_fd): Register that callback.
* keygen.c (smartcard_change_login_data): New.
(smartcard_change_lang): New.
(smartcard_change_sex): New.
(check_smartcard): Add menu entries to edit the above.
(gen_elg,gen_dsa,gen_rsa): Reimplemented in terms of Libgcrypt.
(genhelp_protect, genhelp_factors, key_from_sexp): New.
* comment.c (make_comment_node_from_buffer): New.
(make_comment_node): Reimplemented in terms of above.
2003-07-27 Werner Koch <wk@gnupg.org>
Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2003-07-24 Werner Koch <wk@gnupg.org>
* g10.c: New command --card-status.
* card-util.c (card_status): New.
* call-agent.c (learn_status_cb): Parse more information.
* keylist.c (print_pubkey_info): Add FP arg for optional printing
to a stream. Changed all callers.
2003-07-23 Werner Koch <wk@gnupg.org>
* keygen.c (generate_keypair): Create an AUTHKEYTYPE entry for cards.
(do_generate_keypair): Abd generate the authkey.
(check_smartcard): Changed menu accordingly.
2003-07-22 Werner Koch <wk@gnupg.org>
* g10.c: New command --change-pin.
* card-util.c: New.
* call-agent.c (agent_scd_change_pin): New.
(agent_release_card_info): New.
* keygen.c (check_smartcard): Use it here.
2003-07-16 Werner Koch <wk@gnupg.org>
* export.c (parse_export_options): New option sexp-format.
(export_seckeys,export_secsubkeys): Check sexp-format option.
(do_export): Ignore armor for sexp format.
(do_export_stream): Handle sexp-format.
(write_sexp_line,write_sexp_keyparm, build_sexp_seckey): New.
(build_sexp): New.
2003-07-03 Werner Koch <wk@gnupg.org>
* options.h (DBG_CIPHER): Reintroduced it.
* seskey.c (encode_session_key): Debug output of the session key.
* pubkey-enc.c (get_it): Handle card case.
* call-agent.c (agent_scd_pkdecrypt): New.
* pkglue.c (pk_encrypt): Add RSA support.
* g10.c (main): Default to --use-agent.
* keygen.c (show_smartcard): Print info about the public key.
(check_smartcard): Check for existing key here.
(gen_card_key): And not anymore here.
(fpr_is_zero): New.
(generate_keypair): Generate both keys for a card.
(smartcard_change_url): Nw.
2003-07-02 Werner Koch <wk@gnupg.org>
* seckey-cert.c (is_secret_key_protected): Let it handle mode 1002.
2003-07-01 Werner Koch <wk@gnupg.org>
* keygen.c (gen_card_key): Obviously we should use the creation
date received from SCDAEMON, so that the fingerprints will match.
* sign.c (do_sign): Pass the serialno to the sign code.
* keyid.c (serialno_and_fpr_from_sk): New.
2003-06-30 Werner Koch <wk@gnupg.org>
* call-agent.h (agent_card_info_s): Add field serialno.
* call-agent.c (store_serialno): New.
(learn_status_cb): Store the serial number.
* keygen.c (gen_card_key): Store the serial number
(check_smartcard): New argument to return the serial number.
(generate_keypair): Get the serial number from check_smartcard and
store it as a parameter.
* parse-packet.c (parse_key): Use the protect.iv field to store the
serial number.
* build-packet.c (do_secret_key): Write the serial number.
2003-06-27 Werner Koch <wk@gnupg.org>
* seckey-cert.c (check_secret_key): Bypass the unprotection for
mode 1002.
* sign.c (do_sign): Handle card case (i.e. mode 1002).
2003-06-26 Werner Koch <wk@gnupg.org>
* build-packet.c (do_secret_key): Implement special protection
mode 1002.
* parse-packet.c (parse_key): Likewise.
* keygen.c (smartcard_gen_key): New.
* call-agent.c (agent_scd_setattr): New.
2003-06-24 Werner Koch <wk@gnupg.org>
* Makefile.am: Removed signal.c
* g10.c (emergency_cleanup): New.
(main): Use gnupg_init_signals and register malloc for assuan.
2003-06-23 Werner Koch <wk@gnupg.org>
* keyid.c (do_fingerprint_md): Made it work again.
2003-06-19 Werner Koch <wk@gnupg.org>
Fixed all "==" comparisons against error code constants to use
gpg_err_code().
* import.c (import_secret_one):
(import_revoke_cert):
(chk_self_sigs):
* misc.c (openpgp_md_map_name): Check also for the Hx format.
(openpgp_cipher_map_name): Check also for the Sx format.
(pubkey_get_npkey): Adjusted for changed gcrypt API.
(pubkey_get_nskey): Ditto.
(pubkey_get_nsig): Ditto.
(pubkey_get_nenc): Ditto.
2003-06-18 Werner Koch <wk@gnupg.org>
Finished the bulk of changes for gnupg 1.9. This included
switching 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.
* sig-check.c (cmp_help): Removed. Was never used.
* pkglue.c: New. Most stuff taken from gnupg 1.1.2.
* pkglue.h: New.
* misc.c (pull_in_libs): Removed.
* keygen.c (count_chr): New.
(ask_user_id): Removed faked RNG support.
* misc.c (openpgp_md_map_name,openpgp_cipher_map_name)
(openpgp_pk_map_name): New.
* skclist.c (build_sk_list): Removed faked RNG support.
(is_insecure): Removed.
* comment.c (make_mpi_comment_node): Use gcry MPI print function.
* keyid.c (v3_keyid): New.
* misc.c (mpi_write,mpi_write_opaque,mpi_read,mpi_read_opaque)
(mpi_print): New. Taken from gnupg 1.1.2.
(checksum_mpi): Replaced by implementation from 1.1.2.
* g10.c (my_strusage): Renamed from strusage and return NULL
instead calling a default function.
(add_to_strlist2): New. Taken from ../util/strgutil.c of gnupg 1.2.
* plaintext.c (handle_plaintext): New arg CREATE_FILE to cope with
the fact that gpg-error does not have this error code anymore.
* mainproc.c (symkey_decrypt_sesskey): Ditto.
* seskey.c (make_session_key): Adjusted for use with libgcrypt.
(encode_session_key): Ditto.
(do_encode_md): Ditto.
(encode_md_value): Ditto.
* keyring.c: Use libgpg-error instead of READ_ERROR etc.
* g10.c: Adjusted all algorithm name/id mapping functions.
(set_debug): Pass MPI and CRYPTO debug values to libgcrypt.
* Makefile.am (INCLUDES): Define LOCALEDIR and the default error
source.
* g10.c (i18n_init): s/G10_LOCALEDIR/LOCALEDIR/.
Renamed m_alloc et al to xmalloc et al.
s/g10_errstr/gpg_strerror/
s/MPI/gcry_mpi_t/
Adjusted all md_open calls to the libgcrypt API.
* build-packet.c (do_comment): Return error code from iobuf write
function.
(do_user_id): Ditto.
(do_public_key): Ditto.
* Makefile.am: Add new files, link gpg with libgpg-error.
* g10.c, options.h: New option --agent-program.
* call-agent.c: New.
* gpg.h, call-agent.h: New.
2003-06-03 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), keylist.c (list_keyblock_print): Add
"show-validity" and "show-long-keyid" list-options.
* gpgv.c (get_validity, trust_value_to_string): Stubs.
* g10.c (main): Use SAFE_VERSION instead of VERSION in the
version-specific gpg.conf file so it can be overridden on RISCOS.
2003-06-01 David Shaw <dshaw@jabberwocky.com>
* g10.c (main), keylist.c (show_policy_url, show_notation),
mainproc.c (check_sig_and_print): Emulate the old policy and
notation behavior (display by default). Send to status-fd whether
it is displayed on the screen or not.
* g10.c (main): Since we now have some options in devel that won't
work in a stable branch gpg.conf file, try for a version-specific
gpg.conf-VERSION file before falling back to gpg.conf.
* main.h, options.h: Move various option flags to options.h.
2003-05-31 David Shaw <dshaw@jabberwocky.com>
* mainproc.c (check_sig_and_print), main.h, keylist.c
(show_policy, show_notation): Collapse the old print_notation_data
into show_policy() and show_notation() so there is only one
function to print notations and policy URLs.
* options.h, main.h, g10.c (main), keyedit.c
(print_and_check_one_sig), keylist.c (list_one,
list_keyblock_print), pkclist.c (do_edit_ownertrust), sign.c
(mk_notation_and_policy): New "list-options" and "verify-options"
commands. These replace the existing
--show-photos/--no-show-photos,
--show-notation/--no-show-notation,
--show-policy-url/--no-show-policy-url, and --show-keyring
options. The new method is more flexible since a user can specify
(for example) showing photos during sig verification, but not in
key listings. The old options are emulated.
* main.h, misc.c (parse_options): New general option line
parser. Fix the bug in the old version that did not handle report
syntax errors after a valid entry.
* import.c (parse_import_options), export.c
(parse_export_options): Call it here instead of duplicating the
code.
2003-05-30 David Shaw <dshaw@jabberwocky.com>
* keylist.c (list_one): Don't show the keyring filename when in
--with-colons mode. Actually translate "Keyring" string.
* mainproc.c (proc_tree): We can't currently handle multiple
signatures of different classes or digests (we'd pretty much have
to run a different hash context for each), but if they are all the
same, make an exception. This is Debian bug #194292.
* sig-check.c (check_key_signature2): Make string translatable.
* packet.h, getkey.c (fixup_uidnode): Mark real primary uids
differently than assumed primaries.
* keyedit.c (no_primary_warning): Use the differently marked
primaries here in a new function to warn when an --edit-key
command might rearrange the self-sig dates enough to change which
uid is primary.
(menu_expire, menu_set_preferences): Use no_primary_warning()
here.
* Makefile.am: Use @DLLIBS@ for -ldl.
2003-05-26 David Shaw <dshaw@jabberwocky.com>
* getkey.c (premerge_public_with_secret): Made "no secret subkey
for" warning a verbose item and translatable. (From wk on stable
branch)
* sig-check.c (check_key_signature2): Made "no subkey for subkey
binding packet" a verbose item instead of a !quiet one. There are
too many garbled keys out in the wild. (From wk on stable branch)
* filter.h: Remove const from WHAT. (From wk on stable branch)
* progress.c (handle_progress): Store a copy of
NAME. (progress_filter): Release WHAT, make sure not to print a
NULL WHAT. (From wk on stable branch)
* openfile.c (open_sigfile): Adjust free for new progress
semantics. (From wk on stable branch)
* plaintext.c (ask_for_detached_datafile): Don't dealloc
pfx->WHAT. (From wk on stable branch)
* seckey-cert.c (do_check): Issue the RSA_OR_IDEA status when the
cipher algo is IDEA to make it easier to track down the
problem. (From twoaday on stable branch)
2003-05-24 David Shaw <dshaw@jabberwocky.com>
* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c,
build-packet.c, getkey.c, keydb.c, openfile.c, plaintext.c,
status.c, gpgv.c, keygen.c, options.h, sig-check.c, tdbio.h,
encode.c, mainproc.c, parse-packet.c, signal.c, textfilter.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-05-21 David Shaw <dshaw@jabberwocky.com>
* trustdb.h, trustdb.c (is_disabled), gpgv.c (is_disabled): Rename
is_disabled to cache_disabled_value, which now takes a pk and not
just the keyid. This is for speed since there is no need to
re-fetch a key when we already have that key handy. Cache the
result of the check so we don't need to hit the trustdb more than
once.
* getkey.c (skip_disabled): New function to get a pk and call
is_disabled on it. (key_byname): Use it here.
* packet.h, getkey.c (skip_disabled), keylist.c
(print_capabilities): New "pk_is_disabled" macro to retrieve the
cached disabled value if available, and fill it in via
cache_disabled_value if not available.
* trustdb.c (get_validity): Cache the disabled value since we have
it handy and it might be useful later.
* parse-packet.c (parse_key): Clear disabled flag when parsing a
new key. Just in case someone forgets to clear the whole key.
* getkey.c (merge_selfsigs_main): Add an "if all else fails" path
for setting a single user ID primary when there are multiple set
primaries all at the same second, or no primaries set and the most
recent user IDs are at the same second, or no signed user IDs at
all. This is arbitrary, but deterministic.
* exec.h, photoid.h: Add copyright message.
* keylist.c (list_keyblock_print): Don't dump attribs for
revoked/expired/etc uids for non-colon key listings. This is for
consistency with --show-photos.
* main.h, keylist.c (dump_attribs), mainproc.c
(check_sig_and_print): Dump attribs if --attrib-fd is set when
verifying signatures.
* g10.c (main): New --gnupg option to disable the various
--openpgp, --pgpX, etc. options. This is the same as --no-XXXX
for those options.
* revoke.c (ask_revocation_reason): Clear old reason if user
elects to repeat question. This is bug 153.
* keyedit.c (sign_uids): Show keyid of the key making the
signature.
2003-05-21 Werner Koch <wk@gnupg.org>
* progress.c (handle_progress)
* sign.c (write_plaintext_packet)
* encode.c (encode_simple,encode_crypt): Make sure that a filename
of "-" is considered to be stdin so that iobuf_get_filelength
won't get called. This fixes bug 156 reported by Gregery Barton.
2003-05-02 David Shaw <dshaw@jabberwocky.com>
* packet.h, build-packet.c (build_sig_subpkt), export.c
(do_export_stream), import.c (remove_bad_stuff, import),
parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt): Remove
vestigal code for the old sig cache subpacket. This wasn't
completely harmless as it caused subpacket 101 to disappear on
import and export.
* options.h, armor.c, cipher.c, g10.c, keyedit.c, pkclist.c,
sign.c, encode.c, getkey.c, revoke.c: The current flags for
different levels of PGP-ness are massively complex. This is step
one in simplifying them. No functional change yet, just use a
macro to check for compliance level.
* sign.c (sign_file): Fix bug that causes spurious compression
preference warning.
* sign.c (clearsign_file): Fix bug that prevents proper warning
message from appearing when clearsigning in --pgp2 mode with a
non-v3 RSA key.
* main.h, misc.c (compliance_option_string, compliance_string,
compliance_failure), pkclist.c (build_pk_list), sign.c (sign_file,
clearsign_file), encode.c (encode_crypt,
write_pubkey_enc_from_list): New functions to put the "this
message may not be usable...." warning in one place.
* options.h, g10.c (main): Part two of the simplification. Use a
single enum to indicate what we are compliant to (1991, 2440,
PGPx, etc.)
* g10.c (main): Show errors for failure in export, send-keys,
recv-keys, and refresh-keys.
* options.h, g10.c (main): Give algorithm warnings for algorithms
chosen against the --pgpX and --openpgp rules.
* keydb.h, pkclist.c (algo_available): Make TIGER192 invalid in
--openpgp mode.
* sign.c (sign_file), pkclist.c (algo_available): Allow passing a
hint of 0.
2003-05-01 David Shaw <dshaw@jabberwocky.com>
* tdbio.c (create_version_record): Only create new trustdbs with
TM_CLASSIC or TM_PGP.
* trustdb.h, trustdb.c (trust_string, get_ownertrust_string,
get_validity_string, ask_ownertrust, validate_keys), pkclist.c
(do_edit_ownertrust): Rename trust_string to trust_value_to_string
for naming consistency.
* trustdb.h, trustdb.c (string_to_trust_value): New function to
translate a string to a trust value.
* g10.c (main): Use string_to_trust_value here for
--force-ownertrust.
* options.h, g10.c (main), trustdb.c (trust_model_string,
init_trustdb, check_trustdb, update_trustdb, get_validity,
validate_one_keyblock): An "OpenPGP" trust model is misleading
since there is no official OpenPGP trust model. Use "PGP"
instead.
2003-04-30 David Shaw <dshaw@jabberwocky.com>
* build-packet.c (build_sig_subpkt): Comments.
* exec.c (exec_write): Cast NULL to void* to properly terminate
varargs list.
* keyedit.c (show_key_with_all_names): Just for safety, catch an
invalid pk algorithm.
* sign.c (make_keysig_packet): Crucial that the call to mksubpkt
comes LAST before the calls to finalize the sig as that makes it
possible for the mksubpkt function to get a reliable pointer to
the subpacket area.
* pkclist.c (do_we_trust_pre): If an untrusted key was chosen by a
particular user ID, use that ID as the one to ask about when
prompting whether to use the key anyway.
(build_pk_list): Similar change here when adding keys to the
recipient list.
* trustdb.c (update_validity): Fix bug that prevented more than
one validity record per trust record.
(get_validity): When retrieving validity for a (user) supplied
user ID, return the validity for that user ID only, and do not
fall back to the general key validity.
(validate_one_keyblock): Some commentary on whether
non-self-signed user IDs belong in the web of trust (arguably,
they do).
2003-04-27 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Add --no-textmode.
* export.c (do_export_stream), keyedit.c (show_key_with_all_names,
menu_addrevoker), mainproc.c (check_sig_and_print), photoid.c
(show_photos), sign.c (mk_notation_and_policy), trustdb.c
(get_validity, reset_trust_records, validate_keys): Make some
strings translatable.
* mainproc.c (check_sig_and_print): Show digest algorithm and sig
class when verifying a sig with --verbose on, and add version, pk
and hash algorithms and sig class to VALIDSIG.
* parse-packet.c (enum_sig_subpkt): Make a warning message a
--verbose warning message since we don't need to warn every time
we see an unknown critical (we only need to invalidate the
signature).
* trustdb.c (init_trustdb): Check the trustdb options even with
TM_AUTO since the auto may become TM_CLASSIC or TM_OPENPGP.
2003-04-26 David Shaw <dshaw@jabberwocky.com>
* sign.c (do_sign): Show the hash used when making a signature in
verbose mode.
* tdbio.h, tdbio.c (tdbio_read_model): New function to return the
trust model used in a given trustdb.
* options.h, g10.c (main), trustdb.c (init_trustdb, check_trustdb,
update_trustdb): Use tdbio_read_model to implement an "auto" trust
model which is set via the trustdb.
2003-04-23 David Shaw <dshaw@jabberwocky.com>
* import.c (import_revoke_cert): Remove ultimate trust when
revoking an ultimately trusted key.
* keyedit.c (sign_uids): Allow replacing expired signatures.
Allow duplicate signatures with --expert.
* pkclist.c (check_signatures_trust): Don't display a null
fingerprint when checking a signature with --always-trust enabled.
* filter.h (progress_filter_context_t), progress.c
(handle_progress), plaintext.c (ask_for_detached_datafile,
hash_datafiles): Fix compiler warnings. Make "what" constant.
* build-packet.c (do_plaintext): Do not create invalid literal
packets with >255-byte names.
2003-04-15 Werner Koch <wk@gnupg.org>
* Makefile.am (AM_CFLAGS): Make use of AM_CFLAGS and AM_LDFLAGS.
* g10.c, options.h: New option --enable-progress-filter.
* progress.c (handle_progress): Make use of it.
2003-04-15 Marcus Brinkmann <marcus@g10code.de>
* progress.c: New file.
* Makefile.am (common_source): Add progress.c.
* filter.h (progress_filter_context_t): New type.
(progress_filter, handle_progress): New prototypes.
* main.h (open_sigfile): New argument for prototype.
* openfile.c (open_sigfile): New argument to install progress
filter.
* encode.c (encode_simple): New variable PFX. Register
progress filter. Install text_filter after that.
(encode_crypt): Likewise.
* sign.c (sign_file): Likewise.
(clearsign_file): Likewise.
* decrypt.c (decrypt_message): Likewise.
(decrypt_messages): Likewise.
* verify.c (verify_signatures): Likewise.
(verify_one_file): Likewise.
* plaintext.c (hash_datafiles): Likewise.
(ask_for_detached_datafile): Likewise.
2003-04-10 Werner Koch <wk@gnupg.org>
* passphrase.c (read_passphrase_from_fd): Do a dummy read if the
agent is to be used. Noted by Ingo Klöcker.
(agent_get_passphrase): Inhibit caching when we have no
fingerprint. This is required for key generation as well as for
symmetric only encryption.
* passphrase .c (agent_get_passphrase): New arg CANCELED.
(passphrase_to_dek): Ditto. Passed to above. Changed all
callers to pass NULL.
* seckey-cert.c (do_check): New arg CANCELED.
(check_secret_key): Terminate loop when canceled.
* keyedit.c (change_passphrase): Pass ERRTEXT untranslated to
passphrase_to_dek and translate where appropriate.
* seckey-cert.c (check_secret_key): Ditto.
* keygen.c (ask_passphrase): Ditto.
* passphrase.c (agent_get_passphrase): Translate the TRYAGAIN_TEXT.
Switch the codeset to utf-8.
2003-04-09 Werner Koch <wk@gnupg.org>
* decrypt.c (decrypt_messages): Fixed error handling; the function
used to re-loop with same file after an error. Reported by Joseph
Walton.
2003-04-08 David Shaw <dshaw@jabberwocky.com>
* main.h, g10.c (main), import.c (parse_import_options,
fix_pks_corruption): It's really PKS corruption, not HKP
corruption. Keep the old repair-hkp-subkey-bug command as an
alias.
* g10.c (main): Rename --no-version to --no-emit-version for
consistency. Keep --no-version as an alias.
2003-04-04 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (algo_available): PGP 8 can use the SHA-256 hash.
* sign.c (sign_file, clearsign_file, sign_symencrypt_file): Remove
unused code.
2003-04-01 Werner Koch <wk@gnupg.org>
* mainproc.c (check_sig_and_print): Add primary key fpr to VALIDSIG
status.
2003-03-24 David Shaw <dshaw@jabberwocky.com>
* keydb.h: Err on the side of making an unknown signature a SIG
rather than a CERT.
* import.c (delete_inv_parts): Discard any key signatures that
aren't key types (i.e. 0x00, 0x01, etc.)
* g10.c (main): Add deprecated option warning for
--list-ownertrust. Add --compression-algo alias for
--compress-algo. Change --version output strings to match
"showpref" strings, and make translatable.
* status.c (do_get_from_fd): Accept 'y' as well as 'Y' for
--command-fd boolean input.
* trustdb.c: Fix typo (DISABLE_REGEXP -> DISABLE_REGEX)
* keyedit.c (show_key_with_all_names_colon): Show no-ks-modify
flag.
2003-03-11 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), keyserver.c (kopts): Add "try-dns-srv"
keyserver option. Defaults to on.
* passphrase.c (agent_get_passphrase): Fix memory leak with
symmetric messages. Fix segfault with symmetric messages. Fix
incorrect prompt with symmetric messages.
2003-03-10 Werner Koch <wk@gnupg.org>
* compress.c (init_uncompress): Use a 15 bit window size so that
the output of implementations which don't run for PGP 2
compatibility won't get garbled.
2003-03-04 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (validate_keys): Mask the ownertrust when building the
list of fully valid keys so that disabled keys are still counted
in the web of trust.
(get_ownertrust_with_min): Do the same for the minimum ownertrust
calculation.
* parse-packet.c (dump_sig_subpkt): Show the notation names for
not-human-readable notations. Fix cosmetic off-by-one length
counter.
* options.skel: Add explantion and commented-out
"no-mangle-dos-filenames".
* mainproc.c (proc_encrypted): Make string translatable.
* keyserver.c (keyserver_spawn): Quote ':', '%', and any 8-bit
characters in the uid strings sent to the keyserver helper.
* keyring.c (keyring_rebuild_cache): Lock the keyring while
rebuilding the signature caches to prevent another gpg from
tampering with the temporary copy.
* keygen.c (keygen_set_std_prefs): Include AES192 and AES256 in
default prefs.
* keyedit.c (show_prefs): Make strings translatable.
* keydb.c: Double the maximum number of keyrings to 40.
* gpgv.c (main): Fix bug #113 - gpgv should accept the
--ignore-time-conflict option.
* g10.c (main): --openpgp disables --pgpX. Double the amount of
secure memory to 32k (keys are getting bigger these days).
* Makefile.am: Makefile.am: Use @CAPLIBS@ to link in -lcap if we
are using capabilities.
2003-02-26 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Include various pieces of
information about the key in the data sent to the keyserver
helper. This allows the helper to use it in instructing a remote
server which may not have any actual OpenPGP smarts in parsing
keys.
* main.h, export.c (export_pubkeys_stream, do_export_stream): Add
ability to return only the first match in an exported keyblock for
keyserver usage. This should be replaced at some point with a
more flexible solution where each key can be armored seperately.
2003-02-22 David Shaw <dshaw@jabberwocky.com>
* sign.c (sign_file): Do not push textmode filter onto an unopened
IOBUF (segfault). Noted by Marcus Brinkmann. Push and
reinitialize textmode filter for each file in a multiple file
list.
* packet.h, getkey.c (fixup_uidnode), keyedit.c (show_prefs): Set
and show the keyserver no-modify flag.
* keygen.c (add_keyserver_modify): New.
(keygen_upd_std_prefs): Call it here.
(keygen_set_std_prefs): Accept "ks-modify" and "no-ks-modify" as
prefs to set and unset keyserver modify flag.
* g10.c (main): Accept "s1" in addition to "idea" to match the
other ciphers.
* main.h, misc.c (idea_cipher_warn): We don't need this if IDEA
has been disabled.
2003-02-21 David Shaw <dshaw@jabberwocky.com>
* keygen.c (keygen_set_std_prefs): Don't put AES or CAST5 in
default prefs if they are disabled.
* g10.c (main): Use 3DES instead of CAST5 if we don't have CAST5
support. Use 3DES for the s2k cipher in --openpgp mode.
(print_mds): #ifdef all of the optional digest algorithms.
2003-02-12 David Shaw <dshaw@jabberwocky.com>
* keydb.h, getkey.c (classify_user_id, classify_user_id2): Make
'exact' a per-desc item. Merge into one function since
'force_exact' is no longer needed.
(key_byname): Use new classify_user_id function, and new exact
flag in KEYDB_SEARCH_DESC.
* keyring.h, keyring.c (keyring_search): Return an optional index
to show which KEYDB_SEARCH_DESC was the matching one.
* keydb.h, keydb.c (keydb_search): Rename to keydb_search2, and
pass the optional index to keyring_search. Add a macro version of
keydb_search that calls this new function.
* export.c (do_export_stream): If the keyid! syntax is used,
export only that specified key. If the key in question is a
subkey, export the primary plus that subkey only.
2003-02-11 David Shaw <dshaw@jabberwocky.com>
* exec.c (set_exec_path): Add debugging line.
* g10.c (print_hex, print_mds): Print long hash strings a lot
neater. This assumes at least an 80-character display, as there
are a few other similar assumptions here and there. Users who
need unformatted hashes can still use with-colons. Check that
SHA384 and 512 are available before using them as they are no
longer always available.
* Makefile.am: Use a local copy of libexecdir along with @PACKAGE@
as GNUPG_LIBEXECDIR so it can be easily overridden at make time.
2003-02-04 David Shaw <dshaw@jabberwocky.com>
* armor.c (parse_hash_header, armor_filter): Accept the new SHAs
in the armor Hash: header.
* g10.c (print_hex): Print long hash strings a little neater.
(print_mds): Add the new SHAs to the hash list.
2003-02-02 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_revuid): Properly handle a nonselfsigned uid on
a v4 key (treat as a v4 revocation).
* import.c (print_import_check): Do not re-utf8 convert user IDs.
2003-01-27 David Shaw <dshaw@jabberwocky.com>
* mainproc.c (list_node): Show signature expiration date in
with-colons sig records.
* keylist.c (list_keyblock_colon), mainproc.c (list_node): Show
trust sig information in with-colons sig records.
2003-01-16 David Shaw <dshaw@jabberwocky.com>
* g10.c (add_group): Trim whitespace after a group name so it does
not matter where the user puts the = sign.
* options.skel: Comment out the first three lines in case someone
manually copies the skel file to their homedir.
* sign.c (clearsign_file): Only use pgp2mode with v3 keys and
MD5. This matches what we do when decoding such messages and
prevents creating a message (v3+RIPEMD/160) that we can't verify.
* sig-check.c (signature_check2): Use G10ERR_GENERAL as the error
for signature digest conflict. BAD_SIGN implies that a signature
was checked and we may try and print out a user ID for a key that
doesn't exist.
2003-01-15 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (init_trustdb, get_validity): Don't use a changed
trust model to indicate a dirty trustdb, and never auto-rebuild a
dirty trustdb with the "always" trust model.
* g10.c (add_group): Last commit missed the \t ;)
2003-01-14 David Shaw <dshaw@jabberwocky.com>
* packet.h, parse-packet.c (setup_user_id), free-packet.c
(free_user_id), keydb.h, keyid.c (namehash_from_uid): New function
to rmd160-hash the contents of a user ID packet and cache it in
the uid object.
* keylist.c (list_keyblock_colon): Use namehash in field 8 of
uids. Show dates for creation (selfsig date), and expiration in
fields 6 and 7.
* trustdb.c (get_validity, get_validity_counts, update_validity):
Use new namehash function rather than hashing it locally.
2003-01-14 Werner Koch <wk@gnupg.org>
* g10.c (add_group): Fixed group parsing to allow more than one
delimiter in a row and also allow tab as delimiter.
2003-01-12 David Shaw <dshaw@jabberwocky.com>
* tdbio.c (tdbio_set_dbname): Fix assertion failure with
non-fully-qualified trustdb names.
2003-01-11 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (get_validity_info, get_ownertrust_info,
trust_letter): Simplify by returning a ? for error directly.
* keyedit.c (show_key_with_all_names): Use get_validity_string and
get_ownertrust_string to show full word versions of trust
(i.e. "full" instead of 'f').
* trustdb.h, trustdb.c (get_ownertrust_string,
get_validity_string): Same as get_ownertrust_info, and
get_validity_info, except returns a full string.
* trustdb.c (get_ownertrust_with_min): New. Same as
'get_ownertrust' but takes the min_ownertrust value into account.
2003-01-10 David Shaw <dshaw@jabberwocky.com>
* armor.c (armor_filter): Comment about PGP's end of line tab
problem.
* trustdb.h, trustdb.c (trust_letter): Make
static. (get_ownertrust_info, get_validity_info): Don't mask the
trust level twice.
* trustdb.h, gpgv.c, trustdb.c (get_validity, get_validity_info),
keylist.c (list_keyblock_colon), keyedit.c
(show_key_with_all_names_colon, menu_revuid): Pass a user ID in
rather than a namehash, so we only have to do the hashing in one
place.
* packet.h, pkclist.c (build_pk_list), free-packet.c
(release_public_key_parts): Remove unused namehash element for
public keys.
2003-01-07 David Shaw <dshaw@jabberwocky.com>
* keygen.c (keygen_set_std_prefs): Warn when setting an IDEA
preference when IDEA is not available.
2003-01-06 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (get_validity_info): 'd' for disabled is not a
validity value any more.
* packet.h, tdbio.h, tdbio.c (tdbio_read_record,
tdbio_write_record), trustdb.c (update_validity): Store temporary
full & marginal counts in the trustdb.
(clear_validity, get_validity_counts): Return and clear temp
counts.
(store_validation_status): Keep track of which keyids have been
stored.
(validate_one_keyblock, validate_key_list): Use per-uid copies of
the full & marginal counts so they can be recalled for multiple
levels.
(validate_keys): Only use unused keys for each new round.
(reset_unconnected_keys): Rename to reset_trust_records, and only
skip specifically excluded records.
* keylist.c (print_capabilities): Show 'D' for disabled keys in
capabilities section.
* trustdb.c (is_disabled): Remove incorrect comment.
2003-01-03 David Shaw <dshaw@jabberwocky.com>
* import.c (import_one): Only do the work to create the status
display for interactive import if status is enabled.
* keyring.c (keyring_search): skipfnc didn't work properly with
non-keyid searches. Noted by Stefan Bellon.
* getkey.c (merge_selfsigs_main): Remove some unused code and make
sure that the pk selfsigversion member accounts for 1F direct
sigs.
2003-01-02 Werner Koch <wk@gnupg.org>
* keydb.c (keydb_add_resource): Don't assume that try_make_homedir
terminates but check again for the existence of the directory and
continue then.
* openfile.c (copy_options_file): Print a warning if the skeleton
file has active options.
2002-12-29 David Shaw <dshaw@jabberwocky.com>
* getkey.c (merge_selfsigs_main), main.h, sig-check.c
(check_key_signature2): Pass the ultimately trusted pk directly to
check_key_signature2 to avoid going through the key selection
mechanism. This prevents a deadly embrace when two keys without
selfsigs each sign the other.
2002-12-27 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_refresh): Don't print the "refreshing..."
line if there are no keys to refresh or if there is no keyserver
set.
* getkey.c (merge_selfsigs_main): Any valid user ID should make a
key valid, not just the last one. This also fixes Debian bug
#174276.
2002-12-27 Stefan Bellon <sbellon@sbellon.de>
* import.c (print_import_check): Changed int to size_t.
2002-12-27 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (keyedit_menu, menu_revuid): Add "revuid" feature to
revoke a user ID. This is the same as issuing a revocation for
the self-signature, but a much simpler interface to do it.
2002-12-26 David Shaw <dshaw@jabberwocky.com>
* keydb.h, getkey.c (key_byname): Flag to enable or disable
including disabled keys. Keys specified via keyid (i.e. 0x...)
are always included.
* getkey.c (get_pubkey_byname, get_seckey_byname2,
get_seckey_bynames), keyedit.c (keyedit_menu, menu_addrevoker):
Include disabled keys in these functions.
* pkclist.c (build_pk_list): Do not include disabled keys for -r
or the key prompt. Do include disabled keys for the default key
and --encrypt-to.
* trustdb.h, trustdb.c (is_disabled): New skipfnc for skipping
disabled keys.
* gpgv.c (is_disabled): Stub.
* keygen.c (keygen_add_key_expire): Properly handle updating a key
expiration to a no-expiration value.
* keyedit.c (enable_disable_key): Comment.
* import.c (import_one): When in interactive mode and --verbose,
don't repeat some key information twice.
2002-12-22 Timo Schulz <ts@winpt.org>
* import.c (print_import_check): New.
(import_one): Use it here.
Use merge_keys_and_selfsig in the interactive mode to avoid
wrong key information.
* status.h: Add new status code.
* status.c: Ditto.
2002-12-13 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (do_we_trust): Tweak language to refer to the "named
user" rather than "owner". Noted by Stefan Bellon.
* trustdb.h, trustdb.c (trustdb_pending_check): New function to
check if the trustdb needs a check.
* import.c (import_keys_internal): Used here so we don't rebuild
the trustdb if it is still clean.
(import_one, chk_self_sigs): Only mark trustdb dirty if the key
that is being imported has any sigs other than self-sigs.
Suggested by Adrian von Bidder.
* options.skel: Include the required '=' sign in the sample
'group' option. Noted by Stefan Bellon.
* import.c (chk_self_sigs): Don't try and check a subkey as if it
was a signature.
2002-12-11 David Shaw <dshaw@jabberwocky.com>
* tdbio.c (tdbio_read_record, tdbio_write_record): Compact the
RECTYPE_TRUST records a bit.
* g10.c (main): Comment out --list-trust-path until it can be
implemented.
* import.c (import_one): Warn when importing an Elgamal primary
that this may take some time (to verify self-sigs).
(chk_self_sigs): Try and cache all self-sigs so the keyblock is
written to the keyring with a good rich cache.
* keygen.c (ask_algo): Make the Elgamal sign+encrypt warning
stronger, and remove the RSA sign+encrypt warning.
2002-12-06 Stefan Bellon <sbellon@sbellon.de>
* options.h: Fixed typo (mangle_dos_names instead of
mangle_dos_filenames).
2002-12-05 Werner Koch <wk@gnupg.org>
* g10.c: New options --[no-]mangle-dos-filenames.
* options.h (opt): Added mangle-dos-filenames.
* openfile.c (open_outfile) [USE_ONLY_8DOT3]: Truncate the
filename only when this option is set; this is the default.
2002-12-04 David Shaw <dshaw@jabberwocky.com>
* main.h, keyedit.c, keygen.c: Back out previous (2002-12-01)
change. Minimal isn't always best.
* sign.c (update_keysig_packet): Use the current time rather then
a modification of the original signature time. Make sure that
this doesn't cause a time warp.
* keygen.c (keygen_add_key_expire): Properly handle a key
expiration date in the past (use a duration of 0).
* keyedit.c (menu_expire): Use update_keysig_packet so any sig
subpackets are maintained during the update.
* build-packet.c (build_sig_subpkt): Mark sig expired or unexpired
when the sig expiration subpacket is added.
(build_sig_subpkt_from_sig): Handle making an expiration subpacket
from a sig that has already expired (use a duration of 0).
* packet.h, sign.c (update_keysig_packet), keyedit.c
(menu_set_primary_uid, menu_set_preferences): Add ability to issue
0x18 subkey binding sigs to update_keysig_packet and change all
callers.
* trustdb.c (validate_keys): Show trust parameters when building
the trustdb, and make sure that the version record update was
successful.
(init_trustdb): If the current parameters aren't what was used for
building the trustdb, the trustdb is invalid.
* tbio.c (tdbio_db_matches_options): Update to work with new
trustdbs.
2002-12-03 David Shaw <dshaw@jabberwocky.com>
* tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record): Store
trust model in the trustdb version record.
(tdbio_update_version_record): New function to update version
record values during a trustdb check or update.
(tdbio_dump_record): Show trust model in dump.
* trustdb.c (validate_keys): Call tdbio_update_version_record on
success so that the correct options are stored in the trustdb.
* options.h: rearrange trust models so that CLASSIC is 0 and
OPENPGP is 1.
* options.h, g10.c (main), encode.c (write_pubkey_enc_from_list),
pkclist.c (algo_available), revoke.c (gen_revoke): Add --pgp8
mode. This is basically identical to --pgp7 in all ways except
that signing subkeys, v4 data sigs (including expiration), and SK
comments are allowed.
* getkey.c (finish_lookup): Comment.
* main.h, keylist.c (reorder_keyblock), keyedit.c (keyedit_menu):
Reorder user ID display in the --edit-key menu to match that of
the --list-keys display.
* g10.c (add_notation_data): Fix initialization.
2002-12-01 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_expire): Don't lose key flags when changing the
expiration date of a subkey. This is not the most optimal
solution, but it is minimal change on the stable branch.
* main.h, keygen.c (do_copy_key_flags): New function to copy key
flags, if any, from one sig to another.
(do_add_key_expire): New function to add key expiration to a sig.
(keygen_copy_flags_add_expire): New version of
keygen_add_key_expire that also copies key flags.
(keygen_add_key_flags_and_expire): Use do_add_key_expire.
* import.c (fix_hkp_corruption): Comment.
2002-11-25 Stefan Bellon <sbellon@sbellon.de>
* plaintext.c (handle_plaintext) [__riscos__]: If nooutput is set,
no filetype is needed obviously.
2002-11-24 David Shaw <dshaw@jabberwocky.com>
* main.h, misc.c (default_cipher_algo, default_compress_algo):
New. Return the default algorithm by trying
--cipher-algo/--compress-algo, then the first item in the pref
list, then s2k-cipher-algo or ZIP.
* sign.c (sign_file, sign_symencrypt_file), encode.c
(encode_simple, encode_crypt): Call default_cipher_algo and
default_compress_algo to get algorithms.
* g10.c (main): Allow pref selection for compress algo with
--openpgp.
* mainproc.c (proc_encrypted): Use --s2k-digest-algo for
passphrase mangling rather than --digest-algo.
* sign.c (hash_for): If --digest-algo is not set, but
--personal-digest-preferences is, then use the first hash
algorithm in the personal list. If the signing algorithm is DSA,
then use the first 160-bit hash algorithm in the personal list.
If --pgp2 is set and it's a v3 RSA key, use MD5.
* g10.c (main), keydb.c (keydb_add_resource,
keydb_locate_writable): Rename --default-keyring as
--primary-keyring. Stefan wins the naming contest.
2002-11-23 David Shaw <dshaw@jabberwocky.com>
* g10.c (add_notation_data): Disallow notation names that do not
contain a '@', unless --expert is set. This is to help prevent
people from polluting the (as yet unused) IETF namespace.
* main.h: Comments about default algorithms.
* photoid.c (image_type_to_string): Comments about 3-letter file
extensions.
* encode.c (encode_simple), passphrase.c (passphrase_to_dek),
sign.c (sign_symencrypt_file): Use --s2k-digest-algo for
passphrase mangling rather than --digest-algo.
2002-11-21 David Shaw <dshaw@jabberwocky.com>
* keygen.c (keygen_set_std_prefs): Properly handle an empty
preference string.
* misc.c (string_to_compress_algo): "none" is a bad choice since
it conflicts with the "none" in setpref.
2002-11-14 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Allow compression algorithm names as the argument
to --compress-algo. The old algorithm names still work for
backwards compatibility.
* misc.c (string_to_compress_algo): Allow "none" as an alias for
"uncompressed".
2002-11-13 Stefan Bellon <sbellon@sbellon.de>
* getkey.c (get_pubkey_byfprint_fast): Fixed type incompatibility,
was unsigned char instead of byte.
2002-11-13 David Shaw <dshaw@jabberwocky.com>
* encode.c (encode_simple): Make sure that files larger than about
4G use partial length encoding. This is required because OpenPGP
allows only for 32 bit length fields. From Werner on stable
branch.
* getkey.c (get_pubkey_direct): Renamed to...
(get_pubkey_fast): this and made extern.
(get_pubkey_byfprint_fast): New. From Werner on stable branch.
* keydb.h, import.c (import_one): Use get_pubkey_fast instead of
get_pubkey. We don't need a merged key and actually this might
lead to recursions.
(revocation_present): Likewise for search by fingerprint. From
Werner on stable branch.
* g10.c (main): Try to create the trustdb even for non-colon-mode
list-key operations. This is required because getkey needs to
know whether a a key is ultimately trusted. From Werner on stable
branch.
* exec.c [__CYGWIN32__]: Keep cygwin separate from Mingw32;
we don't need it here as it behaves more like a Posix system.
From Werner on stable branch.
* passphrase.c (agent_get_passphrase): Ditto. From Werner on
stable branch.
* tdbio.c (MY_O_BINARY): Need binary mode with Cygwin. From
Werner on stable branch.
* g10.c, gpgv.c (main) [__CYGWIN32__]: Don't get the homedir from
the registry. From Werner on stable branch.
* keyedit.c (show_key_with_all_names_colon): Make --with-colons
--edit display match the validity and trust of --with-colons
--list-keys.
* passphrase.c (agent_send_all_options): Fix compile warning.
* keylist.c (list_keyblock_colon): Validity for subkeys should
match that of the primary key, and not that of the last user ID.
* getkey.c (merge_selfsigs): Revoked/expired/invalid primary keys
carry these facts onto all their subkeys, but only after the
subkey has a chance to be marked valid. This is to fix an
incorrect "invalid public key" error verifying a signature made by
a revoked signing subkey, with a valid unrevoked primary key.
2002-11-09 Werner Koch <wk@gnupg.org>
* passphrase.c (agent_send_all_options): Use tty_get_ttyname to
get the default ttyname.
2002-11-07 David Shaw <dshaw@jabberwocky.com>
* keyring.h, keyring.c (keyring_register_filename): Return the
pointer if a given keyring is registered twice.
* keydb.h, keydb.c (keydb_add_resource): Use flags to indicate a
default keyring.
(keydb_locate_writable): Prefer the default keyring if possible.
* g10.c (main): Add --default-keyring option.
2002-11-06 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), trustdb.c (ask_ownertrust): Add
--force-ownertrust option for debugging purposes. This allows
setting a whole keyring to a given trust during an
--update-trustdb. Not for normal use - it's just easier than
hitting "4" all the time to test a large trustdb.
* pubkey-enc.c (get_session_key): With hidden recipients or try a
given passphrase against all secret keys rather than trying all
secret keys in turn. Don't if --try-all-secrets or --status-fd is
enabled.
* passphrase.c (passphrase_to_dek): Mode 1 means do a regular
passphrase query, but don't prompt with the key info.
* seckey-cert.c (do_check, check_secret_key): A negative ask count
means to enable passphrase mode 1.
* keydb.h, getkey.c (enum_secret_keys): Add flag to include
secret-parts-missing keys (or not) in the list.
2002-11-05 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_search_prompt): When --with-colons is
enabled, don't try and fit the search output to the screen size -
just dump the whole list.
2002-11-04 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_search_prompt): When --with-colons is
enabled, just dump the raw keyserver protocol to stdout and don't
print the menu.
* keyserver.c (show_prompt): Don't show a prompt when command-fd
is being used.
* trustdb.c (trust_model_string, check_trustdb, update_trustdb,
validate_one_keyblock): It's not clear what a trustdb rebuild or
check means with a trust model other than "classic" or "openpgp",
so disallow this.
2002-11-03 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main): Add --trust-model option. Current
models are "openpgp" which is classic+trustsigs, "classic" which
is classic only, and "always" which is the same as the current
option --always-trust (which still works). Default is "openpgp".
* trustdb.c (validate_one_keyblock): Use "openpgp" trust model to
enable trust sigs.
* gpgv.c (main), mainproc.c (check_sig_and_print), pkclist.c
(do_we_trust, do_we_trust_pre, check_signatures_trust): Use new
--trust-model option in place of --always-trust.
* keyedit.c (sign_mk_attrib, trustsig_prompt, sign_uids,
keyedit_menu): Prompt for and create a trust signature with
"tsign". This is functional, but needs better UI text.
* build-packet.c (build_sig_subpkt): Able to build trust and
regexp subpackets.
* pkclist.c (do_edit_ownertrust): Comment.
2002-11-02 David Shaw <dshaw@jabberwocky.com>
* keygen.c (set_one_pref, keygen_set_std_prefs): Allow using the
full algorithm name (CAST5, SHA1) rather than the short form (S3,
H2).
* main.h, keygen.c (keygen_get_std_prefs), keyedit.c
(keyedit_menu): Return and use a fake uid packet rather than a
string since we already have a nice parser/printer in
keyedit.c:show_prefs.
* main.h, misc.c (string_to_compress_algo): New.
2002-11-01 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Add --no-throw-keyid.
* keydb.h, encode.c (write_pubkey_enc_from_list), g10.c (main),
pkclist.c (build_pk_list): Add --hidden-recipient (-R) and
--hidden-encrypt-to, which do a single-user variation on
--throw-keyid. The "hide this key" flag is carried in bit 0 of
the pk_list flags field.
* keyserver.c (parse_keyrec): Fix shadowing warning.
2002-10-31 Stefan Bellon <sbellon@sbellon.de>
* compress.c (init_compress) [__riscos__]: Use
riscos_load_module() to load ZLib module.
* g10.c (main) [__riscos__]: Renames due to changes in riscos.c
(e.g. prefixes all RISC OS specific functions with riscos_*).
* photoid.c (show_photos) [__riscos__]: Likewise.
* signal.c (got_fatal_signal) [__riscos__]: Likewise.
* trustdb.c (check_regexp) [__riscos__]: Branch to RISC OS RegEx
handling.
2002-10-31 David Shaw <dshaw@jabberwocky.com>
* build-packet.c (do_plaintext), encode.c (encode_sesskey,
encode_simple, encode_crypt), sign.c (write_plaintext_packet): Use
wipememory() instead of memset() to wipe sensitive memory as the
memset() might be optimized away.
2002-10-30 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (check_regexp): Modern regexps require REG_EXTENDED.
2002-10-29 David Shaw <dshaw@jabberwocky.com>
* packet.h, trustdb.h, trustdb.c (trust_string): New. Return a
string like "fully trusted", "marginally trusted", etc.
(get_min_ownertrust): New. Return minimum ownertrust.
(update_min_ownertrust): New. Set minimum ownertrust.
(check_regexp): New. Check a regular epression against a user ID.
(ask_ownertrust): Allow specifying a minimum value.
(get_ownertrust_info): Follow the minimum ownertrust when
returning a letter.
(clear_validity): Remove minimum ownertrust when a key becomes
invalid.
(release_key_items): Release regexp along with the rest of the
info.
(validate_one_keyblock, validate_keys): Build a trust sig chain
while validating. Call check_regexp for regexps. Use the minimum
ownertrust if the user does not specify a genuine ownertrust.
* pkclist.c (do_edit_ownertrust): Only allow user to select a
trust level greater than the minimum value.
* parse-packet.c (can_handle_critical): Can handle critical trust
and regexp subpackets.
* trustdb.h, trustdb.c (clear_ownertrusts), delkey.c
(do_delete_key), import.c (import_one): Rename clear_ownertrust to
clear_ownertrusts and have it clear the min_ownertrust value as
well.
* keylist.c (list_keyblock_print): Indent uid to match pub and
sig.
* keyedit.c (print_and_check_one_sig, show_key_and_fingerprint,
menu_addrevoker), keylist.c (list_keyblock_print,
print_fingerprint): Show "T" or the trust depth for trust
signatures, and add spaces to some strings to make room for it.
* packet.h, parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt,
parse_signature): Parse trust signature values.
* tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record):
Reserve a byte for the minimum ownertrust value (for use with
trust signatures).
2002-10-29 Stefan Bellon <sbellon@sbellon.de>
* build-packet.c (calc_plaintext, do_plaintext): Removed RISC OS
specific filetype parts (it's now done in make_basename()).
* plaintext.c (handle_plaintext): Tidied up RISC OS specific
filetype parts.
* encode.c (encode_simple, encode_crypt): Added argument to
make_basename() call.
* sign.c (write_plaintext_packet): Added argument to
make_basename() call.
2002-10-28 Stefan Bellon <sbellon@sbellon.de>
* build-packet.c (calc_plaintext, do_plaintext): Added filetype
handling for RISC OS' file types.
* plaintext.c (handle_plaintext) [__riscos__]: Added filetype
handling for RISC OS' file types.
2002-10-23 David Shaw <dshaw@jabberwocky.com>
* main.h, import.c (sec_to_pub_keyblock, import_secret_one,
parse_import_options), g10.c (main): New import-option
"convert-sk-to-pk" to convert a secret key into a public key
during import. It is on by default.
2002-10-23 Werner Koch <wk@gnupg.org>
* pubkey-enc.c (get_it): Fix segv, test for revoked only when PK
has been assigned.
2002-10-18 Timo Schulz <ts@winpt.org>
* keylist.c: (print_pubkey_info): New.
(print_seckey_info): New.
* main.h: Prototypes for the new functions.
* delkey.c (do_delete_key): Use it here.
* revoke.c (gen_desig_revoke): Ditto.
2002-10-17 Werner Koch <wk@gnupg.org>
* pkclist.c (do_edit_ownertrust): Show all user IDs. This should
be enhanced to also show the current trust level. Suggested by
Florian Weimer.
2002-10-17 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Handle --strict and --no-strict from the command
line before the options file is loaded.
2002-10-15 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Disable --textmode when encrypting (symmetric or
pk) in --pgp2 mode as PGP 2 can't handle the unknown length
literal packet. Reported by Michael Richardson.
2002-10-14 David Shaw <dshaw@jabberwocky.com>
* keyserver-internal.h, keyserver.c (print_keyrec, parse_keyrec,
show_prompt, keyserver_search_prompt, keyserver_spawn): Go to
version 1 of the keyserver protocol. This is a better design,
similar to --with-colons, that allows for keys with multiple user
IDs rather than using multiple keys. It also matches the machine
readable pksd format. Also use a prettier --search-keys listing
format that can fill different size windows (currently set at 24
lines).
2002-10-12 Werner Koch <wk@gnupg.org>
* keygen.c (print_status_key_created): New.
(do_generate_keypair): Use it to print the fingerprint.
(generate_subkeypair): Likewise.
2002-10-11 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_addrevoker): Properly back out if the signature
fails. Also, do not allow appointing the same revoker twice, and
report ALREADY_SIGNED if the user tries it.
2002-10-07 David Shaw <dshaw@jabberwocky.com>
* import.c (import_keys_internal): Missed one s/inp/inp2/.
* keylist.c (print_capabilities): Properly indicate per-key
capabilities of sign&encrypt primary keys that have
secret-parts-missing (i.e. no capabilities at all)
* mainproc.c (symkey_decrypt_sesskey): Fix compiler warning.
2002-10-04 David Shaw <dshaw@jabberwocky.com>
* getkey.c (get_pubkey_direct): Don't cache keys retrieved via
this function as they may not have all their fields filled in.
* sig-check.c (signature_check2): Use new is_primary flag to check
rather than comparing main_keyid with keyid as this still works in
the case of a not fully filled in pk.
2002-10-04 Werner Koch <wk@gnupg.org>
* import.c (import_keys_internal): s/inp/inp2/ to avoid shadowing
warning.
* passphrase.c (agent_get_passphrase): Fixed signed/unsigned char
problem in %-escaping. Noted by Ingo Klöcker.
2002-10-03 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main): Add --strict and --no-strict to switch
the log_warning severity level from info to error.
* keylist.c (print_capabilities): Secret-parts-missing keys should
show that fact in the capabilities, and only primary signing keys
can certify other keys.
* packet.h, parse_packet.c (parse_key): Add is_primary flag for
public keys (it already exists for secret keys).
2002-10-02 David Shaw <dshaw@jabberwocky.com>
* import.c (import_secret_one): Check for an illegal (>110)
protection cipher when importing a secret key.
* keylist.c (list_keyblock_print): Show a '#' for a
secret-parts-missing key.
* parse_packet.c (parse_key): Some comments.
* revoke.c (gen_revoke): Remove some debugging code.
* trustdb.c (verify_own_keys): Make trusted-key a non-deprecated
option again.
* seckey-cert.c (do_check): Don't give the IDEA warning unless the
cipher in question is in fact IDEA.
2002-10-01 David Shaw <dshaw@jabberwocky.com>
* import.c (import_one): Make sure that a newly imported key
starts with a clean ownertrust.
2002-10-01 Werner Koch <wk@gnupg.org>
* getkey.c (get_pubkey_direct): New.
(merge_selfsigs_main): Use it here to look for an ultimately
trusted key. Using the full get_pubkey might lead to an
infinitive recursion.
2002-09-29 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (parse_keyserver_uri): Force the keyserver URI
scheme to lowercase to be case-insensitive.
2002-09-28 David Shaw <dshaw@jabberwocky.com>
* export.c (do_export_stream): Comment.
* sig-check.c (check_key_signature2): Properly handle a
non-designated revocation import.
2002-09-26 Werner Koch <wk@gnupg.org>
* g10.c (set_homedir): New. Changed all direct assignments to use
this.
* gpgv.c (set_homedir): Ditto.
2002-09-25 David Shaw <dshaw@jabberwocky.com>
* Makefile.am: Link gpg with EGDLIBS (i.e. NETLIBS) as EGD uses
sockets. Remove the old NETLIBS variable since the keyserver
stuff is no longer internal.
2002-09-24 David Shaw <dshaw@jabberwocky.com>
* import.c (import_keys_stream): Fix compiler type warning.
* keyring.c (keyring_rebuild_cache), sig-check.c
(check_key_signature2), import.c (import, chk_self_sigs): Minor
language cleanups.
2002-09-23 Stefan Bellon <sbellon@sbellon.de>
* main.h: Introduced fast-import as import option. Removed
fast as separate option from prototypes.
* import.c (parse_import_options): Added fast-import option.
(import_*): Removed fast as separate option.
* g10.c (main): Added option fast-import, removed old fast
as separate argument.
* keyserver.c (keyserver_spawn): Removed old fast as separate
argument.
2002-09-22 Stefan Bellon <sbellon@sbellon.de>
* import.c (import_keys, import_keys_stream,
import_keys_internal): Added trustdb update/check to key import if
not fast-import and interactive set/no-auto-check-trustdb unset.
Avoided function clone by introducing import_keys_internal.
2002-09-19 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Properly handle line truncation.
Don't leak memory (~10-20 bytes) on searches.
(keyserver_search_prompt): Cleanup.
* keylist.c (list_keyblock_colon): Show 1F direct key signatures
in --with-colons listing.
2002-09-16 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_addrevoker): The direct key signature for
revocation keys must be at least v4 to carry the revocation key
subpacket. Add a PGP 2.x warning for revocation keys.
2002-09-14 David Shaw <dshaw@jabberwocky.com>
* g10.c (check_permissions): Rearrange strings to make translating
easier (don't incorporate string parts).
* keyedit.c (sign_uids): Make strings translatable.
* sig-check.c (check_key_signature2): Make string translatable.
2002-09-13 David Shaw <dshaw@jabberwocky.com>
* getkey.c (check_revocation_keys): Move....
* main.h, sig-check.c (check_revocation_keys): to here. Also
return the signature_check error code rather than 0/1 and cache
the sig result.
* sig-check.c (check_key_signature2): Divert to
check_revocation_keys if a revocation sig is made by someone other
than the pk owner.
* getkey.c (merge_selfsigs_main): Tidy.
2002-09-13 Werner Koch <wk@gnupg.org>
* g10.c (main) [__MINGW32__]: Activate oLoadExtension.
2002-09-12 David Shaw <dshaw@jabberwocky.com>
* Makefile.am, hkp.c, hkp.h, keyserver.c (keyserver_work): Remove
internal HKP support.
* keyserver.c (keyserver_spawn): Remove whitespace after keyserver
commands.
2002-09-10 David Shaw <dshaw@jabberwocky.com>
* exec.c (expand_args): Remove loop left over from earlier
implementation.
(exec_write): Missed one tick.
2002-09-10 Werner Koch <wk@gnupg.org>
* g10.c, options.h: Removed option --emulate-checksum-bug.
* misc.c (checksum_u16_nobug): Removed.
(checksum_u16): Removed the bug emulation.
(checksum_mpi): Ditto.
(checksum_mpi_counted_nbits): Removed and replaced all calls
with checksum_mpi.
* parse-packet.c (read_protected_v3_mpi): New.
(parse_key): Use it here to store it as an opaque MPI.
* seckey-cert.c (do_check): Changed the v3 unprotection to the new
why to store these keys.
(protect_secret_key): Likewise.
* build-packet.c (do_secret_key): And changed the writing.
* tdbio.c (tdbio_set_dbname, open_db): Use new macro MY_O_BINARY
to avoid silly ifdefs.
(open_db): Fallback to RDONLY so that gpg may be used from a
RO-medium.
* encode.c (encode_simple): Make sure we don't use an ESK packet
when we don't have a salt in the S2K.
* misc.c (pct_expando) <case f>: Make sure that LEN is initialized.
* exec.c (exec_finish): Use ticks to denote filenames in messages.
(make_tempdir, exec_write): Changed format of messages.
* keyserver.c (print_keyinfo): Release USERID in on error.
(keyserver_work) [!DISABLE_KEYSERVER_HELPERS]: Exclude the unused
code.
2002-09-09 Werner Koch <wk@gnupg.org>
* parse-packet.c (make_attribute_uidname): Add new ar MAX_NAMELEN
for sanity checks. Changed both callers. Limit the size of an %s.
* options.skel: Comment lock-once out, so that this file does not
change anything when copied to a new home directory.
* openfile.c (try_make_homedir): Don't exit after copying the
option skeleton.
* options.h: Don't use a comma when declaring variables over more
than one line.
* mainproc.c (symkey_decrypt_sesskey): Check length of the session
key.
* hkp.c (dehtmlize): Use ascii_tolower to protect against weird
locales. Cast the argument for isspace for the sake of broken
HP/UXes.
(parse_hkp_index): s/ascii_memcasecmp/ascii_strncasecmp/.
* g10.c: Removed option --emulate-3des-s2k-bug.
* passphrase.c (hash_passphrase): Was used here.
* export.c (parse_export_options)
* keyserver.c (parse_keyserver_options)
* import.c (parse_import_options)
* g10.c (check_permissions): s/ascii_memcasecmp/ascii_strncasecmp/.
2002-09-09 David Shaw <dshaw@jabberwocky.com>
* g10.c (add_group): Use '=' to separate group name from group
members. Use a better error message for when no = is found.
* hkp.c (hkp_export): Use CRLF in headers.
2002-09-03 David Shaw <dshaw@jabberwocky.com>
* mainproc.c (print_pkenc_list): Don't increment the error counter
when printing the list of keys a message was encrypted to. This
would make gpg give a non-zero exit code even for completely valid
messages if the message was encrypted to more than one key that
the user owned.
2002-09-02 Werner Koch <wk@gnupg.org>
* g10.c (main): Try to set a default character set. Print the
used one in verbosity level 3.
* gpgv.c (main): Try to set a default character set.
* status.c, status.h (STATUS_IMPORT_OK): New.
* import.c (import_one,import_secret_one): Print new status.
2002-08-30 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (build_pk_list): Add new status code to indicate an
untrusted user. This (or a disabled key) fail with "unavailable
pubkey" (G10ERR_UNU_PUBKEY).
* pkclist.c (build_pk_list): Fail if any recipient keys are
unusable.
* options.skel: The PGP LDAP keyserver is back. Use MIT keyserver
as a sample rather than cryptnet as cryptnet does not support
searching yet.
* keyedit.c (show_key_with_all_names): Fix error message
(preferences are userid/selfsig and not key specific).
2002-08-30 Werner Koch <wk@gnupg.org>
* pkclist.c (do_we_trust_pre): Changed the wording of a warning.
* encode.c (encode_simple,encode_crypt): Use new style CTB for
compressssed packets when using MDC. We need to do this so that
concatenated messages are properly decrypted. Old style
compression assumes that it is the last packet; given that we
can't determine the length in advance, the uncompressor does not
know where to start. Actually we should use the new CTB always
but this would break PGP 2 compatibility.
* parse-packet.c (parse): Special treatment for new style CTB
compressed packets.
* build-packet.c (do_mdc): Removed. Was not used.
(do_encrypted_mdc): Count in the version number and the MDC packet.
2002-08-28 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (do_check_messages, do_check): Show keyid in error
messages.
* keyserver.c (print_keyinfo): More readable key listings for
--search-keys responses.
2002-08-26 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index, dehtmlize): Move HTML functionality into
new "dehtmlize" function. Remove HTML before trying to parse each
line from the keyserver. If the keyserver provides key type
information in the listing, use it.
2002-08-23 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (do_check, do_check_messages): Emit the usual sig
warnings even for cached sigs. This also serves to protect
against missing a sig expiring while cached.
* getkey.c (merge_selfsigs_main): Don't check UID self-sigs twice.
2002-08-22 David Shaw <dshaw@jabberwocky.com>
* import.c (clean_subkeys, chk_self_sigs): Merge clean_subkeys
into chk_self_sigs. This improves efficiency as the same
signatures are not checked multiple times. Clarify when a subkey
is revoked (any revocation signature, even if it is dated before
the binding signature).
* getkey.c (merge_selfsigs_subkey): Subkey revocation comments.
* keylist.c (list_one): Stats are only for public key listings.
* g10.c (main), options.skel: Default should be include-revoked
for keyserver operations.
2002-08-21 Werner Koch <wk@gnupg.org>
* import.c (import_print_stats): Print new non_imported counter
which is currently not used because we terminate on errors.
2002-08-20 David Shaw <dshaw@jabberwocky.com>
* options.skel: Document no-include-attributes for
keyserver-options.
* keylist.c, keyedit.c, keyserver.c, sign.c: Some TODOs and
comments.
* export.c (do_export_stream): Fix noop bug in exporting sensitive
revocation keys.
* pkclist.c (do_edit_ownertrust): Comment out the option for
showing trust paths until it can be implemented.
2002-08-19 Werner Koch <wk@gnupg.org>
* getkey.c (get_user_id_native): Renamed to ..
(get_user_id_printable): this. Filter out all dangerous
characters. Checked all usages.
(get_user_id_string_native): Renamed to..
(get_user_id_string_printable): this. Filter out all dangerous
characters. Checked all usages.
* keyedit.c (show_basic_key_info): New.
* keylist.c (print_fingerprint): New mode 3.
* import.c (import_one): Use new function to display the user ID.
2002-08-16 Timo Schulz <ts@winpt.org>
* g10.c (main): Enable opt.interactive.
* import.c (import_one): Ask the user if the key shall be
imported when the interactive mode is used. Useful to extract
selected keys from a file.
2002-08-16 Werner Koch <wk@gnupg.org>
* seckey-cert.c: Workaround to allow decryption of v3 keys created
with a bug in the mpi_get_secure_buffer.
2002-08-14 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index): Properly handle really large keys
(5 digit key length) in HKP searches.
2002-08-13 David Shaw <dshaw@jabberwocky.com>
* encode.c (encode_simple): Fix problem with using compression
algo 2 and symmetric compressed files.
* encode.c (encode_simple, encode_crypt): If we are not using a
MDC, compress even if a file is already compressed. This is to
help against the chosen ciphertext attack.
* pkclist.c (select_algo_from_prefs): Fix requested algorithm bug
so the request succeeds even if the requested algorithm is not the
first found.
* cipher.c (write_header), encode.c (use_mdc, encode_simple,
encode_crypt, encrypt_filter), g10.c (main): Be more eager to use
a MDC. We use a MDC if the keys directly support it, if the keys
list AES (any) or TWOFISH anywhere in the prefs, or if the cipher
chosen does not have a 64 bit blocksize.
2002-08-08 David Shaw <dshaw@jabberwocky.com>
* options.skel: Some language tweaks, and remove the
load-extension section for random gatherers.
* keyring.c (create_tmp_file, rename_tmp_file): Create tmp files
with user-only permissions, but restore the original permissions
if the user has something special set.
* openfile.c (copy_options_file): Create new options file
(gpg.conf) with user-only permissions.
* keydb.c (keydb_add_resource): Create new keyrings with user-only
permissions.
* tdbio.c (tdbio_set_dbname): Create new trustdbs with user-only
permissions.
2002-08-07 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (signature_check2): Sanity check that the md has a
context for the hash that the sig is expecting. This can happen
if a onepass sig header does not match the actual sig, and also if
the clearsign "Hash:" header is missing or does not match the
actual sig.
* keyedit.c (menu_revsig): Properly show a uid is revoked without
restarting gpg. This is Debian bug 124219, though their supplied
patch will not do the right thing.
* main.h, tdbio.c (tdbio_set_dbname), misc.c (removed
check_permissions), keydb.c (keydb_add_resource), g10.c (main,
check_permissions): Significant reworking of the permission check
mechanism. The new behavior is to check everything in the homedir
by checking the homedir itself. If the user wants to put
(possibly shared) keyrings outside the homedir, they are not
checked. The options file and any extension files are checked
wherever they are, as well as their enclosing directories. This
is Debian bug 147760.
2002-08-06 Stefan Bellon <sbellon@sbellon.de>
* g10.c (main): Use of EXTSEP_S in new gpg.conf string.
* openfile.c (copy_options_file): Ditto.
2002-08-06 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), mainproc.c (proc_encrypted):
--ignore-mdc-error option to turn a MDC check error into a
warning.
* encode.c (encode_crypt), g10.c (main), sign.c (sign_file,
clearsign_file): Use the same --pgpX warning string everywhere to
ease translations.
* encode.c (write_pubkey_enc_from_list): Warn when using
--throw-keyid with --pgpX. Noted by Vedaal Nistar.
* revoke.c (export_minimal_pk, gen_desig_revoke, gen_revoke):
Export a minimal pk along with the revocation cert when in --pgpX
mode so that PGP can import it.
2002-08-06 Werner Koch <wk@gnupg.org>
* options.skel: Changed comments.
* g10.c (main): Try to use "gpg.conf" as default option file.
* openfile.c (copy_options_file): Changed name of created file.
2002-08-02 Werner Koch <wk@gnupg.org>
* Makefile.am (LDFLAGS): Removed DYNLINK_LDFLAGS.
2002-07-30 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), mainproc.c (proc_encrypted): Return a
decryption failed error if a MDC does not verify. Warn if a MDC
is not present (can disable via --no-mdc-warning).
* exec.c (exec_write), g10.c (main), keyserver.c
(keyserver_spawn): Use new DISABLE_KEYSERVER_PATH rather than
FIXED_EXEC_PATH.
2002-07-28 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (do_check): Properly validate v4 sigs with no hashed
section at all.
2002-07-25 Werner Koch <wk@gnupg.org>
* delkey.c (do_delete_key): Always allow to delete a key in batch mode
when specified by fingerprint. Suggested by Enzo Michelangeli.
2002-07-25 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_revsig): Change "revsig" to honor selected uids
so the user can revoke sigs from particular uids only.
* keylist.c (list_keyblock_print): Don't display expired uids in
--list-keys unless -v and not --list-sigs (just like revoked
uids).
* exec.c, export.c, import.c, keyedit.c, keyserver.c, misc.c:
"Warning" -> "WARNING"
2002-07-24 David Shaw <dshaw@jabberwocky.com>
* main.h, import.c (parse_import_options, fix_hkp_corruption,
import_one, delete_inv_parts), g10.c (main): New import-option
"repair-hkp-subkey-bug", which repairs as much as possible the HKP
mangling multiple subkeys bug. It is on by default for keyserver
receives, and off by default for regular --import.
* main.h, import.c (import, import_one, delete_inv_parts), hkp.c
(hkp_ask_import), keyserver.c (keyserver_spawn): Use keyserver
import options when doing keyserver receives.
* options.h, exec.h, exec.c (set_exec_path, exec_write), g10.c
(main), keyserver.c (keyserver_spawn): If the user does not use
"exec-path", completely replace $PATH with GNUPG_LIBEXECDIR before
calling the keyserver helper. If the user does use "exec-path",
append GNUPG_LIBEXECDIR after the specified path.
2002-07-23 David Shaw <dshaw@jabberwocky.com>
* import.c (parse_import_options), export.c
(parse_export_options): Fix offset problem with reversed ("no-")
meanings.
* import.c (delete_inv_parts): Discard subkey signatures (0x18 and
0x28) if found in the userid section of the key.
* sig-check.c (signature_check2): Signatures made by invalid
subkeys (bad/missing binding sig) are also invalid.
* keylist.c (print_fingerprint): Show the primary as well as the
secondary key fingerprint in modes 1 & 2.
2002-07-22 David Shaw <dshaw@jabberwocky.com>
* options.h, main.h, g10.c (main), import.c
(parse_import_options, delete_inv_parts), keyserver.c
(parse_keyserver_options): add new --import-options option. The
only current flag is "allow-local-sigs".
* g10.c (main): Don't disable MDC in pgp7 mode.
* options.h, g10.c (main), keyserver.c (parse_keyserver_options):
Remove old keyserver-option include-attributes now that there is
an export-option for the same thing.
* options.h, main.h, export.c (parse_export_options,
do_export_stream), g10.c (main): add new --export-options option.
Current flags are "include-non-rfc", "include-local-sigs",
"include-attributes", and "include-sensitive-revkeys".
* options.h, hkp.c (hkp_export), keyserver.c
(parse_keyserver_options, keyserver_spawn): try passing unknown
keyserver options to export options, and if successful, use them
when doing a keyserver --send-key.
* build-packet.c (build_sig_subpkt): We do not generate
SIGSUBPKT_PRIV_VERIFY_CACHE anymore.
* revoke.c (gen_desig_revoke): Lots more comments about including
sensitive revkeys along with the revocation sig itself.
* keyserver.c (parse_keyserver_options): Simpler implementation
that can skip one pass over the options.
2002-07-18 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (keyedit_menu, menu_addrevoker): Allow specifying
"sensitive" as an argument to an addrevoker command. This sets
the 0x40 sensitive revoker flag.
* revoke.c (gen_desig_revoke): When generating a designated
revocation, include the direct key sig that contains the
designated revoker subpacket. This allows sensitive designated
revocation subpackets to be exported. Also indicate which
revokers are sensitive in the first place.
2002-07-17 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (show_key_with_all_names_colon): The 0x40 class bit in
a designated revoker means "sensitive", not "local". It's
exportable under the right circumstances.
* main.h, options.h, export.c (do_export_stream), g10.c (main),
hkp.c (hkp_export), keyserver.c (keyserver_spawn: Add a flag to
skip attribute packets and their signatures while exporting. This
is to accomodate keyservers (pksd again) that choke on attributes.
Use keyserver-option "include-attributes" to control it. This
defaults to ON (i.e. don't skip).
2002-07-09 David Shaw <dshaw@jabberwocky.com>
* options.h, keyserver.c (parse_keyserver_uri, keyserver_spawn,
keyserver_work), hkp.c (hkp_ask_import, hkp_export, hkp_search):
Use a much more strict reading of RFC-2396 for the keyserver URIs.
Specifically, don't try and be smart about checking the value of
":port" so long as it is all digits, and properly handle opaque
data (those scheme specific parts that do not start with "//").
2002-07-04 David Shaw <dshaw@jabberwocky.com>
* photoid.c (get_default_photo_command, show_photos): Honor
FIXED_PHOTO_VIEWER and DISABLE_PHOTO_VIEWER.
* mainproc.c (check_sig_and_print): Use --show-photos to show
photos when verifying a sig made by a key with a photo.
* keyserver.c (parse_keyserver_uri): Properly parse a URI with no
:port section and an empty file path, but with a terminating '/'.
(keyserver_work): Honor DISABLE_KEYSERVER_HELPERS.
* hkp.c (hkp_ask_import): Display keyserver URI as a URI, but only
if verbose.
* exec.c, g10.c: USE_EXEC_PATH -> FIXED_EXEC_PATH
2002-07-03 David Shaw <dshaw@jabberwocky.com>
* exec.h, exec.c (set_exec_path, exec_write), g10.c (main): If
USE_EXEC_PATH is defined at compile time, use it to lock the
exec-path and not allow the user to change it.
2002-07-02 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), keyserver.c (keyserver_refresh):
Maintain and use the original keyserver URI for cosmetics rather
than trying to recreate it when needed.
* mainproc.c (check_sig_and_print): Properly disregard expired
uids. Make sure that the first uid listed is a real uid and not
an attribute (attributes should only be listed in the "aka"
section). When there are no valid textual userids, try for an
invalid textual userid before using any attribute uid.
2002-07-01 David Shaw <dshaw@jabberwocky.com>
* options.skel: Fix a few typos, clarify "group", and remove
sample photo viewers for Win32 since they are the defaults now.
* parse-packet.c (make_attribute_uidname), keylist.c
(dump_attribs): Fix two typecast warnings.
* packet.h, build-packet.c (build_attribute_subpkt), exec.c
(expand_args), mkdtemp.c (mkdtemp), photoid.c
(parse_image_header): Fix some signedness compiler warnings.
2002-07-01 Werner Koch <wk@gnupg.org>
* photoid.c (get_default_photo_command): Also use __MINGW32__
instead of HAVE_DOSISH_SYSTEM.
* encode.c (encode_symmetric): Do not use the new encryption code.
2002-06-30 Werner Koch <wk@gnupg.org>
* photoid.c: Use __MINGW32__ to include windows because
HAVE_DOSISH_SYSTEM is also set for OS/2 and plain DOS. Provide
constant missing in older mingw installations.
2002-06-21 Stefan Bellon <sbellon@sbellon.de>
* g10.c [__riscos__]: Moved RISC OS specific stuff to util/riscos.c
and include/util.h.
* gpgv.c [__riscos__]: Likewise.
2002-06-20 David Shaw <dshaw@jabberwocky.com>
* keydb.h, pkclist.c (select_algo_from_prefs): Allow passing a
suggested algorithm which will be used if available.
* encode.c (encode_crypt, encrypt_filter), sign.c (sign_file): Use
new select_algo_from_prefs feature to check if forcing an
algorithm would violate the recipient preferences.
* photoid.c (get_default_photo_command, show_photos): Use
different default viewers on different platforms. Currently we
have Win 9x, Win NT (2k, xp), Mac OSX, RISC OS, and "everybody
else". These are #ifdefs as much as possible to avoid clutter.
* g10.c (strusage, build_list), keyedit.c (show_prefs), main.h,
misc.c (compress_algo_to_string, check_compress_algo), pkclist.c
(algo_available), keygen.c (keygen_set_std_prefs): New
algo_to_string and check functions for compress algorithms.
2002-06-20 Werner Koch <wk@gnupg.org>
* misc.c (setsysinfo): Removed a #warning for Alpha's uniligedn
trap disabling - it is quite possible that this is a debug relict.
2002-06-20 Stefan Bellon <sbellon@sbellon.de>
* g10.c [__riscos__]: Added image file system feature.
* gpgv.c [__riscos__]: Added image file system feature.
* photoid.c (show_photos) [__riscos__]: Set RISC OS filetype of
photo id according to MIME type.
2002-06-19 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index): Don't leak memory when failing out of a
bad HKP keyserver.
* g10.c (add_notation_data): Relax slightly the rules as to what
can go into a notation name - 2440 allows "@", for example.
2002-06-17 David Shaw <dshaw@jabberwocky.com>
* import.c (clean_subkeys, import_one): Only allow at most 1
binding sig and at most 1 revocation sig on a subkey, as per
2440:11.1.
* hkp.c (parse_hkp_index, hkp_search): Error if the keyserver
returns an unparseable HKP response.
2002-06-15 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (show_key_with_all_names), keylist.c
(list_keyblock_print): Show "[expired]" before expired uids.
* keyedit.c (show_key_with_all_names_colon), mainproc.c
(list_node), keylist.c (list_keyblock_colon): Show flag 'e' for
expired user ids. Use "uat" for user attribute packets instead of
"uid". Also use '<count> <length>' rather than the fake user id
string on attributes.
* keygen.c (keygen_add_revkey): Remove unused code.
* misc.c (check_permissions): Check directory permissions
properly - they are not special files.
* pkclist.c (expand_id, expand_group, build_pk_list): When
expanding groups before building a pk list, inherit flags from the
original pre-expanded string.
* pubkey-enc.c (is_algo_in_prefs): Don't use prefs from expired
uids.
2002-06-14 David Shaw <dshaw@jabberwocky.com>
* free-packet.c (copy_signature): Properly copy a signature that
carries a revocation key on it.
* pkclist.c (expand_id, expand_group, build_pk_list): Groups now
work properly when used in the "Enter the user ID" prompt.
2002-06-14 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (show_key_with_all_names): Display warning if a user
tries to show prefs on a v3 key with a v3 selfsig.
* kbnode.c (dump_kbnode): Show if a uid is expired.
* import.c (merge_blocks, import_revoke_cert): Show user ID
receiving a revocation certificate.
* free-packet.c (cmp_user_ids): Properly compare attribute ids.
* pkclist.c (expand_groups): Maintain the strlist flags while
expanding. Members of an expansion inherit their flags from the
expansion key.
* options.h, cipher.c (write_header), g10.c (main), keygen.c
(keygen_set_std_prefs): remove the personal_mdc flag. It no
longer serves a purpose now that the personal preference lists are
split into cipher/digest/zip.
2002-06-14 Timo Schulz <ts@winpt.org>
* skclist.c (is_insecure): Implemented.
2002-06-12 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Properly handle PROGRAM responses
when they have a CRLF ending. Noted by Keith Ray.
* keyserver.c (keyserver_spawn): Handle CRLF endings from
keyserver helpers. Also don't leak the last line worth of memory
from the keyserver response.
* main.h, misc.c (deprecated_warning): New function to warn about
deprecated options and commands.
* g10.c (main), keyserver-internal.h, keyserver.c
(parse_keyserver_uri): Use new deprecated function to warn about
honor-http-proxy, auto-key-retrieve, and x-broken-hkp.
2002-06-11 David Shaw <dshaw@jabberwocky.com>
* Makefile.am: link gpg with NETLIBS for the built-in HKP access.
2002-06-10 David Shaw <dshaw@jabberwocky.com>
* options.h, keyserver.c (keyserver_opts), g10.c (main): New
keyserver option "include-subkeys". This feature already existed,
but now can be turned off. It defaults to on.
* options.h, keyserver.c (parse_keyserver_options,
keyserver_spawn): There are now enough options to justify making a
structure for the keyserver options rather than a page of
if-then-else-if-then-etc.
* getkey.c (merge_keys_and_selfsig, merge_selfsigs_main): Fix bug
in calculating key expiration dates.
2002-06-09 David Shaw <dshaw@jabberwocky.com>
* keydb.h, getkey.c (get_user_id_native), import.c (import_one):
Display user ID while importing a key. Note this applies to both
--import and keyserver --recv-keys.
* exec.c (exec_finish): Log unnatural exit (core dump, killed
manually, etc) for fork/exec/pipe child processes.
2002-06-08 Timo Schulz <ts@winpt.org>
* encode.c (encode_symmetric): Disable the compat flag
when the expert mode is enabled.
2002-06-07 David Shaw <dshaw@jabberwocky.com>
* options.skel, options.h, main.h, keydb.h, pkclist.c
(build_pk_list, expand_groups), g10.c (main, add_group): Add new
"group" command to allow one name to expand into multiple keys.
For simplicity, and to avoid potential loops, we only expand once
- you can't make an alias that points to an alias.
* main.h, g10.c (main), keygen.c (build_personal_digest_list):
Simplify the default digest list - there is really no need for the
other hashes since they will never be used after SHA-1 in the
list.
* options.skel, options.h, g10.c (main), hkp.c (hkp_ask_import,
hkp_export, hkp_search), keyserver.c (parse_keyserver_options,
parse_keyserver_uri, keyserver_work, keyserver_refresh): Make the
"x-broken-hkp" keyserver scheme into keyserver-option
"broken-http-proxy". Move honor_http_proxy into
keyserver_options. Canonicalize the three variations of "hkp",
"x-hkp", and "x-broken-hkp" into "hkp".
2002-06-07 Stefan Bellon <sbellon@sbellon.de>
* g10.c [__riscos__]: Added --attribute-file to do the same as
--attribute-fd, but with a filename not a fd as argument.
Added magic symbol for RISC OS to use different memory management.
* gpgv.c [__riscos__]: Added magic symbol for RISC OS to use
different memory management.
2002-06-06 David Shaw <dshaw@jabberwocky.com>
* main.h, g10.c (main), keygen.c (build_personal_digest_list): Put
in a default digest preference list consisting of SHA-1, followed
by every other installed digest except MD5. Note this is the same
as having no digest preference at all except for SHA-1 being
favored.
* options.h, g10.c (main), keygen.c (keygen_set_std_prefs),
pkclist.c (select_algo_from_prefs): Split
--personal-preference-list into three:
--personal-{cipher|digest|compress}-preferences. This allows a
user to set one without affecting another (i.e. setting only a
digest pref doesn't imply an empty cipher pref).
* exec.c (exec_read): This is a safer way of guessing the return
value of system(). Noted by Stefan Bellon.
2002-06-05 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index): Be more robust with keyservers
returning very unparseable responses.
* exec.c (exec_read): Catch and display an error when the remote
process exits unnaturally (i.e. segfault) so the user knows what
happened. Also fix exec_write stub which has a different number
of arguments now.
2002-06-05 Timo Schulz <ts@winpt.org>
* encode.c (encode_simple): Ignore the new mode for RFC1991.
* mainproc.c (symkey_decrypt_sesskey): Better check for weird
keysizes.
2002-06-05 Timo Schulz <ts@winpt.org>
* encode.c (encode_sesskey): New.
(encode_simple): Use it here. But by default we use the compat
mode which supress to generate encrypted session keys.
2002-06-05 Timo Schulz <ts@winpt.org>
* mainproc.c (symkey_decrypt_sesskey): New.
(proc_symkey_enc): Support for encrypted session keys.
2002-06-04 David Shaw <dshaw@jabberwocky.com>
* sign.c (hash_for, sign_file): When encrypting and signing at the
same time, consult the various hash prefs to pick a hash algorithm
to use. Pass in a 160-bit hint if any of the signing keys are
DSA.
* keydb.h, pkclist.c (select_algo_from_prefs, algo_available):
Pass a "hints" opaque pointer in to let the caller give hints as
to what algorithms would be acceptable. The only current hint is
for PREFTYPE_HASH to require a 160-bit hash for DSA. Change all
callers in encode.c (encode_crypt, encrypt_filter) and sign.c
(sign_file). If we settle on MD5 as the best algorithm based
solely on recepient keys and SHA1 is also a possibility, use SHA1
unless the user intentionally chose MD5. This is as per 2440:13.
* exec.c (make_tempdir): Fix duplicated filename problem.
2002-06-03 David Shaw <dshaw@jabberwocky.com>
* packet.h, parse-packet.c (enum_sig_subpkt): Report back from
enum_sig_subpkt when a subpacket is critical and change all
callers in keylist.c (show_policy_url, show_notation), mainproc.c
(print_notation_data), and pkclist.c (do_show_revocation_reason).
* keylist.c (show_policy_url, show_notation): Display if the
policy or notation is critical.
2002-06-03 David Shaw <dshaw@jabberwocky.com>
* main.h, g10.c (main), keylist.c (dump_attribs, set_attrib_fd,
list_keyblock_print, list_keyblock_colon), status.h, status.c
(get_status_string): New --attribute-fd feature to dump the
contents of attribute subpackets for frontends. If --status-fd is
also used, then a new status tag ATTRIBUTE is provided for each
subpacket.
* packet.h, getkey.c (fixup_uidnode, merge_selfsigs_main,
merge_selfsigs_subkey), parse-packet.c (setup_user_id): Keep track
of the expiration time of a user ID, and while we're at it, use
the expired flag from the selfsig rather than reparsing the
SIG_EXPIRE subpacket.
* photoid.c (generate_photo_id): When adding a new photo ID,
showing the photo for confirmation is not safe when noninteractive
since the "user" may not be able to dismiss a viewer window.
Noted by Timo Schulz.
2002-06-03 David Shaw <dshaw@jabberwocky.com>
* options.skel: Sample photo viewers for Win32.
* misc.c (pct_expando): Use the seckey for %k/%K if the pubkey is
not available.
* photoid.h, photoid.c (show_photos): Include the seckey in case a
user tries to view a photo on a secret key, and change all callers
in keyedit.c (menu_showphoto), keylist.c (list_keyblock_print),
and photoid.c (generate_photo_id).
2002-06-02 David Shaw <dshaw@jabberwocky.com>
* photoid.c (show_photos): Work properly when not called with a
public key.
2002-05-31 David Shaw <dshaw@jabberwocky.com>
* sign.c (mk_notation_and_policy): Free unneeded buffer.
* hkp.c (parse_hkp_index): Properly handle the '&' character
(i.e. "&amp;") in HKP responses.
* getkey.c (merge_selfsigs_main): Fix reversed expiration time
check with self-sigs.
* keyedit.c (sign_uids): When making a new self-sig on a v3 key,
make a v3 self-sig unless it is currently a v3 self-sig being
promoted to v4.
2002-05-31 Timo Schulz <ts@winpt.org>
* pkclist.c (do_show_revocation_reason): Don't use capital
letters for non-interactive output.
(show_revocation_reason): Now it is global.
* pubkey-enc.c (get_it): Show if the key has been revoked.
2002-05-30 David Shaw <dshaw@jabberwocky.com>
* sign.c (write_signature_packets, sign_file, clearsign_file,
sign_symencrypt_file): Make a v4 signature if a policy URL or
notation is set, unless v3 sigs are forced via rfc1991 or
force-v3-sigs. Also remove some doubled code and clarify an error
message (we don't sign in PGP2 mode - just detach-sign).
* parse-packet.c (parse_one_sig_subpkt): Add KS_FLAGS to the "any
size" section.
2002-05-29 David Shaw <dshaw@jabberwocky.com>
* keygen.c (keygen_set_std_prefs, add_feature_mdc): Use "mdc" and
"no-mdc" in the prefs string to allow switching on and off the MDC
feature. This is needed to properly export a key from GnuPG for
use on PGP which does not support MDC - without this, MDC-capable
implementations will still try and generate MDCs which will break
PGP.
* keygen.c (keygen_get_std_prefs): Show "[mdc]" in prefs string if
it is enabled.
* options.h, g10.c (main), cipher.c (write_header), keygen.c
(keygen_set_std_prefs): For consistency, allow the user to specify
mdc/no-mdc in the --personal-preference-list. If disabled, it
acts just like --disable-mdc.
2002-05-29 David Shaw <dshaw@jabberwocky.com>
* options.h, exec.c: Add some debugging info, using the 1024 debug
flag.
* exec.c (win_system): New system()-like function for win32 that
does not return until the child process terminates. Of course,
this doesn't help if the process itself exits before it is
finished.
2002-05-29 Werner Koch <wk@gnupg.org>
* encode.c (encode_simple): Intialize PKT when --no-literal is used.
* keyedit.c (show_key_with_all_names_colon): Renamed the record
for revocation keys to "rvk".
2002-05-27 Werner Koch <wk@gnupg.org>
* keyedit.c (show_key_with_all_names_colon): New.
(show_key_with_all_names): Divert to new function when required.
Sanitize printing of revoker name.
2002-05-27 David Shaw <dshaw@jabberwocky.com>
* build-packet.c (build_sig_subpkt): Handle setting sig flags for
certain subpacket types (notation, policy url, exportable,
revocable). keyedit.c (sign_mk_attrib): Flags no longer need to
be set here.
* packet.h, parse-packet.c (parse_one_sig_subpkt), build-packet.c
(build_sig_subpkt): Call parse_one_sig_subpkt to sanity check
buffer lengths before building a sig subpacket.
2002-05-26 David Shaw <dshaw@jabberwocky.com>
* sign.c (mk_notation_and_policy): Include secret key to enable %s
expandos, and pass notations through pct_expando as well.
* main.h, misc.c (pct_expando): Add %s and %S expandos for
signer's keyid.
2002-05-25 David Shaw <dshaw@jabberwocky.com>
* g10.c (strusage, build_list): Add compress algorithms to
--version list. Show algorithm numbers when --verbose --version
is done.
2002-05-22 David Shaw <dshaw@jabberwocky.com>
* options.h, main.h, keygen.c (keygen_set_set_prefs,
keygen_get_std_prefs, keygen_upd_std_prefs), keyedit.c
(keyedit_menu), g10.c (main), pkclist.c (select_algo_from_prefs):
Add --personal-preference-list which allows the user to factor in
their own preferred algorithms when the preference lists are
consulted. Obviously, this does not let the user violate a
recepient's preferences (and the RFC) - this only influences the
ranking of the agreed-on (and available) algorithms from the
recepients. Suggested by David Hollenberg.
* options.h, keygen.c (keygen_set_std_prefs), g10.c (main): Rename
--preference-list to --default-preference-list (as that is what it
really is), and make it a true default in that if the user selects
"default" they get this list and not the compiled-in list.
2002-05-22 Werner Koch <wk@gnupg.org>
* g10.c (main): Add missing LF in a info printout and made it
translatable. Noted by Michael Tokarev.
2002-05-21 Werner Koch <wk@gnupg.org>
* g10.c (main): Removed the undef of USE_SHM_COPROCESSING which
was erroneously introduced on 2002-01-09.
* signal.c (got_fatal_signal): Don't write the Nul to stderr.
Reported by David Hollenberg.
2002-05-18 David Shaw <dshaw@jabberwocky.com>
* main.h, g10.c (main), revoke.c (gen_desig_revoke): Generate a
designated revocation via --desig-revoke
* keyedit.c (keyedit_menu, menu_addrevoker): New "addrevoker"
command to add a designated revoker to a key.
2002-05-17 David Shaw <dshaw@jabberwocky.com>
* gpgv.c: Add stub for get_ownertrust().
* g10.c (main): --allow-freeform-uid should be implied by
OpenPGP. Add --no-allow-freeform-uid.
* keyedit.c (sign_uids): Issue a warning when signing a
non-selfsigned uid.
* getkey.c (merge_selfsigs_main): If a key has no selfsigs, and
allow-non-selfsigned-uid is not set, still try and make the key
valid by checking all uids for a signature from an ultimately
trusted key.
2002-05-16 David Shaw <dshaw@jabberwocky.com>
* main.h, keygen.c (keygen_add_revkey): Add revocation key
subpackets to a signature (callable by
make_keysig_packet). (write_direct_sig): Write a 1F direct key
signature. (parse_revocation_key): Parse a string in
algo:fpr:sensitive format into a revocation
key. (get_parameter_revkey, do_generate_keypair): Call above
functions when prompted from a batch key generation file.
* build-packet.c (build_sig_subpkt): Allow multiple revocation key
subpackets in a single sig.
* keydb.h, getkey.c (get_seckey_byfprint): Same as
get_pubkey_byfprint, except for secret keys. We only know the
fingerprint of a revocation key, so this is needed to retrieve the
secret key needed to issue a revokation.
* packet.h, parse-packet.c (parse_signature, parse_revkeys): Split
revkey parsing off into a new function that can be used to reparse
after manipulating the revkey list.
* sign.c (make_keysig_packet): Ability to make 1F direct key
signatures.
2002-05-15 David Shaw <dshaw@jabberwocky.com>
* options.skel: keyserver.pgp.com is gone, so list pgp.surfnet.nl
as a sample LDAP server instead.
* getkey.c (merge_selfsigs_main): Properly handle multiple
revocation keys in a single packet. Properly handle revocation
keys that are in out-of-order packets. Remove duplicates in
revocation key list.
2002-05-14 Timo Schulz <ts@winpt.org>
* exec.c (make_tempdir) [MINGW32]: Added missing '\'.
2002-05-14 Stefan Bellon <sbellon@sbellon.de>
* exec.c (make_tempdir): Make use of EXTSEP_S instead of hardcoded
dot as extension separator.
2002-05-13 David Shaw <dshaw@jabberwocky.com>
* photoid.c (show_photos): Use the long keyid as the filename for
the photo. Use the short keyid as the filename on 8.3 systems.
* exec.h, exec.c (make_tempdir, exec_write, exec_finish): Allow
caller to specify filename. This should make things easier on
windows and macs where the file extension is required, but a whole
filename is even better.
* keyedit.c (show_key_with_all_names, show_prefs): Show proper
prefs for a v4 key uid with no selfsig at all.
* misc.c (check_permissions): Don't check permissions on
non-normal files (pipes, character devices, etc.)
2002-05-11 Werner Koch <wk@gnupg.org>
* mainproc.c (proc_symkey_enc): Avoid segv in case the parser
encountered an invalid packet.
* keyserver.c (keyserver_export): Get confirmation before sending
all keys.
2002-05-10 Stefan Bellon <sbellon@sbellon.de>
* g10.c, hkp.c, keyedit.c, keyserver.c: Replaced all occurrances
of strcasecmp with ascii_strcasecmp and all occurrances of
strncasecmp with ascii_memcasecmp.
2002-05-10 David Shaw <dshaw@jabberwocky.com>
* packet.h, getkey.c (fixup_uidnode), keyedit.c (show_prefs): Show
assumed prefs for hash and compression as well as the cipher pref.
Show assumed prefs if there are no prefs at all on a v4
self-signed key.
* options.h, g10.c (main), sign.c (make_keysig_packet): New
--cert-digest-algo function to override the default key signing
hash algorithm.
2002-05-09 David Shaw <dshaw@jabberwocky.com>
* getkey.c (merge_selfsigs_main): Make sure the revocation key
list starts clean as this function may be called more than once
(e.g. from functions in --edit).
* g10.c, encode.c (encode_crypt), sign.c (sign_file,
sign_symencrypt_file): Make --compress-algo work like the
documentation says. It should be like --cipher-algo and
--digest-algo in that it can override the preferences calculation
and impose the setting the user wants. No --compress-algo setting
allows the usual preferences calculation to take place.
* main.h, compress.c (compress_filter): use new
DEFAULT_COMPRESS_ALGO define, and add a sanity check for compress
algo value.
2002-05-08 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (select_algo_from_prefs): There is an assumed
compression preference for uncompressed data.
2002-05-07 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), getkey.c (finish_lookup), pkclist.c
(algo_available): --pgp7, identical to --pgp6 except that it
permits a few algorithms that PGP 7 added: AES128, AES192, AES256,
and TWOFISH. Any more of these --pgpX flags, and it'll be time to
start looking at a generic --emulate-pgp X option.
* export.c (do_export_stream): Warn the user when exporting a
secret key if it or any of its secret subkeys are protected with
SHA1 while simple_sk_checksum is set.
* parse-packet.c (parse_key): Show when the SHA1 protection is
used in --list-packets.
* options.h, build-packet.c (do_comment), g10.c (main): Rename
--no-comment as --sk-comments/--no-sk-comments (--no-comment still
works) and make the default be --no-sk-comments.
2002-05-07 Werner Koch <wk@gnupg.org>
* keygen.c (get_parameter_algo): Never allow generation of the
deprecated RSA-E or RSA-S flavors of PGP RSA.
(ask_algo): Allow generation of RSA sign and encrypt in expert
mode. Don't allow ElGamal S+E unless in expert mode.
* helptext.c: Added entry keygen.algo.rsa_se.
2002-05-07 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (sign_uids): If --expert is set, allow re-signing a
uid to promote a v3 self-sig to a v4 one. This essentially
deletes the old v3 self-sig and replaces it with a v4 one.
* packet.h, parse-packet.c (parse_key), getkey.c
(merge_keys_and_selfsig, merge_selfsigs_main): a v3 key with a v4
self-sig must never let the v4 self-sig express a key expiration
time that extends beyond the original v3 expiration time.
2002-05-06 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (sign_uids): When making a self-signature via "sign"
don't ask about sig level or expiration, and include the usual
preferences and such for v4 self-sigs. (menu_set_preferences):
Convert uids from UTF8 to native before printing.
* keyedit.c (sign_uids): Convert uids from UTF8 to native before
printing. (menu_set_primary_uid): Show error if the user tries to
make a uid with a v3 self-sig primary.
2002-05-05 David Shaw <dshaw@jabberwocky.com>
* import.c (import_one): When merging with a key we already have,
don't let a key conflict (same keyid but different key) stop the
import: just skip the bad key and continue.
* exec.c (make_tempdir): Under Win32, don't try environment
variables for temp directories - GetTempDir tries environment
variables internally, and it's better not to second-guess it in
case MS adds some sort of temp dir handling to Windows at some
point.
2002-05-05 Timo Schulz <ts@winpt.org>
* mainproc.c (proc_symkey_enc): Don't ask for a passphrase
in the list only mode.
2002-05-05 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_refresh): --refresh-keys implies
--merge-only so as not to import keys with keyids that match the
ones being refreshed. Noted by Florian Weimer.
2002-05-04 Stefan Bellon <sbellon@sbellon.de>
* free-packet.c (copy_public_key): Don't call m_alloc(0), therefore
added consistency check for revkey and numrefkeys.
* getkey.c (check_revocation_keys): Added consistency check for
revkey and numrefkeys.
* keyedit.c (show_key_with_all_names): Likewise.
2002-05-03 David Shaw <dshaw@jabberwocky.com>
* photoid.c: Provide default image viewer for Win32.
* misc.c (pct_expando): %t means extension, not name ("jpg", not
"jpeg").
* keyserver.c (keyserver_spawn), photoid.c (show_photos), exec.h,
exec.c: Allow the caller to determine the temp file extension when
starting an exec_write and change all callers.
* keyedit.c (sign_uids): Nonrevocable key signatures cause an
automatic promotion to v4.
* exec.c: Provide stubs for exec_ functions when NO_EXEC is
defined.
2002-05-02 David Shaw <dshaw@jabberwocky.com>
* photoid.h, photoid.c (parse_image_header, image_type_to_string):
Useful functions to return data about an image.
* packet.h, parse-packet.c (make_attribute_uidname,
parse_attribute_subpkts, parse_attribute), photoid.h, photoid.c
(show_photos): Handle multiple images in a single attribute
packet.
* main.h, misc.c (pct_expando), sign.c (mk_notation_and_policy),
photoid.c (show_photos): Simpler expando code that does not
require using compile-time string sizes. Call
image_type_to_string to get image strings (i.e. "jpg",
"image/jpeg"). Change all callers.
* keyedit.c (menu_showphoto), keylist.c (list_keyblock_print):
Allow viewing multiple images within a single attribute packet.
* gpgv.c: Various stubs for link happiness.
2002-05-02 David Shaw <dshaw@jabberwocky.com>
* build-packet.c (build_sig_subpkt), keyedit.c (sign_uids),
options.h, sign.c (mk_notation_and_policy), g10.c (main,
add_notation_data, add_policy_url (new), check_policy_url
(removed)): Allow multiple policy URLs on a given signature.
Split "--notation-data" into "--cert-notation" and
"--sig-notation" so the user can set different policies for key
and data signing. For backwards compatibility, "--notation-data"
sets both, as before.
2002-05-02 Werner Koch <wk@gnupg.org>
* options.skel: Removed the comment on trusted-keys because this
option is now deprecated.
2002-05-01 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_adduid): 2440bis04 says that multiple attribute
packets on a given key are legal.
* keyserver.c (keyserver_refresh): the fake v3 keyid hack applies
to "mailto" URLs as well since they are also served by pksd.
2002-04-29 Werner Koch <wk@gnupg.org>
Added a copyright year for files changed this year.
2002-04-25 Werner Koch <wk@gnupg.org>
* g10.c, options.h: New options --display, --ttyname, --ttytype,
--lc-ctype, --lc-messages to be used with future versions of the
gpg-agent.
* passphrase.c (agent_send_option,agent_send_all_options): New.
(agent_open): Send options to the agent.
* trustdb.c (update_ownertrust, clear_ownertrust): Do an explicit
do_sync because revalidation_mark does it only if when the
timestamp actually changes.
2002-04-23 David Shaw <dshaw@jabberwocky.com>
* main.h, keygen.c (do_generate_keypair), keylist.c
(print_signature_stats, list_all, list_one, list_keyblock,
list_keyblock_print, list_keyblock_colon): After generating a new
key, show the key information (name, keyid, fingerprint, etc.)
Also do not print uncheckable signatures (missing key..) in
--check-sigs. Print statistics (N missing keys, etc.) after
--check-sigs.
* keyedit.c (sign_uids): When signing a key with an expiration
date on it, the "Do you want your signature to expire at the same
time?" question should default to YES.
2002-04-22 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (parse_plaintext), packet.h, plaintext.c
(handle_plaintext): Fix bug in handling literal packets with
zero-length data (no data was being confused with partial body
length).
* misc.c (pct_expando), options.skel: %t means extension ("jpg").
%T means MIME type ("image/jpeg").
* import.c (import_one): Only trigger trust update if the keyring
is actually changed.
* export.c (do_export_stream): Missing a m_free.
2002-04-22 Stefan Bellon <sbellon@sbellon.de>
* keyid.c (expirestr_from_sk, expirestr_from_sig): Added _() to
string constant.
* exec.c (make_tempdir) [__riscos__]: Better placement of
temporary file.
2002-04-20 David Shaw <dshaw@jabberwocky.com>
* keygen.c (generate_subkeypair): 2440bis04 adds that creating
subkeys on v3 keys is a MUST NOT.
* getkey.c (finish_lookup): The --pgp6 "use the primary key"
behavior should only apply while data signing and not encryption.
Noted by Roger Sondermann.
2002-04-19 Werner Koch <wk@gnupg.org>
* keygen.c (keygen_set_std_prefs): Put back 3DES because the RFC
says it is good form to do so.
2002-04-19 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_deluid): Only cause a trust update if we delete
a non-revoked user id.
* hkp.c (hkp_ask_import), keyserver.c (parse_keyserver_options,
keyserver_spawn), options.h: Remove fast-import keyserver option
(no longer meaningful).
* g10.c (main), keyedit.c (sign_uids), options.h: Change
--default-check-level to --default-cert-check-level as it makes
clear what it operates on.
* g10.c (main): --pgp6 also implies --no-ask-sig-expire.
* delkey.c (do_delete_key): Comment.
* keyedit.c (sign_uids, keyedit_menu, menu_deluid, menu_delsig,
menu_expire, menu_revsig, menu_revkey): Only force a trustdb check
if we did something that changes it.
* g10.c: add "--auto-check-trustdb" to override a
"--no-auto-check-trustdb"
2002-04-19 Werner Koch <wk@gnupg.org>
* tdbio.c (tdbio_write_nextcheck): Return a status whether the
stamp was actually changed.
* trustdb.c (revalidation_mark): Sync the changes. Removed the
sync operation done by its callers.
(get_validity): Add logic for maintaining a pending_check flag.
(clear_ownertrust): New.
* keyedit.c (sign_uids): Don't call revalidation_mark depending on
primary_pk.
(keyedit_menu): Call revalidation_mark after "trust".
(show_key_with_all_names): Print a warning on the wrong listed key
validity.
* delkey.c (do_delete_key): Clear the owenertrust information when
deleting a public key.
2002-04-18 Werner Koch <wk@gnupg.org>
* seskey.c (encode_md_value): Print an error message if a wrong
digest algorithm is used with DSA. Changed all callers to cope
with a NULL return. Problem noted by Imad R. Faiad.
2002-04-18 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (mark_usable_uid_certs): Properly handle nonrevocable
signatures that can expire. In short, the only thing that can
override an unexpired nonrevocable signature is another unexpired
nonrevocable signature.
* getkey.c (finish_lookup): Always use primary signing key for
signatures when --pgp6 is on since pgp6 and 7 do not understand
signatures made by signing subkeys.
2002-04-18 Werner Koch <wk@gnupg.org>
* trustdb.c (validate_keys): Never schedule a nextcheck into the
past.
(validate_key_list): New arg curtime use it to set next_expire.
(validate_one_keyblock): Take the current time from the caller.
(clear_validity, reset_unconnected_keys): New.
(validate_keys): Reset all unconnected keys.
* getkey.c (premerge_public_with_secret): Fixed 0x12345678! syntax
for use with secret keys.
(lookup): Advance the searchmode after a search FIRST.
* seckey-cert.c (do_check): Always calculate the old checksum for
use after unprotection.
* g10.c, options.skel: New option --no-escape-from. Made
--escape-from and --force-v3-sigs the default and removed them
from the options skeleton.
2002-04-16 Werner Koch <wk@gnupg.org>
* parse-packet.c (parse_key): Support a SHA1 checksum as per
draft-rfc2440-bis04.
* packet.h (PKT_secret_key): Add field sha1chk.
* seckey-cert.c (do_check): Check the SHA1 checksum
(protect_secret_key): And create it.
* build-packet.c (do_secret_key): Mark it as sha-1 protected.
* g10.c, options.h: New option --simple-sk-checksum.
2002-04-13 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (parse_signature): Minor fix - signatures should
expire at their expiration time and not one second later.
* keygen.c (proc_parameter_file): Allow specifying preferences
string (i.e. "s5 s2 z1 z2", etc) in a batchmode key generation
file.
* keyedit.c (keyedit_menu): Print standard error message when
signing a revoked key (no new translation).
* getkey.c (merge_selfsigs): Get the default set of key prefs from
the real (not attribute) primary uid.
2002-04-12 David Shaw <dshaw@jabberwocky.com>
* pkclist.c (build_pk_list): Fix bug that allowed a key to be
selected twice in batch mode if one instance was the default
recipient and the other was an encrypt-to. Noted by Stefan
Bellon.
* parse-packet.c (dump_sig_subpkt): Show data in trust and regexp
sig subpackets.
* keyedit.c (keyedit_menu): Use new function real_uids_left to
prevent deleting the last real (i.e. non-attribute) uid. Again,
according to the attribute draft. (menu_showphoto): Make another
string translatable.
2002-04-11 David Shaw <dshaw@jabberwocky.com>
* build-packet.c (build_sig_subpkt): Delete subpackets from both
hashed and unhashed area on update. (find_subpkt): No longer
needed.
* keyedit.c (sign_uids): With --pgp2 on, refuse to sign a v3 key
with a v4 signature. As usual, --expert overrides. Try to tweak
some strings to a closer match so they can all be translated in
one place. Use different helptext keys to allow different help
text for different questions.
* keygen.c (keygen_upd_std_prefs): Remove preferences from both
hashed and unhashed areas if they are not going to be used.
2002-04-10 David Shaw <dshaw@jabberwocky.com>
* misc.c (pct_expando), options.skel: Use %t to indicate type of a
photo ID (in this version, it's always "jpeg"). Also tweak string
expansion loop to minimize reallocs.
* mainproc.c (do_check_sig): Variable type fix.
* keyedit.c (menu_set_primary_uid): Differentiate between true
user IDs and attribute user IDs when making one of them primary.
That is, if we are making a user ID primary, we alter user IDs.
If we are making an attribute packet primary, we alter attribute
packets. This matches the language in the latest attribute packet
draft.
* keyedit.c (sign_uids): No need for the empty string hack.
* getkey.c (fixup_uidnode): Only accept preferences from the
hashed segment of the self-sig.
2002-04-10 Werner Koch <wk@gnupg.org>
* tdbio.c (migrate_from_v2): Fixed the offset to read the old
ownertrust value and only add entries to the table if we really
have a value.
2002-04-08 David Shaw <dshaw@jabberwocky.com>
* status.h, status.c (get_status_string): Add KEYEXPIRED, EXPSIG,
and EXPKEYSIG. Add "deprecated-use-keyexpired-instead" to
SIGEXPIRED.
* sig-check.c (do_check): Start transition from SIGEXPIRED to
KEYEXPIRED, since the actual event is signature verification by an
expired key and not an expired signature. (do_signature_check,
packet.h): Rename as signature_check2, make public, and change all
callers.
* mainproc.c (check_sig_and_print, do_check_sig): Use status
EXPSIG for an expired, but good, signature. Add the expiration
time (or 0) to the VALIDSIG status line. Use status KEYEXPSIG for
a good signature from an expired key.
* g10.c (main): remove checks for no arguments now that argparse
does it.
2002-04-06 Werner Koch <wk@gnupg.org>
* keyring.c (keyring_get_keyblock): Disable the keylist mode here.
* encode.c (encode_simple, encode_crypt): Only test on compressed
files if a compress level was not explicity set.
* keygen.c (keygen_set_std_prefs): Removed Blowfish and Twofish
from the list of default preferences, swapped the preferences of
RMD160 and SHA1. Don't include a preference to 3DES unless the
IDEA kludge gets used.
* free-packet.c (free_packet): call free_encrypted also for
PKT_ENCRYPTED_MDC.
* compress.c (release_context): New.
(handle_compressed): Allocate the context and setup a closure to
release the context. This is required because there is no
guarantee that the filter gets popped from the chain at the end
of the function. Problem noted by Timo and probably also the
cause for a couple of other reports.
(compress_filter): Use the release function if set.
* tdbio.c [__CYGWIN32__]: Don't rename ftruncate. Noted by
Disastry.
* parse-packet.c (parse_signature): Put parens around a bit test.
* exec.c (make_tempdir): Double backslash for TMP directory
creation under Windows. Better strlen the DIRSEP_S constants for
allocation measurements.
* decrypt.c (decrypt_messages): Release the passphrase aquired
by get_last_passphrase.
2002-04-02 Werner Koch <wk@gnupg.org>
* Makefile.am (EXTRA_DIST): Removed OPTIONS an pubring.asc - they
are no longer of any use.
2002-04-03 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (parse_keyserver_options): fix auto-key-retrieve to
actually work as a keyserver-option (noted by Roger Sondermann).
* keylist.c (reorder_keyblock): do not reorder the primary
attribute packet - the first user ID must be a genuine one.
2002-03-31 David Shaw <dshaw@jabberwocky.com>
* keylist.c (list_keyblock_colon): Fix ownertrust display with
--with-colons.
* keygen.c (generate_user_id), photoid.c (generate_photo_id):
Properly initialize the user ID refcount. A few more "y/n" ->
"y/N" in photoid.c.
* keyedit.c (ask_revoke_sig): Warn the user if they are about to
revoke an expired sig (not a problem, but they should know). Also
tweak a few prompts to change "y/n" to "y/N", which is how most
other prompts are written.
* keyserver.c (keyserver_search_prompt): Control-d escapes the
keyserver search prompt.
* pkclist.c (show_revocation_reason & callers): If a subkey is
considered revoked solely because the parent key is revoked, print
the revocation reason from the parent key.
* trustdb.c (get_validity): Allow revocation/expiration to apply
to a uid/key with no entry in the trustdb.
2002-03-29 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (printunquoted): unquote backslashes from keyserver
searches
* hkp.c (write_quoted): quote backslashes from keyserver searches
2002-03-26 Werner Koch <wk@gnupg.org>
* keygen.c (ask_keysize): Removed the warning for key sizes > 1536.
2002-03-25 Werner Koch <wk@gnupg.org>
* keyedit.c (sign_uids): Use 2 strings and not a %s so that
translations can be done the right way.
* helptext.c: Fixed small typo.
2002-03-23 David Shaw <dshaw@jabberwocky.com>
* import.c (append_uid, merge_sigs): it is okay to import
completely non-signed uids now (with --allow-non-selfsigned-uid).
* getkey.c (get_primary_uid, merge_selfsigs_main): do not choose
an attribute packet (i.e. photo) as primary uid. This prevents
oddities like "Good signature from [image of size 2671]". This is
still not perfect (one can still select an attribute packet as
primary in --edit), but is closer to the way the draft is going.
* g10.c (build_list): algorithms should include 110.
* g10.c (main): --pgp2 implies --no-ask-sig-expire and
--no-ask-cert-expire as those would cause a v4 sig/cert.
* armor.c (is_armor_header): be more lenient in what constitutes a
valid armor header (i.e. -----BEGIN blah blah-----) as some
Windows programs seem to add spaces at the end. --openpgp makes
it strict again.
2002-03-18 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_search_prompt): Properly handle a "no
keys found" case from the internal HKP code (external HKP is ok).
Also, make a COUNT -1 (i.e. streamed) keyserver response a little
more efficient.
* g10.c (main): Add --no-allow-non-selfsigned-uid
2002-03-17 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): --openpgp implies --allow-non-selfsigned-uid.
* getkey.c (merge_selfsigs_main): If none of the uids are primary
(because none are valid) then pick the first to be primary (but
still invalid). This is for cosmetics in case some display needs
to print a user ID from a non-selfsigned key. Also use
--allow-non-selfsigned-uid to make such a key valid and not
--always-trust. The key is *not* automatically trusted via
--allow-non-selfsigned-uid.
* mainproc.c (check_sig_and_print): Make sure non-selfsigned uids
print [uncertain] on verification even though one is primary now.
* getkey.c (merge_selfsigs): If the main key is not valid, then
neither are the subkeys.
* import.c (import_one): Allow --allow-non-selfsigned-uid to work
on completely unsigned keys. Print the uids in UTF8. Remove
mark_non_selfsigned_uids_valid().
* keyedit.c (show_key_with_all_names): Show revocation key as
UTF8.
* sign.c (clearsign_file): Allow --not-dash-escaped to work with
v3 keys.
2002-03-14 Werner Koch <wk@gnupg.org>
* main.h: Changed the default algorithms to CAST5 and SHA1.
2002-03-13 David Shaw <dshaw@jabberwocky.com>
* import.c (chk_self_sigs): Show which user ID a bad self-sig
(invald sig or unsupported public key algorithm) resides on.
* import.c (chk_self_sigs): any valid self-sig should mark a user
ID or subkey as valid - otherwise, an attacker could DoS the user
by inventing a bogus invalid self-signature.
2002-03-07 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): make a few more strings translatable.
* options.h, options.skel, g10.c (main), gpgv.c, mainproc.c
(check_sig_and_print), keyserver.c (parse_keyserver_options):
--auto-key-retrieve should really be a keyserver-option variable.
* import.c (revocation_present): new function to print a warning
if a key is imported that has been revoked by designated revoker,
but the designated revoker is not present to verify the
revocation. If keyserver-options auto-key-retrieve is set, try
and fetch the designated revoker from the keyserver.
* import.c (import_one): call revocation_present after importing a
new key. Note that this applies to --import, --recv-keys, and
--search-keys.
* keyserver-internal.h, keyserver.c (keyserver_import_fprint):
import via fingerprint (for revocation keys).
* keyserver.c (keyserver_import_keyid): much simpler
implementation now that we're using KEYDB_SEARCH_DESC internally.
2002-03-04 David Shaw <dshaw@jabberwocky.com>
* revoke.c (gen_revoke): do not prompt for revocation reason for
v3 revocations (unless force-v4-certs is on) since they wouldn't
be used anyway.
* keyedit.c (menu_revsig): show the status of the sigs
(exportable? revocable?) to the user before prompting for which
sig to revoke. Also, make sure that local signatures get local
revocations.
* keyedit.c (ask_revoke_sig): remind the user which sigs are
local.
* g10.c (main): Add "exec-path" variable to override PATH for
execing programs.
* export.c (do_export_stream): properly check return code from
classify_user_id to catch unclassifiable keys.
2002-03-03 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (parse_signature): variable type tweak for RISC
OS (from Stefan)
2002-02-28 David Shaw <dshaw@jabberwocky.com>
* getkey.c (check_revocation_keys): New function to check a
revocation against a list of potential revocation keys. Note the
loop-breaking code here. This is to prevent blowing up if A is
B's revocation key, while B is also A's. Note also that this is
written so that a revoked revoker can still issue revocations:
i.e. If A revokes B, but A is revoked, B is still revoked. I'm
not completely convinced this is the proper behavior, but it
matches how PGP does it. It does at least have the advantage of
much simpler code - my first version of this had lots of loop
maintaining code so you could chain revokers many levels deep and
if D was revoked, C was not, which meant that B was, and so on.
It was sort of scary, actually.
* getkey.c (merge_selfsigs_main): Add any revocation keys onto the
pk. This is particularly interesting since we normally only get
data from the most recent 1F signature, but you need multiple 1F
sigs to properly handle revocation keys (PGP does it this way, and
a revocation key could be marked "sensitive" and hence in a
different signature). Also, if a pk has a revocation key set,
check for revocation sigs that were not made by us - if made by a
valid revocation key, mark the pk revoked.
* packet.h, getkey.c (cache_public_key): do not cache key if
"dont_cache" is set. This allows the revocation key code to look
up a key and return information that may be inaccurate to prevent
loops without caching the fake data.
* packet.h, sig-check.c (do_signature_check): Record if a
signature was made by a revoked pk.
* packet.h, parse-packet.c (parse_one_sig_subpkt,
can_handle_critical, parse_signature): Get revocation key
information out of direct sigs.
* keylist.c (list_keyblock_print): don't assume that the presence
of a 0x20 signature means the key is revoked. With revocation
keys, this may not be true if the revocation key is not around to
verify it or if verification failed. Also, 0x1F should get listed
as "sig", and not "unexpected signature class".
* keyedit.c (show_key_with_all_names): Add a flag for printing
revoker information and change all callers.
* import.c (merge_blocks): merge in any new direct key (0x1F)
sigs.
* import.c (import_revoke_cert): don't keep processing after a
revocation is rejected.
* import.c (delete_inv_parts): Allow importing a revocation
signature even if it was not issued by the key. This allows a
revocation key to issue it. Of course, the sig still needs to be
checked before we trust it.
* free-packet.c (copy_public_key): Include a new copy of the
revocation keys when duping a pk.
* free-packet.c (free_seckey_enc, release_public_key_parts): Free
any revocation keys that are attached to a sig or pk.
* export.c (do_export_stream): Do not export signatures with
"sensitive" revocation keys in them.
2002-02-27 David Shaw <dshaw@jabberwocky.com>
* export.c (do_export_stream): Do not include v3 keys in a
--export-secret-subkeys export.
* getkey.c (merge_selfsigs_main): If a key isn't valid (say,
because of no self-signature), allow --always-trust to force it
valid so it can be trusted.
2002-02-25 David Shaw <dshaw@jabberwocky.com>
* hkp.c (hkp_ask_import), hkp.h, keyserver.c (all): treat key
lists internally as fingerprints when possible. All this is via
KEYDB_SEARCH_DESC - no point in reinventing the wheel. This allows
the helper program to search the keyserver by fingerprint if
desired (and the keyserver supports it). Note that automatic
fingerprint promotion during refresh only applies to v4 keys as a
v4 fingerprint can be easily changed into a long or short key id,
and a v3 cannot.
* pubkey-enc.c, getkey.c, misc.c, main.h: Take two copies of
hextobyte() from pubkey-enc.c and getkey.c and make them into one
copy in misc.c.
2002-02-22 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_search_prompt): Detect a "no keys found"
case even if the helper program does not explicitly say how many
keys were found.
* hkp.c (parse_hkp_index): Bug fix - don't report non-revoked keys
as revoked in HKP key searches.
2002-02-19 Werner Koch <wk@gnupg.org>
* parse-packet.c (parse_trust): Made parsing more robust.
2002-02-19 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index): Catch corruption in HKP index lines
(can be caused by broken or malicious keyservers).
* keyserver.c (keyserver_work): Add KEYSERVER_NOT_SUPPORTED for
unsupported actions (say, a keyserver that has no way to search,
or a readonly keyserver that has no way to add). Also add a
USE_EXTERNAL_HKP define to disable the internal HKP keyserver
code.
2002-02-14 Werner Koch <wk@gnupg.org>
* g10.c: New option --no-use-agent.
* pkclist.c (check_signatures_trust): Always print the warning for
unknown and undefined trust. Removed the did_add cruft. Reported
by Janusz A. Urbanowicz.
2002-02-11 David Shaw <dshaw@jabberwocky.com>
* hkp.c (parse_hkp_index): Bug fix - properly handle user IDs with
colons (":") in them while HKP searching.
2002-02-09 David Shaw <dshaw@jabberwocky.com>
* misc.c (pct_expando): More comments.
* keydb.h, sign.c (mk_notation_and_policy): Clarify what is a sig
and what is a cert. A sig has sigclass 0x00, 0x01, 0x02, or 0x40,
and everything else is a cert.
* g10.c (main), keyedit.c (keyedit_menu): Add a "nrlsign" for
nonrevocable and local key signatures.
* g10.c (main): Add a --no-force-mdc to undo --force-mdc.
* options.h, g10.c (main), cipher.c (write_header): Add a knob to
--disable-mdc/--no-disable-mdc. Off by default, of course, but is
used in --pgp2 and --pgp6 modes.
* pkclist.c (build_pk_list): Allow specifying multiple users in
the "Enter the user ID" loop. Enter a blank line to stop. Show
each key+id as it is added.
* keylist.c (show_policy_url), mainproc.c (print_notation_data):
It is not illegal (though possibly silly) to have multiple policy
URLs in a given signature, so print all that are present.
* hkp.c (hkp_search): More efficient implementation of URL-ifying
code.
2002-02-04 David Shaw <dshaw@jabberwocky.com>
* main.h, misc.c (pct_expando): New function to generalize
%-expando processing in any arbitrary string.
* photoid.c (show_photo): Call the new pct_expando function rather
than expand strings internally.
* sign.c (mk_notation_and_policy): Show policy URLs and notations
when making a signature if show-policy/show-notation is on.
%-expand policy URLs during generation. This lets the user have
policy URLs of the form "http://notary.jabberwocky.com/keysign/%K"
which will generate a per-signature policy URL.
* main.h, keylist.c (show_policy_url, show_notation): Add amount
to indent so the same function can be used in key listings as well
as during sig generation. Change all callers.
2002-02-04 David Shaw <dshaw@jabberwocky.com>
* keyserver.c, options.h (parse_keyserver_options, keyidlist):
Workaround for the pksd and OKS keyserver bug that calculates v4
RSA keyids as if they were v3. The workaround/hack is to fetch
both the v4 (e.g. 99242560) and v3 (e.g. 68FDDBC7) keyids. This
only happens for key refresh while using the HKP scheme and the
refresh-add-fake-v3-keyids keyserver option must be set. This
should stay off by default.
2002-02-03 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Bug fix - do not append keys to
each other when --sending more than one.
2002-02-02 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c (main), keyedit.c (sign_uids), sign.c
(mk_notation_and_policy): Split "--set-policy-url" into
"--cert-policy-url" and "--sig-policy-url" so the user can set
different policies for key and data signing. For backwards
compatibility, "--set-policy-url" sets both, as before.
2002-01-30 Werner Koch <wk@gnupg.org>
* g10.c (main): --gen-random --armor does now output a base64
encoded string.
2002-01-28 David Shaw <dshaw@jabberwocky.com>
* g10.c (main), options.h, pkclist.c (algo_available): --pgp6
flag. This is not nearly as involved as --pgp2. In short, it
turns off force_mdc, turns on no_comment, escape_from, and
force_v3_sigs, and sets compression to 1. It also restricts the
user to IDEA (if present), 3DES, CAST5, MD5, SHA1, and RIPEMD160.
See the comments above algo_available() for lots of discussion on
why you would want to do this.
2002-01-27 David Shaw <dshaw@jabberwocky.com>
* keygen.c (keygen_set_std_prefs): Comment
* keyedit.c (sign_uids): Bug fix - when signing with multiple
secret keys at the same time, make sure each key gets the sigclass
prompt.
* exec.c (exec_finish): Close the iobuf and FILE before trying to
waitpid, so the remote process will get a SIGPIPE and exit. This
is only a factor when using a pipe to communicate.
* exec.c (exec_write): Disable cache-on-close of the fd iobuf (is
this right? Why is a fd iobuf cached at all?)
2002-01-26 Werner Koch <wk@gnupg.org>
* g10.c, options.h: New option --gpg-agent-info
* passphrase.c (agent_open): Let it override the environment info.
* seckey-cert.c (check_secret_key): Always try 3 times when the
agent is enabled.
* options.skel: Describe --use-agent.
2002-01-24 David Shaw <dshaw@jabberwocky.com>
* pubkey-enc.c (is_algo_in_prefs, get_it): Only check preferences
against keys with v4 self sigs - there is really little point in
warning for every single non-IDEA message encrypted to an old key.
* pkclist.c (select_algo_from_prefs): Only put in the fake IDEA
preference if --pgp2 is on.
* mainproc.c (check_sig_and_print): Print "Expired" for expired
but good signatures (this still prints "BAD" for expired but bad
signatures).
2002-01-23 David Shaw <dshaw@jabberwocky.com>
* keygen.c (ask_keysize): Cosmetic: don't present a RSA signing
key as a "keypair" which can be 768 bits long (as RSA minimum is
1024).
* pubkey-enc.c (is_algo_in_prefs): Allow IDEA as a fake preference
for v3 keys with v3 selfsigs.
2002-01-22 David Shaw <dshaw@jabberwocky.com>
* packet.h, getkey.c (merge_selfsigs_main), pkclist.c
(select_algo_from_prefs): Implement the fake IDEA preference as
per RFC2440:12.1. This doesn't mean that IDEA will be used (the
plugin may not be present), but it does mean that a v3 key with a
v3 selfsig has an implicit IDEA preference instead of 3DES. v3
keys with v4 selfsigs use preferences as normal.
* encode.c (encode_crypt): if select_algo_from_prefs fails, this
means that we could not find a cipher that both keys like. Since
all v4 keys have an implicit 3DES preference, this means there is
a v3 key with a v3 selfsig in the list. Use 3DES in this case as
it is the safest option (we know the v4 key can handle it, and
we'll just hope the v3 key is being used in an implementation that
can handle it). If --pgp2 is on, warn the user what we're doing
since it'll probably break PGP2 compatibility.
* g10.c (main): Do not force using IDEA for encrypted files in
--pgp2 mode - let the fake IDEA preference choose this for us for
better compatibility when encrypting to multiple keys, only some
of which are v3.
* keygen.c (keygen_set_std_prefs): Put 3DES on the end of the
default cipher pref list (RFC2440: "...it is good form to place it
there explicitly."). If the user has the IDEA plugin installed,
put a preference for IDEA *after* 3DES to effectively disable its
use for everything except encrypting along with v3 keys.
* encode.c, g10.c, sign.c: Change the PGP2 warning line from
"... will not be usable ..." to "... may not be usable ..." as the
user could be using one of the enhanced PGP2 variations.
* helptext.c: Revise the sign_uid.class help text as suggested by
Stefan.
2002-01-20 Werner Koch <wk@gnupg.org>
* passphrase.c (passphrase_to_dek): Add tryagain_text arg to be
used with the agent. Changed all callers.
(agent_get_passphrase): Likewise and send it to the agent
* seckey-cert.c (do_check): New arg tryagain_text.
(check_secret_key): Pass the string to do_check.
* keygen.c (ask_passphrase): Set the error text is required.
* keyedit.c (change_passphrase): Ditto.
* passphrase.c (agent_open): Disable opt.use_agent in case of a
problem with the agent.
(agent_get_passphrase): Ditto.
(passphrase_clear_cache): Ditto.
2002-01-19 Werner Koch <wk@gnupg.org>
* passphrase.c (agent_open): Add support for the new Assuan based
gpg-agent. New arg to return the used protocol version.
(agent_get_passphrase): Implemented new protocol here.
(passphrase_clear_cache): Ditto.
(readline): New.
2002-01-15 Timo Schulz <ts@winpt.org>
* encode.c (encode_crypt_files): Fail if --output is used.
* g10.c: New command --decrypt-files.
* decrypt.c (decrypt_messages): New.
2002-01-09 David Shaw <dshaw@jabberwocky.com>
* g10.c, misc.c, gpgv.c: move idea_cipher_warn to misc.c so gpgv.c
doesn't need a stub for it any longer.
* g10.c (get_temp_dir), main.h: no longer used (it's in exec.c now)
* g10.c (main), delkey.c (delete_keys), main.h : Allow
--delete-key (now --delete-keys, though --delete-key still works,
of course) to delete multiple keys in one go. This applies to
--delete-secret-key(s) and --delete-secret-and-public-key(s) as
well.
2002-01-09 Timo Schulz <ts@winpt.org>
* encode.c (encode_crypt_files): Now it behaves like verify_files.
* g10.c (main): We don't need to check argc for encode_crypt_files
any longer.
2002-01-09 Timo Schulz <ts@winpt.org>
* exec.c: Include windows.h for dosish systems.
2002-01-08 Timo Schulz <ts@winpt.org>
* g10.c (main): New description for --encrypt-files.
2002-01-08 Werner Koch <wk@gnupg.org>
* g10.c (main): Must register the secring for encryption because
it is needed to figure out the default recipient. Reported by
Roger Sondermann.
2002-01-05 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_adduid): Require --expert before adding a photo
ID to a v3 key, and before adding a second photo ID to any key.
* keyedit.c (keyedit_menu): Don't allow adding photo IDs in
rfc1991 or pgp2 mode.
* getkey.c (merge_selfsigs_subkey): Permit v3 subkeys. Believe it
or not, this is allowed by rfc 2440, and both PGP 6 and PGP 7 work
fine with them.
* g10.c, options.h, keyedit.c, sign.c: Move the "ask for
expiration" switch off of --expert, which was getting quite
overloaded, and onto ask-sig-expire and ask-cert-expire. Both
default to off.
* g10.c (main): Change the default compression algo to 1, to be
more OpenPGP compliant (PGP also uses this, so it'll help with
interoperability problems as well).
* encode.c (encode_crypt): Handle compression algo 2, since the
default is now 1.
* build-packet.c (build_attribute_subpkt): Fix off-by-one error.
2002-01-05 Werner Koch <wk@gnupg.org>
* g10.c (main): Do not register the secret keyrings for certain
commands.
* keydb.c (keydb_add_resource): Use access to test for keyring
existence. This avoids cached opened files which are bad under
RISC OS.
2002-01-04 David Shaw <dshaw@jabberwocky.com>
* sign.c (sign_file, sign_symencrypt_file): always use one-pass
packets unless rfc1991 is enabled. This allows a signature made
with a v3 key to work in PGP 6 and 7. Signatures made with v4
keys are unchanged.
* g10.c (main): Disallow non-detached signatures in PGP2 mode.
Move the "you must use files and not pipes" PGP2 warning up so all
the PGP2 stuff is together.
* encode.c (encode_simple): Use the actual filesize instead of
partial length packets in the internal literal packet from a
symmetric message. This breaks PGP5(?), but fixes PGP2, 6, and 7.
It's a decent tradeoff. Note there was only an issue with
old-style RFC1991 symmetric messages. 2440-style messages in 6
and 7 work with or without partial length packets.
2002-01-03 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Removed --no-default-check-level option, as it is
not consistent with other "default" options. Plus, it is the same
as saying --default-check-level 0.
* exec.c (exec_read): Disallow caching tempfile from child
process, as this keeps the file handle open and can cause unlink
problems on some platforms.
* keyserver.c (keyserver_search_prompt): Minor tweak - don't
bother to transform keyids into textual form if they're just going
to be transformed back to numbers.
2002-01-03 Timo Schulz <ts@winpt.org>
* g10.c: New command --encrypt-files.
* verify.c (print_file_status): Removed the static because
encode_crypt_files also uses this function.
* main.h (print_files_status): New.
(encode_crypt_files): New.
* encode.c (encode_crypt_files): New.
2002-01-02 Stefan Bellon <sbellon@sbellon.de>
* keyserver.c: Moved util.h include down in order to avoid
redefinition problems on RISC OS.
* keyring.c (keyring_lock): Only lock keyrings that are writable.
* keyring.c (keyring_update_keyblock): Close unused iobuf.
* hkp.c (parse_hkp_index, hkp_search) [__riscos__]: Changed
unsigned char* to char* because of compiler issues.
* exec.c (exec_finish) [__riscos__]: Invalidate close cache so
that file can be unlinked.
2001-12-28 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Use a different strlist to check extensions since
they need to be handled seperately now.
* misc.c,main.h (check_permissions): Properly handle permission
and ownership checks on files in the lib directory
(e.g. /usr/local/lib/gnupg), which are owned by root and are
world-readable, and change all callers to specify extension or
per-user file.
* photoid.c (show_photo), keyserver.c (keyserver_spawn): Bug fix -
don't call exec_finish if exec_write fails.
* keyserver.c (keyserver_spawn): Look for OPTIONS from the
keyserver helper - specifically, a "OUTOFBAND" option for the
email keyserver.
* mainproc.c (list_node), keylist.c (list_keyblock_colon),
import.c (delete_inv_parts), export.c (do_export_stream): Use
signature flags for exportability check rather than re-parsing the
subpacket.
* keyid.c, keydb.h (get_lsign_letter): No longer needed.
2001-12-27 David Shaw <dshaw@jabberwocky.com>
* exec.c (exec_finish): Show errors when temp files cannot be
deleted for whatever reason.
* exec.c (exec_read): Don't rely on WEXITSTATUS being present.
* exec.c (make_tempdir): Add temp file creator for win32. Don't
create an incoming temp file if the exec is write-only.
* keyserver.c (keyserver_spawn): Clean up error handling, for when
the spawn fails.
* photoid.c (show_photo): Clean up error handling.
* misc.c (check_permissions): Neaten.
2001-12-25 David Shaw <dshaw@jabberwocky.com>
* mkdtemp.c (mkdtemp): Add copyleft info and tweak the 'X' counter
to be a bit simpler.
* keyserver.c, photoid.c: Remove unused headers left over from
when the exec functions lived there.
2001-12-23 Timo Schulz <ts@winpt.org>
* misc.c (check_permissions): Do not use it for W32 systems.
* tdbio.c (migrate_from_v2): Define ftruncate as chsize() for W32.
* mkdtemp.c: W32 support.
* photoid.c: Ditto.
* exec.c: Ditto.
2001-12-22 David Shaw <dshaw@jabberwocky.com>
* exec.c (make_tempdir): avoid compiler warning with const
* mkdtemp.c (mkdtemp): catch the empty ("") string case in case
someone repurposes mkdtemp at some point.
* photoid.c (generate_photo_id, show_photo): some type changes
from Stefan Bellon.
* exec.c (make_tempdir): handle Win32 systems, suggested by Timo
Schulz.
2001-12-22 Werner Koch <wk@gnupg.org>
* encode.c (encode_simple, encode_crypt): i18n 2 strings.
2001-12-22 Timo Schulz <ts@winpt.org>
* encode.c (encode_simple, encode_crypt): Use is_file_compressed
to avoid to compress compressed files.
2001-12-22 Werner Koch <wk@gnupg.org>
* keyserver.c (keyserver_spawn): Removed some variables
declaration due to shadowing warnings.
* build-packet.c (build_attribute_subpkt): s/index/idx/ to avoid
compiler warnig due to index(3).
* getkey.c (get_ctx_handle): Use KEYDB_HANDLE as return value.
* keylist.c (list_one): Made resname const.
* keyedit.c (keyedit_menu): Allow "addphoto" only when --openpgp is
not used.
* options.skel: Changed one example photo viewer to qiv.
2001-12-21 David Shaw <dshaw@jabberwocky.com>
* Makefile.am: add exec.c, exec.h, photoid.c, and photoid.h
* build-packet.c (build_attribute_subpkt): new function to build
the raw attribute subpacket. Note that attribute subpackets have
the same format as signature subpackets.
* exec.c: new file with generic exec-a-program functionality.
Used by both photo IDs and keyserver helpers. This is pretty much
the same code that used to be keyserver specific, with some
changes to be usable generically.
* free-packet.c (free_attributes (new)): function to free an
attribute packet.
* gpgv.c: added stub show_photo
* keyedit.c (keyedit_menu, menu_adduid, menu_showphoto): can add a
photo (calls generate_photo_id), or display a photo (calls
show_photo) from the --edit menu. New commands are "addphoto",
and "delphoto" (same as "deluid").
* keylist.c (list_keyblock_print): show photos during key list if
--show-photos enabled.
* keyserver.c (keyserver_spawn): use the generic exec_xxx
functions to call keyserver helper.
* g10.c, options.h: three new options - --{no-}show-photos, and
--photo-viewer to give the command line to display a picture.
* options.skel: instructions for the photo viewer
* parse-packet.c (parse_user_id, setup_user_id (new)): common code
for both user IDs and attribute IDs moved to setup_user_id.
* parse-packet.c (make_attribute_uidname (new)): constructs a fake
"name" for attribute packets (e.g. "[image of size ...]")
* parse-packet.c (parse_attribute (replaces parse_photo_id),
parse_attribute_subpkts): Builds an array of individual
attributes. Currently only handles attribute image / type jpeg
subpackets.
* sign.c (hash_uid): Fix bug in signing attribute (formerly
photo_id) packets.
* packet.h, and callers: globally change "photo_id" to "attribute"
and add structures for attributes. The packet format is generic
attributes, even though the only attribute type thus far defined
is jpeg.
2001-12-21 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (can_handle_critical): Can handle critical
revocation subpackets now.
* trustdb.c (mark_usable_uid_certs): Disregard revocations for
nonrevocable sigs. Note that this allows a newer revocable
signature to override an older nonrevocable signature.
* sign.c (make_keysig_packet): add a duration field and change all
callers. This makes make_keysig_packet closer to
write_signature_packets and removes some duplicated expiration
code.
* keyedit.c (keyedit_menu, menu_revsig, sign_uids,
sign_mk_attrib): Add nrsign command, don't allow revoking a
nonrevocable signature,
* g10.c (main): Add --nrsign option to nonrevocably sign a key
from the command line.
* build-packet.c (build_sig_subpkt_from_sig): Comment to explain
the use of CRITICAL.
2001-12-21 Werner Koch <wk@gnupg.org>
* g10.c. options.h : New option --show-keyring
* getkey.c (get_ctx_handle): New.
* keylist.c (list_one): Implement option here. By David Champion.
2001-12-20 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Use mkdtemp() to make temp
directory.
* mkdtemp.c: replacement function for those platforms that don't
have mkdtemp (make a temp directory securely).
2001-12-19 David Shaw <dshaw@jabberwocky.com>
* misc.c (check_permissions): New function to stat() and ensure
the permissions of GNUPGHOME and the files have safe permissions.
* keydb.c (keydb_add_resource): Check keyring permissions.
* tdbio.c (tdbio_set_dbname): Check permissions of trustdb.gpg
* keyserver.c (keyserver_spawn): Disable keyserver schemes that
involve running external programs if the options file has unsafe
permissions or ownership.
* g10.c, options.h: New option --no-permission-warning to disable
the permission warning message(s). This also permits use of the
keyserver if it had been disabled (see above). Also check the
permissions/ownership of random_seed.
* keyserver.c (keyserver_spawn): The new glibc prints a warning
when using mktemp() (the code was already secure, but the warning
was bound to cause confusion). Use a different implementation
based on get_random_bits() instead. Also try a few times to get
the temp dir before giving up.
2001-12-19 Werner Koch <wk@gnupg.org>
* g10.c, passphrase.c [CYGWIN32]: Allow this as an alias for MINGW32.
2001-12-18 David Shaw <dshaw@jabberwocky.com>
* g10.c (idea_cipher_warn): Add a flag to show the warning always
or once per session and change all callers (show always except for
the secret key protection and unknown cipher from an encrypted
message errors). Also make the strings translatable.
* pubkey-enc.c (get_it): Add the IDEA cipher warning if the user
tries to decrypt an IDEA encrypted message without the IDEA
plugin.
* keyserver.c (parse_keyserver_uri): More strict checking of the
keyserver URI. Specifically, fail if the ":port" section is
anything except a number between 1 and 65535.
2001-12-17 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (print_keyinfo): No need to check for
control/illegal characters, as utf8_to_native does this for us.
* mainproc.c (proc_encrypted): Use generic IDEA warning.
* gpgv.c: add stub for idea_cipher_warn
* g10.c, hkp.c, keyserver.c: Fix capitalization and plural issues.
* encode.c (encode_crypt), sign.c (sign_file, clearsign_file):
disable pgp2 mode after the message is no longer pgp2 compatible.
* g10.c (main): Tweak the PGP2.x IDEA warning to use the generic
warning, and not merely fail if the IDEA plugin isn't there.
* g10.c (main, idea_cipher_warn), keygen.c (set_one_pref),
seckey-cert.c (do_check): Add a generic IDEA warning for when the
IDEA plugin is not present. This pops up when the user uses
"--cipher-algo idea", when setpref is used to set a "S1"
preference, and when a secret key protected with IDEA is used.
2001-12-15 Werner Koch <wk@gnupg.org>
* keyserver.c (keyserver_spawn): Assert that we have dropped privs.
2001-12-13 Werner Koch <wk@gnupg.org>
* pubkey-enc.c (get_session_key): Check that the public key
algorithm is indeed usable for en/decryption. This avoid a
strange error message from pubkey_decrypt if for some reasons a
bad algorithm indentifier is passed.
2001-12-12 David Shaw <dshaw@jabberwocky.com>
* Fixed some types for portability. Noted by Stefan Bellon.
2001-12-11 Werner Koch <wk@gnupg.org>
* hkp.c (hkp_export): Do not print possible control characters
from a keyserver response.
(parse_hkp_index): Made uid an unsigned char* because it is passed to
isspace().
(hkp_search): Ditto for the char* vars.
* g10.c (main): Print the IDEA warning also for -c and -se.
* g10.c (get_temp_dir): Assert that we have dropped privs
* encode.c (encode_crypt): Include the first key into the --pgp2
check.
2001-12-07 David Shaw <dshaw@jabberwocky.com>
* g10.c, options.h: New option --pgp2. This is identical to
"--rfc1991 --cipher-algo idea --compress-algo 1 --digest-algo md5
--force_v3_sigs" with the addition of an warning to advise the
user not to use a pipe (which would break pgp2 compatibility).
* encode.c (encode_crypt): warn if the user tries to encrypt to
any key that is not RSA and <= 2048 bits when the --pgp2 option is
used.
* sign.c (sign_file, clearsign_file): When using --pgp2, make a v3
sig, and warn if the signature is made with a non-v3 key.
2001-12-05 David Shaw <dshaw@jabberwocky.com>
* sign.c (sign_file, clearsign_file, sign_symencrypt_file): Prompt
for sig expiration if --expert is set and --force-v3-sigs is not
set (v3 sigs cannot expire).
* mainproc.c (check_sig_and_print): After checking a sig, print
expiration status. This causes a error return if the sig is
expired.
* build-packet.c (build_sig_subpkt_from_sig): Include a critical
sig expiration subpacket if the sig is to expire.
* keyedit.c (sign_uids): Do not sign an expired key unless
--expert is set, in which case prompt. Also, offer to expire a
signature when the key the user is signing expires.
* keygen.c (ask_expire_interval): Add a value to determine whether
to prompt for a key or sig expiration and change all callers.
* keyid.c: New functions: expirestr_from_sig and
colon_expirestr_from_sig.
* keylist.c (list_keyblock_colon): Show sig expiration date in the
--with-colons listing.
* sign.c (make_keysig_packet, write_signature_packets): Pass in an
optional timestamp for the signature packet, and change all
callers.
* keyedit.c (sign_mk_attrib): Include a critical expiration
subpacket in the signature if an expiration date is given.
2001-12-04 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (sign_uids): If the user tries to sign a
locally-signed key, allow the cert to be promoted to a full
exportable signature. This essentially deletes the old
non-exportable sig, and replaces it with a new exportable one.
2001-12-04 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (keyedit_menu): Do not allow signing a revoked key
unless --expert is set, and ask even then.
* keyedit.c (sign_uids): Do not allow signing a revoked UID unless
--expert is set, and ask even then.
* g10.c, options.h : New option --expert
2001-11-16 David Shaw <dshaw@jabberwocky.com>
* Allow the user to select no compression via "--compress-algo 0"
on the command line.
* keyedit.c (show_prefs): Show compression preferences in the
long-form "showpref" style.
* keygen.c (set_one_pref): Permit setting a no-compression ("Z0")
preference.
* getkey.c (fixup_uidnode): Fix compression preference corruption
bug.
2001-12-02 David Shaw <dshaw@jabberwocky.com>
* g10.c: Add advisory --for-your-eyes-only option as per section
5.9 of 2440.
2001-12-05 David Shaw <dshaw@jabberwocky.com>
* Force a V4 sig if the user has a notation or policy URL set.
2001-12-04 David Shaw <dshaw@jabberwocky.com>
* g10.c: Add options --keyserver-options, --temp-directory, and
auto-key-retrieve (the opposite of no-auto-key-retrieve).
* hkp.c (hkp_search): New function to handle searching a HKP
keyserver for a key
* hkp.c (hkp_ask_import, hkp_export): Pretty large changes to make
them communicate via the generic functions in keyserver.c
* keyserver.c: new file with generic keyserver routines for
getting keys from a keyserver, sending keys to a keyserver, and
searching for keys on a keyserver. Calls the internal HKP stuff
in hkp.c for HKP keyserver functions. Other calls are handled by
an external program which is spawned and written to and read from
via pipes. Platforms that don't have pipes use temp files.
2001-11-20 David Shaw <dshaw@jabberwocky.com>
* options.h, g10.c: New options show-notation, no-show-notation,
default-check-level, no-default-check-level, show-policy-url,
no-show-policy-url.
* packet.h, sign.c (make_keysig_packet), parse-packet.c
(parse_signature), free-packet.c (free_seckey_enc): Fill in
structures for notation, policy, sig class, exportability, etc.
* keyedit.c, keylist.c (print_and_check_one_sig,
list_keyblock_print): Show flags in signature display for cert
details (class, local, notation, policy, revocable). If selected,
show the notation and policy url.
* keyedit.c (sign_uids): Prompt for and use different key sig
classes.
* helptext.c (helptexts): Add help text to explain different
key signature classes
2001-11-26 David Shaw <dshaw@jabberwocky.com>
* trustdb.c (mark_usable_uid_certs): Fix segfault from bad
initialization and fix reversed key signature expiration check.
2001-11-09 Werner Koch <wk@gnupg.org>
* export.c (do_export_stream): Put all given names into a search
description and change the loop so that all matching names are
returned.
2001-11-08 Werner Koch <wk@gnupg.org>
* pubkey-enc.c (get_it): To reduce the number of questions on the
MLs print the the name of cipher algorithm 1 with the error message.
* mainproc.c: Changed the way old rfc1991 encryption cipher is
selected. Based on a patch by W Lewis.
* pkclist.c (do_edit_ownertrust): Allow to skip over keys, the non
working "show info" is now assigned to "i"
* trustdb.c (ask_ownertrust, validate_keys): Implement a real quit
here. Both are by David Shaw.
* trustdb.c (validate_keys): Make sure next_exipire is initialized.
* sign.c (make_keysig_packet): Use SHA-1 with v4 RSA keys.
* g10.c, options.h : New option --[no-]froce-v4-certs.
* sign.c (make_keysig_packet): Create v4 sigs on v4 keys even with
a v3 key. Use that new option. By David Shaw
* revoke.c (ask_revocation_reason): Allow to select "no reason".
By David Shaw.
* keyid.c (fingerprint_from_sk): Calculation of an v3 fpr was
plain wrong - nearly the same code in fingerprint_from_pk is correct.
* build-packet.c (do_secret_key): Added a few comments to the code.
2001-11-07 Werner Koch <wk@gnupg.org>
* g10.c (main): Print a warning when -r is used w/o encryption.
Suggested by Pascal Scheffers.
2001-10-23 Werner Koch <wk@gnupg.org>
* keyedit.c (keyedit_menu): Changed helptext for showpref
command. Suggested by Reinhard Wobst.
* keyring.c (keyring_search): When marking the offtbl ready, take
into account that we may have more than one keyring.
2001-10-22 Werner Koch <wk@gnupg.org>
* Makefile.am: Do not use OMIT_DEPENDENCIES
* build-packet.c (build_sig_subpkt): Default is now to put all
types of subpackets into the hashed area and only list those which
should go into the unhashed area.
2001-10-18 Werner Koch <wk@gnupg.org>
* keydb.c (keydb_add_resource): Rearranged the way we keep track
of the resource. There will now be an entry for each keyring here
and not in keyring.c itself. Store a token to allow creation of a
keyring handle. Changed all functions to utilize this new design.
(keydb_locate_writable): Make a real implementation.
* keyring.c (next_kr): Removed and changed all callers to set the
resource directly from the one given with the handle.
(keyring_is_writable): New.
(keyring_rebuild_cache): Add an arg to pass the token from keydb.
2001-10-17 Werner Koch <wk@gnupg.org>
* keyring.c (keyring_search): Enabled word search mode but print a
warning that it is buggy.
2001-10-11 Werner Koch <wk@gnupg.org>
* hkp.c (hkp_ask_import): No more need to set the port number for
the x-hkp scheme.
(hkp_export): Ditto.
2001-10-06 Stefan Bellon <sbellon@sbellon.de>
* passphrase.c [__riscos__]: Disabled agent specific stuff.
* g10.c: New option --no-force-v3-sigs.
2001-10-04 Werner Koch <wk@gnupg.org>
* export.c (do_export_stream): Do not push the compress filter
here because the context would run out of scope due to the
iobuf_close done by the caller.
(do_export): Do it here instead.
2001-09-28 Werner Koch <wk@gnupg.org>
* keyedit.c (sign_uids): Always use the primary key to sign keys.
* getkey.c (finish_lookup): Hack to return only the primary key if
a certification key has been requested.
* trustdb.c (cmp_kid_for_make_key_array): Renamed to
(validate_one_keyblock): this and changed arg for direct calling.
(make_key_array): Renamed to
(validate_one_keyblock): this and changed args for direct calling.
(mark_usable_uid_certs, validate_one_keyblock)
(validate_key_list): Add next_expire arg to keep track of
expiration times.
(validate_keys): Ditto for UTKs and write the stamp.
* tdbio.c (migrate_from_v2): Check return code of tbdio_sync.
* tdbdump.c (import_ownertrust): Do a tdbio_sync().
* keyring.c: Made the offtbl an global object.
2001-09-27 Werner Koch <wk@gnupg.org>
* pkclist.c (do_edit_ownertrust): Allow settin of ultimate trust.
* trustdb.c (mark_keyblock_seen): New.
(make_key_array): Use it to mark the subkeys too.
(validate_keys): Store validity for ultimatly trusted keys.
2001-09-26 Werner Koch <wk@gnupg.org>
* pkclist.c (check_signatures_trust, do_we_trust): Removed the
invocation of add_ownertrust. Minor changes to the wording.
(add_ownertrust, add_ownertrust_cb): Removed.
* trustdb.c (get_validity): Allow to lookup the validity using a
subkey.
* trustdb.c (new_key_hash_table): Increased the table size to 1024
and changed the masks accordingly.
(validate): Changed stats printing.
(mark_usable_uid_certs): New.
(cmp_kid_for_make_key_array): Does now check the signatures and
figures out a usable one.
2001-09-25 Werner Koch <wk@gnupg.org>
* keyring.c (new_offset_item,release_offset_items)
(new_offset_hash_table, lookup_offset_hash_table)
(update_offset_hash_table, update_offset_hash_table_from_kb): New.
(keyring_search): Use a offset table to optimize search for
unknown keys.
(keyring_update_keyblock, keyring_insert_keyblock): Insert new
offsets.
* getkey.c (MAX_UNK_CACHE_ENTRIES): Removed the unknown keys
caching code.
* g10.c, options.h, import.c: Removed the entire
allow-secret-key-import stuff because the validity is now
controlled by other means.
* g10.c: New command --rebuild-keydb-caches.
* keydb.c (keydb_rebuild_caches): New.
* keyring.c (do_copy): Moved some code to
(create_tmp_file, rename_tmp_file, write_keyblock): new functions.
(keyring_rebuild_cache): New.
* packet.h (PKT_ring_trust): Add sigcache field.
* parse-packet.c (parse_trust): Parse sigcache.
* keyring.c (do_copy): Always insert a sigcache packet.
(keyring_get_keyblock): Copy the sigcache packet to the signature.
* sig-check.c (cache_sig_result): Renamed from
cache_selfsig_result. Changed implementation to use the flag bits
and changed all callers.
(mdc_kludge_check): Removed this unused code.
(do_check): Do not set the sig flags here.
* import.c (read_block): Make sure that ring_trust packets are
never imported.
* export.c (do_export_stream): and never export them.
* trustdb.c (make_key_array): Skip revoked and expired keys.
2001-09-24 Werner Koch <wk@gnupg.org>
* g10.c, options.h: New option --no-auto-check-trustdb.
* keygen.c (do_generate_keypair): Set newly created keys to
ultimately trusted.
* tdbio.h, tdbio.c: Removed all support for records DIR, KEY, UID,
PREF, SIG, SDIR and CACH. Changed migration function to work
direct on the file.
(tdbio_read_nextcheck): New.
(tdbio_write_nextcheck): New.
2001-09-21 Werner Koch <wk@gnupg.org>
Revamped the entire key validation system.
* trustdb.c: Complete rewrite. No more validation on demand,
removed some functions, adjusted to all callers to use the new
and much simpler interface. Does not use the LID anymore.
* tdbio.c, tdbio.h: Add new record types trust and valid. Wrote a
migration function to convert to the new trustdb layout.
* getkey.c (classify_user_id2): Do not allow the use of the "#"
prefix.
* keydb.h: Removed the TDBIDX mode add a skipfnc to the
descriptor.
* keyring.c (keyring_search): Implemented skipfnc.
* passphrase.c (agent_open): Add missing bracket. Include windows.h.
2001-09-19 Werner Koch <wk@gnupg.org>
* keylist.c (print_fingerprint): Renamed from fingerprint, made
global available. Added new arg to control the print style.
* mainproc.c (print_fingerprint): Removed.
* pkclist.c (print_fpr, fpr_info): Removed and changed callers to
use print_fingerprint.
* keyedit.c (show_fingerprint): Ditto.
* passphrase.c (writen, readn)
(agent_open, agent_close)
(agent_get_passphrase)
(passphrase_clear_cache): Support for W32. Contributed by Timo.
* import.c (import_one): Release keydb handles at 2 more places.
* keyring.c (keyring_release): Close the iobuf.
(keyring_get_keyblock): Init ret_kb to NULL and store error contidion.
* import.c (import_new_stats_handle): New.
(import_release_stats_handle): New.
(import_print_stats): Renamed from static fnc print_stats.
(import_keys, import_keys_stream): Add an optional status handle
arg and changed all callers.
* hkp.c (hkp_ask_import): Add an stats_handle arg and changed all
callers.
* mainproc.c (print_pkenc_list): Use print_utf8_string2().
2001-09-18 Werner Koch <wk@gnupg.org>
* g10.c: New command --refresh-keys.
* hkp.c (hkp_refresh_keys): New. Contributed by Timo Schulz.
* parse-packet.c (parse): Stop on impossible packet lengths.
2001-09-17 Werner Koch <wk@gnupg.org>
* mainproc.c (print_notation_data): Wrap notation data status lines
after 50 chars.
* mainproc.c (proc_pubkey_enc): Make option try-all-secrets work.
By disastry@saiknes.lv.
2001-09-14 Werner Koch <wk@gnupg.org>
* parse-packet.c (dump_sig_subpkt): List key server preferences
and show the revocable flag correctly. Contributed by David Shaw.
2001-09-09 Werner Koch <wk@gnupg.org>
* keyedit.c (keyedit_menu): No need to define another p.
* keylist.c (print_capabilities): s/used/use/ so that it
does not shadow a global.
* sign.c (sign_file): Renamed arg encrypt to encryptflag
* keygen.c: Replaced all "usage" by "use".
* misc.c (openpgp_pk_algo_usage): Ditto.
* pubkey-enc.c (get_it): Renamed arg k to enc so that the later
defined k does not shadow it.
* parse-packet.c (parse_gpg_control): No need to define another i.
* getkey.c (get_pubkey_byfprint): Must use the enum values and not
the fprint_len.
* keyring.c (keyring_search): Removed a non-sense break. Both
bugs pointed out by Stefan.
2001-09-07 Werner Koch <wk@gnupg.org>
* status.c, status.h: Added NO_RECP and ALREADY_SIGNED.
* pkclist.c (build_pk_list): Issue NO_RECP.
* keyedit.c (sign_uids): Added experimental ALREADY_SIGNED
* hkp.c (hkp_import): Use log_error. Bug reported by Neal H
Walfield.
* getkey.c (classify_user_id2): Change args to take the desc union
direct. It was a stupid idea to pass the individual fields of an
union to this function. Changed all callers.
(classify_user_id): Ditto and allow to pass NULL as the description.
2001-09-06 Werner Koch <wk@gnupg.org>
* getkey.c (fixup_uidnode): Features flag is now a bit vector.
* keygen.c (add_feature_mdc): Ditto.
Revamped the entire key I/O code to be prepared for other ways of
key storages and to get rid of the existing shit. GDBM support has
gone.
* keydb.c: New
* keyring.c, keyring.h: New.
* ringedit.c: Removed. Moved some stuff to keyring.c
* getkey.c: Changed everything related to the key retrieving
functions which are now using the keydb_ functions.
(prepare_search, word_match_chars, word_match)
(prepare_word_match, compare_name): Moved to keyring.c
(get_pubkey_byname): Removed ctx arg and add ret_kdbhd
arg. Changed all callers.
(key_byname): Use get_pubkey_end to release the context and take
new ret_kbdhd arg. Changed all callers.
(classify_user_id2): Fill the 16 byte fingerprint up with 4 null
bytes not with zero bytes of value 4, tsss.
* import.c (import_one): Updated to use the new keydb interface.
(import_secret_one): Ditto.
(import_revoke_cert): Ditto.
* delkey.c (do_delete_key): Ditto.
* keyedit.c (keyedit_menu): Ditto.
(get_keyblock_byname): Removed.
* revoke.c (gen_revoke): Ditto.
* export.c (do_export_stream): Ditto.
* trustdb.c (update_trustdb): Ditto.
* g10.c, gpgv.c (main): Renamed add_keyblock_resource to
keydb_add_resource.
* Makefile.am: Added and removed files.
* keydb.h: Moved KBNODE typedef and MAX_FINGERPRINT_LEN to
* global.h: this new header.
2001-09-03 Werner Koch <wk@gnupg.org>
* passphrase.c (agent_get_passphrase): Changed nread to size_t.
(passphrase_clear_cache): Ditto.
* keyid.c (mk_datestr): Avoid trigraphs.
(fingerprint_from_pk): Cache the keyid in the pk.
* options.h: Add opt.with_fingerprint so that we know whether the
corresponding options was used.
* g10.c (main): Set it here.
* pkclist.c (check_signatures_trust): Always print fingerprint
when this option is used. Mixed a minor memory leak.
* status.c, status.h: New status INV_RECP.
* pkclist.c (build_pk_list): Issue this status.
2001-08-31 Werner Koch <wk@gnupg.org>
* parse-packet.c (parse_key,parse_pubkeyenc)
(parse_signature): Return error on reading bad MPIs.
* mainproc.c (check_sig_and_print): Always print the user ID even
if it is not bound by a signature. Use the primary UID in the
status messages and encode them in UTF-8
* status.c (write_status_text_and_buffer): New.
2001-08-30 Werner Koch <wk@gnupg.org>
* packet.h (sigsubpkttype_t): Add SIGSUBPKT_FEATURES.
(PKT_public_key, PKT_user_id): Add a flag for it.
* parse-packet.c, build-packet.c: Add support for them.
* getkey.c (fixup_uidnode, merge_selfsigs): Set the MDC flags.
* keygen.c (add_feature_mdc): New.
(keygen_upd_std_prefs): Always set the MDC feature.
* keyedit.c (show_prefs): List the MDC flag
* pkclist.c (select_mdc_from_pklist): New.
* encode.c (encode_crypt, encrypt_filter): Test whether MDC
should be used.
* cipher.c (write_header): Set MDC use depending on the above test.
Print more status info.
* delkey.c (do_delete_key): Kludge to delete a secret key with no
public key available.
* ringedit.c (find_secret_keyblock_direct): New.
* getkey.c (seckey_available): Simplified.
* ringedit.c (cmp_seckey): Now compares the secret key against the
public key while ignoring all secret parts.
(keyring_search): Use a public key packet as arg. Allow to search
for subnkeys
(search): Likewise. Changed all callers.
(find_secret_keyblock_bypk): New.
(find_secret_keyblock_byname): First locate the pubkey and then
find the correponding secret key.
* parse-packet.c (parse): Renamed pkttype arg to onlykeypkts and
changed code accordingly. Changed all callers.
(search_packet): Removed pkttype arg.
* keyedit.c (keyedit_menu): First locate the public key and then
try to locate a secret key.
* ringedit.c (locate_keyblock_by_fpr): Removed.
(locate_keyblock_by_keyid): Removed.
(find_keyblock_bysk): Removed.
* sig-check.c (check_key_signature2): Print the keyid along with
the wrong sig class errors.
2001-08-24 Werner Koch <wk@gnupg.org>
* sign.c (sign_file): Stripped the disabled comment packet code.
(sign_file, sign_symencrypt_file): Moved common code to ..
(write_onepass_sig_packets): .. this new function.
(sign_file, clearsign_file, sign_symencrypt_file): Moved common
code to
(write_signature_packets): this new function.
(write_signature_packets, make_keysig_packet)
(update_keysig_packet): Moved common code to
(hash_uid, hash_sigclass_to_magic): these new functions
(sign_file, sign_symencrypt_file): Moved common code to
(write_plaintext_packet): this new function.
2001-08-21 Stefan Bellon <sbellon@sbellon.de>
* trustdb.c (query_trust_info): Changed trustlevel to signed int.
* g10.c [__riscos__]: Fixed handling of --use-agent --lock-multiple.
2001-08-20 Werner Koch <wk@gnupg.org>
* encr-data.c (decrypt_data): Keep track on whether we already
printed information about the used algorithm.
* mainproc.c (proc_encrypted): Removed the non-working IDEA hack
and print a message about the assumed algorithm.
* passphrase.c (passphrase_to_dek): Use the same algorithm as above.
(proc_symkey_enc): Print the algorithm, so that the user knows it
before entering the passphrase.
(proc_pubkey_enc, proc_pubkey_enc): Zero the DEK out.
* encode.c (encode_crypt, encrypt_filter): Ditto.
* g10.c: Allow for --sign --symmetric.
* sign.c (sign_and_symencrypt): New.
Applied patches from Stefan Bellon <sbellon@sbellon.de> to support
RISC OS. Nearly all of these patches are identified by the
__riscos__ macro.
* compress.c: Added a couple of casts.
* g10.c [__riscos__]: Some patches and new options foo-file similar
to all foo-fd options.
* gpgv.c, openfile.c, ringedit.c, tdbio.c: Minor fixes. Mainly
replaced hardcoded path separators with EXTSEP_S like macros.
* passprase.c [__riscos__]: Disabled agent stuff
* trustdb.c (check_trust): Changed r_trustlevel to signed int to
avoid mismatch problems in pkclist.c
* pkclist.c (add_ownertrust): Ditto.
* plaintext.c (handle_plaintext) [__riscos__]: Print a note when
file can't be created.
* options.h [__riscos__]: Use an extern unless included from the
main module.
* signal.c (got_fatal_signal) [__riscos__]: Close all files.
2001-08-14 Werner Koch <wk@gnupg.org>
* keygen.c (ask_algo): New arg r_usage. Allow for RSA keys.
(gen_rsa): Enabled the code.
(do_create): Enabled RSA branch.
(parse_parameter_usage): New.
(proc_parameter_file): Handle usage parameter.
(read_parameter_file): Ditto.
(generate_keypair): Ditto.
(generate_subkeypair): Ditto.
(do_generate_keypair): Ditto.
(do_add_key_flags): New.
(keygen_add_std_prefs): Use the new function.
(keygen_add_key_flags_and_expire): New.
(write_selfsig, write_keybinding): Handle new usage arg.
* build-packet.c (build_sig_subpkt): Make sure that key flags go
into the hashed area.
* keygen.c (write_uid): Initialize the reference cunter.
* keyedit.c (keyedit_menu): No more need to update the trustdb for
preferences. Added calls to merge keblock.
* kbnode.c (dump_kbnode): Print some more flags.
2001-08-10 Werner Koch <wk@gnupg.org>
Revamped the preference handling.
* packet.h (prefitem_t, preftype_t): New.
(PKT_public_key): Added a uid field.
(PKT_user_id): Added field to store preferences and a reference
counter.
* parse-packet.c (parse_user_id,parse_photo_id): Initialize them
* free-packet.c (free_user_id): Free them.
(copy_user_id): Removed.
(scopy_user_id): New.
(cmp_user_ids): Optimized for identical pointers.
(release_public_key_parts): Release the uid.
(copy_public_key_with_new_namehash): Removed.
(copy_prefs): New.
* keyedit.c (menu_adduid): Use the new shallow copy user id.
(show_prefs): Adjusted implementation.
(keyedit_menu): No more need to update the trustdb after changing
preferences.
* getkey.c (fixup_uidnode): Store preferences.
(find_by_name): Return a user id packet and remove namehash stuff.
(lookup): Removed the unused namehash stuff.
(finish_lookup): Added foundu arg.
(pk_from_block): Removed the namehash arg and changed all callers.
(merge_selfsigs): Copy prefs to all keys.
* trustdb.c (get_pref_data): Removed.
(is_algo_in_prefs): Removed.
(make_pref_record): Deleted and removed all class.
* pkclist.c (select_algo_from_prefs): Adjusted for the new
preference implementation.
* pubkey-enc.c (is_algo_in_prefs): New.
(get_it): Use that new function.
2001-08-09 Werner Koch <wk@gnupg.org>
* build-packet.c (build_sig_subpkt): Fixed calculation of
newarea->size.
* g10.c (main): New option "--preference-list"
* keyedit.c (keyedit_menu): New commands "setpref" and "updpref".
(menu_set_preferences): New.
* keygen.c (keygen_set_std_prefs): New.
(set_one_pref): New.
(check_zip_algo): New.
(keygen_get_std_prefs): New.
(keygen_upd_std_prefs): New
(keygen_add_std_prefs): Move the pref setting code into the above fnc.
* build-packet.c (build_sig_subpkt): Updated the list of allowed
to update subpackets.
2001-08-08 Werner Koch <wk@gnupg.org>
* packet.h (subpktarea_t): New.
(PKT_signature): Use that type for hashed_data and unhashed_data and
removed the _data prefix from those fields. Changed all users.
* parse-packet.c (parse_signature): Changed allocation for that.
(parse_sig_subpkt): Changed declaration
(enum_sig_subpkt): Ditto and changed implementation accordingly.
* free-packet.c (cp_subpktarea): Renamed from cp_data_block and
adjusted implementation. Changed caller.
* sig-check.c (mdc_kludge_check): Adjusted the hashing.
(do_check): Ditto.
* sign.c (sign_file, clearsign_file, make_keysig_packet,
update_keysig_packet): Ditto.
* build-packet.c (build_sig_subpkt): Partial rewrite.
(find_subpkt): Adjusted and made static.
(delete_sig_subpkt): Adjusted.
(do_signature): Ditto.
* keygen.c (ask_keysize): Do not print the notes about suggested
key sizes if just a DSA key is generated.
* trustdb.c (add_ultimate_key): s/log_error/log_info/ for
duplicated inserted trusted keys.
2001-08-07 Werner Koch <wk@gnupg.org>
* sign.c (sleep): Redefine for W32.
* g10.c, options.h: Set new flag opt.no_homedir_creation when
--no-options is given.
* openfile.c (try_make_homedir): Don't create the homedir in that case.
2001-08-03 Werner Koch <wk@gnupg.org>
* armor.c (armor_filter): Removed the default comment string
because it could get us in trouble due to translations using non
ascii characters.
2001-08-01 Werner Koch <wk@gnupg.org>
* keylist.c (list_keyblock_print): Do not list revoked UIDs unless
in verbose mode and we do no signature listing.
* getkey.c (finish_lookup): Skip subkeys which are not yet valid.
* g10.c, options.h: New option --ignore-valid-from.
* sign.c (make_keysig_packet): Added new sigversion argument to
allow the caller to force generation of required signature
version. Changed all callers. Suggested by Thomas Roessler.
* keyedit.c (sign_uids): Force v4 signature generation for local
sigs. Removed the check for local signature and pre-v4 keys.
2001-07-27 Werner Koch <wk@gnupg.org>
* keyedit.c (sign_uids): Check that we are not trying to to a
lsign with a pre-v4 key. Bug noticed by Thomas Roessler.
2001-07-26 Werner Koch <wk@gnupg.org>
* parse-packet.c (parse_photo_id): Reset all variables.
* getkey.c (merge_selfsigs_main): Removed checks on PHOTO_ID
because this is handled identically to a user ID.
2001-07-06 Werner Koch <wk@gnupg.org>
* cipher.c (write_header): Don't use MDC with --rfc1991. Suggested
by disastry@saiknes.lv.
2001-07-05 Werner Koch <wk@gnupg.org>
* g10.c, options.h: New option --preserve-permissions.
* ringedit.c (add_keyblock_resource): Use it here
(keyring_copy): and here.
* trustdb.c (verify_own_keys): Be more silent on --quiet.
Suggested by Thomas Roessler.
* sig-check.c (check_key_signature2): Ditto.
* mainproc.c (proc_encrypted, proc_tree): Ditto
* getkey.c (lookup): Ditto.
2001-07-04 Werner Koch <wk@gnupg.org>
* ringedit.c (add_keyblock_resource): Restore filename in case of error.
2001-06-25 Werner Koch <wk@gnupg.org>
* kbnode.c (dump_kbnode): Print the signature timestamp.
* keyedit.c (keyedit_menu): New menu point "primary".
(change_primary_uid_cb): New.
(menu_set_primary_uid): New.
* sign.c (update_keysig_packet): New.
* build-packet.c (build_sig_subpkt): Put the primary UID flag into
the hashed area. Allow update of some more packets.
2001-06-15 Werner Koch <wk@gnupg.org>
* getkey.c (merge_selfsigs): Exit gracefully when a secret key is
encountered. May happen if a secret key is in public keyring.
Reported by Francesco Potorti.
2001-06-12 Werner Koch <wk@gnupg.org>
* getkey.c (compare_name): Use ascii_memistr(), ascii_memcasecmp()
* keyedit.c (keyedit_menu): Use ascii_strcasecmp().
* armor.c (radix64_read): Use ascii_toupper().
* ringedit.c (do_bm_search): Ditto.
* keygen.c (read_parameter_file): Ditto.
* openfile.c (CMP_FILENAME): Ditto.
* g10.c (i18n_init): We can now use just LC_ALL.
2001-05-29 Werner Koch <wk@gnupg.org>
* keygen.c (generate_subkeypair): Print a warning if a subkey is
created on a v3 key. Suggested by Brian M. Carlson.
2001-05-27 Werner Koch <wk@gnupg.org>
* keyid.c (get_lsign_letter): New.
* keylist.c (list_keyblock_colon): Use it here.
* mainproc.c (list_node): and here.
* getkey.c, packet.h, free-packet.c: Removed that useless key
created field; I dunno why I introducded this at all - the
creation time is always bound to the key packet and subject to
fingerprint calculation etc.
* getkey.c (fixup_uidnode): Add keycreated arg and use this
instead of the signature timestamp to calculate the
help_key_expire. Bug reported by David R. Bergstein.
(merge_selfsigs_main): Correct key expiration time calculation.
(merge_selfsigs_subkey): Ditto.
2001-05-25 Werner Koch <wk@gnupg.org>
* revoke.c (gen_revoke): Add a cast to a tty_printf arg.
* delkey.c (do_delete_key): Ditto.
* keyedit.c (print_and_check_one_sig): Ditto.
(ask_revoke_sig): Ditto.
(menu_revsig): Ditto.
(check_all_keysigs): Removed unused arg.
2001-05-23 Werner Koch <wk@gnupg.org>
* g10.c (opts): Typo fix by Robert C. Ames.
2001-05-06 Werner Koch <wk@gnupg.org>
* revoke.c: Small typo fix
2001-05-04 Werner Koch <wk@gnupg.org>
* passphrase.c (passphrase_clear_cache): Shortcut if agent usage
is not enabled.
2001-05-01 Werner Koch <wk@gnupg.org>
* passphrase.c (writen): Replaced ssize_t by int. Thanks to
to Robert Joop for reporting that SunOS 4.1.4 does not have it.
2001-04-28 Werner Koch <wk@gnupg.org>
* getkey.c (merge_public_with_secret): pkttype was not set to subkey.
2001-04-27 Werner Koch <wk@gnupg.org>
* skclist.c (build_sk_list): Changed one log_debug to log_info.
2001-04-25 Werner Koch <wk@gnupg.org>
* keyedit.c (show_prefs): Add a verbose mode.
(show_key_with_all_names): Pass verbose flag for special value of
with_pref.
(keyedit_menu): New command "showpref"
(show_key_with_all_names): Mark revoked uids and the primary key.
2001-04-24 Werner Koch <wk@gnupg.org>
* getkey.c (get_primary_uid): Return a different string in case of
error and made it translatable.
* build-packet.c (do_secret_key): Ugly, we wrote a zero
instead of the computed ndays. Thanks to M Taylor for complaining
about a secret key import problem.
2001-04-23 Werner Koch <wk@gnupg.org>
* hkp.c (hkp_ask_import): Allow to specify a port number for the
keyserver. Add a kudge to set the no_shutdown flag.
(hkp_export): Ditto.
* options.skel: Document the changes
2001-04-20 Werner Koch <wk@gnupg.org>
* options.skel: Add some more comments.
2001-04-19 Werner Koch <wk@gnupg.org>
* keyid.c (mk_datestr): New. Handles negative times. We must do
this because Windoze segvs on negative times passed to gmtime().
Changed all datestr_from function to use this one.
* keyid.c, keyid.h (colon_strtime): New. To implement the
fixed-list-mode.
(colon_datestr_from_pk): New.
(colon_datestr_from_sk): New.
(colon_datestr_from_sig): New.
* keylist.c (list_keyblock_colon): Use these functions here.
* mainproc.c (list_node): Ditto.
2001-04-18 Werner Koch <wk@gnupg.org>
* openfile.c (open_sigfile): Fixed the handling of ".sign".
* mainproc.c (proc_tree): Use iobuf_get_real_fname.
Both are by Vincent Broman.
2001-04-14 Werner Koch <wk@gnupg.org>
* getkey.c (fixup_uidnode): Removed check for !sig which is
pointless here. Thanks to Jan Niehusmann.
2001-04-10 Werner Koch <wk@gnupg.org>
* sig-check.c (check_key_signature2): Use log_info instead of
log_error so that messed up keys do not let gpg return an error.
Suggested by Christian Kurz.
* getkey.c (merge_selfsigs_main): Do a fixup_uidnode only if we
have both, uid and sig. Thanks to M Taylor.
2001-04-05 Werner Koch <wk@gnupg.org>
* armor.c (unarmor_pump_new,unarmor_pump_release): New.
(unarmor_pump): New.
* pipemode.c (pipemode_filter): Use the unarmor_pump to handle
armored or non-armored detached signatures. We can't use the
regular armor_filter because this does only check for armored
signatures the very first time. In pipemode we may have a mix of
armored and binary detached signatures.
* mainproc.c (proc_tree): Do not print the "old style" notice when
this is a pipemode processes detached signature.
(proc_plaintext): Special handling of pipemode detached sigs.
* packet.h (CTRLPKT_PLAINTEXT_MARK): New.
* parse-packet.c (create_gpg_control): New.
* kbnode.c (dump_kbnode): Support it here.
* mainproc.c (check_sig_and_print): Fixed the check for bad
sequences of multiple signatures.
(proc_plaintext): Add the marker packet.
(proc_tree): We can now check multiple detached signatures.
2001-04-02 Werner Koch <wk@gnupg.org>
The length of encrypted packets for blocksizes != 8 was not
correct encoded. I think this is a minor problem, because we
usually use partial length packets. Kudos to Kahil D. Jallad for
pointing this out.
* packet.h: Add extralen to PKT_encrypted.
* cipher.c (write_header): Set extralen.
* build-packet.c (do_encrypted): Use extralen instead of const 10.
(do_encrypted_mdc): Ditto.
* parse-packet.c (parse_encrypted): Set extralen to 0 because we
don't know it here.
2001-03-30 Werner Koch <wk@gnupg.org>
* getkey.c (premerge_public_with_secret): Changed wording an add
the keyID to the info message.
2001-03-29 Werner Koch <wk@gnupg.org>
* getkey.c (premerge_public_with_secret): Use log_info instead of
log_error when no secret key was found for a public one.
Fix the usage if the secret parts of a key are not available.
* openfile.c (ask_outfile_name): Trim spaces.
(open_outfile): Allow to enter an alternate filename. Thanks to
Stefan Bellon.
* plaintext.c (handle_plaintext): Ditto.
2001-03-28 Werner Koch <wk@gnupg.org>
* mainproc.c (do_check_sig): Allow direct key and subkey
revocation signature.
* sig-check.c (check_key_signature2): Check direct key signatures.
Print the signature class along with an error.
2001-03-27 Werner Koch <wk@gnupg.org>
* packet.h: Add a missing typedef to an enum. Thanks to Stefan Bellon.
* g10.c: New option --no-sig-create-check.
* sign.c (do_sign): Implement it here.
* g10.c: New option --no-sig-cache.
* sig-check.c (check_key_signature2): Implement it here.
(cache_selfsig_result): and here.
* keylist.c (list_keyblock): Removed debugging stuff.
* getkey.c (cache_public_key): Made global.
* keygen.c (write_selfsig, write_keybinding): Cache the new key.
* getkey.c (key_byname): Add new arg secmode and changed all
callers to request explicitly the mode. Deriving this information
from the other supplied parameters does not work if neither pk nor
sk are supplied.
2001-03-25 Werner Koch <wk@gnupg.org>
* packet.h (ctrlpkttype_t): New.
* mainproc.c (add_gpg_control,proc_plaintext,proc_tree): Use the
new enum values.
* pipemode.c (make_control): Ditto.
* armor.c (armor_filter): Ditto.
2001-03-24 Werner Koch <wk@gnupg.org>
* sign.c (do_sign): Verify the signature right after creation.
2001-03-23 Werner Koch <wk@gnupg.org>
* status.c, status.h (STATUS_UNEXPECTED): New.
* mainproc.c (do_proc_packets): And emit it here.
2001-03-21 Werner Koch <wk@gnupg.org>
* status.c: Add sys/types.h so that it runs on Ultrix. Reported
by Georg Schwarz.x
* build-packet.c (build_sig_subpkt): Fixed generaton of packet
length header in case where 2 bytes headers are needed. Thanks to
Piotr Krukowiecki.
2001-03-19 Werner Koch <wk@gnupg.org>
* g10.c (main): the default keyring is no always used unless
--no-default-keyring is given.
* ringedit.c (add_keyblock_resource): invalidate cache after file
creation.
2001-03-15 Werner Koch <wk@gnupg.org>
* keygen.c (ask_algo): Changed the warning of the ElGamal S+E Algo.
* keylist.c (print_capabilities): New.
(list_keyblock_colon): and use it here.
2001-03-13 Werner Koch <wk@gnupg.org>
* main.c, options.h: New option --fixed_list_mode.
* keylist.c (list_keyblock_colon): use it here.
* getkey.c (merge_keys_and_selfsig): Divert merging of public keys
to the function used in key selection..
* keylist.c (is_uid_valid): Removed.
(list_keyblock): Splitted into ..
(list_keyblock_print, list_keyblock_colon): .. these.
functions. Changed them to use the flags set in the key lookup code.
(reorder_keyblock): New, so that primary user IDs are listed first.
* ringedit.c (keyring_copy): flush the new iobuf chaces before
rename or remove operations. This is mainly needed for W32.
* hkp.c [HAVE_DOSISH_SYSTEM]: Removed the disabled code because we
have now W32 socket support in ../util/http.c
* skclist.c (key_present_in_sk_list): New.
(is_duplicated_entry): New.
(build_sk_list): Check for duplicates and do that before unlocking.
2001-03-12 Werner Koch <wk@gnupg.org>
* armor.c (parse_header_line): Removed double empty line check.
(parse_header_line): Replaced trim_trailing_ws with a counting
function so that we can adjust for the next read.
* options.skel: Fixed 3 typos. By Thomas Klausner. Replaced the
keyserver example by a better working server.
* parse-packet.c (parse_symkeyenc): Return Invalid_Packet on error.
(parse_pubkeyenc): Ditto.
(parse_onepass_sig): Ditto.
(parse_plaintext): Ditto.
(parse_encrypted): Ditto.
(parse_signature): Return error at other places too.
(parse_key): Ditto.
* g10.c (main): Set opt.list_packets to another value when invoked
with the --list-packets command.
* mainproc.c (do_proc_packets): Don's stop processing when running
under --list-packets command.
* signal.c (do_sigaction): Removed.
(init_one_signal): New to replace the above. Needed to support
systems without sigactions. Suggested by Dave Dykstra.
(got_fatal_signal,init_signals): Use the above here.
(do_block): Use sigset() if sigprocmask() is not available.
* armor.c (parse_hash_header): Test on TIGER192, which is the
correct value as per rfc2440. By Edwin Woudt.
2001-03-08 Werner Koch <wk@gnupg.org>
* misc.c: Include time.h. By James Troup.
* getkey.c: Re-enabled the unknown user Id and PK caches and
increased their sizes.
* getkey.c (merge_selfsigs_main): Set expire date and continue
processing even if we found a revoked key.
(merge_selfsigs_subkeys): Ditto.
* packet.h: Add an is_revoked flag to the user_id packet.
* getkey.c (fixup_uidnode): Set that flag here.
(merge_selfsigs_main): Fix so that the latest signature is used to
find the self-signature for an UID.
* parse-packet.c (parse_user_id): Zero out all fields.
* mainproc.c (check_sig_and_print): Print the primary user ID
according the the node flag and then all other non-revoked user IDs.
(is_uid_revoked): Removed; it is now handled by the key selection code.
Changed the year list of all copyright notices.
2001-03-07 Werner Koch <wk@gnupg.org>
* getkey.c (finish_lookup): Print an info message only in verbose mode.
2001-03-05 Werner Koch <wk@gnupg.org>
* packet.h: Replaced sigsubpkt_t value 101 by PRIV_VERIFY_CACHE.
We have never used the old value, so we can do this without any harm.
* parse-packet.c (dump_sig_subpkt): Ditto.
(parse_one_sig_subpkt): Parse that new sub packet.
* build-packet.c (build_sig_subpkt): Removed the old one from the
hashed area.
(delete_sig_subpkt): New.
(build_sig_subpkt): Allow an update of that new subpkt.
* sig-check.c (check_key_signature2): Add verification caching
(cache_selfsig_result): New.
* export.c (do_export_stream): Delete that sig subpkt before exporting.
* import.c (remove_bad_stuff): New.
(import): Apply that function to all imported data
2001-03-03 Werner Koch <wk@gnupg.org>
* getkey.c: Introduced a new lookup context flag "exact" and used
it in all place where we once used primary.
(classify_user_id2): Replaced the old function and add an extra
argument to return whether an exact keyID has been requested.
(key_byname): Removed the unused ctx.primary flag
(get_seckey_byname2): Ditto.
(finish_lookup): Changed debugging output.
2001-03-02 Werner Koch <wk@gnupg.org>
* keylist.c (list_one): Remove the merge key calls.
2001-03-01 Werner Koch <wk@gnupg.org>
* getkey.c (finish_lookup): Don't use it if we no specific usage
has been requested.
(merge_selfsigs_main): fix UID only if we have an signature.
(lookup): Return UNU_PUBKEY etc. instead of NO_PUBKEY if we found
a key but the requested usage does not allow this key.
* import.c (import_one): Take UNU_PUBKEY into account.
* mainproc.c (list_node): Ditto.
* keylist.c (list_keyblock): Ditto.
* keyedit.c (print_and_check_one_sig): Ditto.
2001-02-09 Werner Koch <wk@gnupg.org>
* delkey.c (delete_key): Removed that silly assert which rendered
the whole new stuff meaningless.
2001-02-08 Werner Koch <wk@gnupg.org>
* getkey.c (key_byname): It can happen that we have both, sk and pk
NULL, fix for that.
* parse-packet.c (parse_one_sig_subpkt): Add support for
primary_uid and key_flags.
(can_handle_critical): Ditto
* parse-packet.c (parse_encrypted): Fixed listing of pktlen for
MDC packets.
* getkey.c: Backported the version of this file from gpg 1.1. this
involved some changes in other files too.
* parse-packet.c (parse_key): Clear req_usage.
* skclist.c (build_sk_list): Use req_usage to pass the usage
information to the lookup function.
* pkclist.c (build_pk_list): Ditto.
* free-packet.c (copy_public_parts_to_secret_key): New.
* keydb.h: Add IS_* macros to check the sig_class.
* misc.c (openpgp_cipher_test_algo): New.
(openpgp_pk_test_algo): New.
(openpgp_pk_algo_usage): New.
(openpgp_md_test_algo): New.
* packet.h: Add a few fields to PKT_{public,secret}_key and
PKT_user_id.
* seckey-cert.c (do_check): Use the new main_keyid field.
2001-02-04 Werner Koch <wk@gnupg.org>
* encr-data.c (decrypt_data): Catch error when we had problems to
parse the encrypted packet. By Timo.
2001-01-29 Werner Koch <wk@gnupg.org>
* g10.c (main): --batch does now set nogreeting.
* delkey.c (do_delete_key): Fixed delete-both functionality.
2001-01-22 Werner Koch <wk@gnupg.org>
* g10.c: New command --delete-secret-and-public-key.
* delkey.c (delete_key): Add new arg allow_both.
(do_delete_key): Move most stuff from above to this new function.
2001-01-12 Werner Koch <wk@gnupg.org>
* passphrase.c (passphrase_to_dek): Use MD5 when IDEA is installed
and we have no S2K.
* mainproc.c (proc_encrypted): Likewise
2001-01-11 Werner Koch <wk@gnupg.org>
* sig-check.c (do_check): Print the signature key expire message
only in verbose mode and added the keyID.
2001-01-09 Werner Koch <wk@gnupg.org>
* status.c, status.h: New status USERID_HINT.
(write_status_text): Replace LF and CR int text by C-escape sequence.
* passphrase.c (passphrase_to_dek): Fixed the NEED_PASSPHRASE
output. It does now always print 2 keyIDs. Emit the new
USERID_HINT.
2001-01-08 Werner Koch <wk@gnupg.org>
* g10.c, options.h: New option --no-expensive-trust-checks.
* keylist.c (list_keyblock): Act on this option.
2001-01-04 Werner Koch <wk@gnupg.org>
* g10.c (main): Set homedir only in the pre-parsing phase and
replace backslashes in the W32 version.
2001-01-03 Werner Koch <wk@gnupg.org>
* status.c, status.h : New status KEY_CREATED
* keygen.c (do_generate_keypair,generate_subkeypair): Emit it.
2000-12-28 Werner Koch <wk@gnupg.org>
* signal.c (got_fatal_signal): Remove lockfiles here because the
atexit stuff does not work due to the use of raise. Suggested by
Peter Fales.
* gpgv.c (remove_lockfiles): New stub.
2000-12-19 Werner Koch <wk@gnupg.org>
* status.c, status.h (cpr_get_no_help): New.
* keyedit.c (keyedit_menu): Use it here because we have our own
help list here.
2000-12-18 Werner Koch <wk@gnupg.org>
* mainproc.c (print_failed_pkenc): Don't print the sometimes
confusing message about unavailabe secret key. Renamed ...
(print_pkenc_list): ... to this and introduced failed arg.
(proc_encrypted): Print the failed encryption keys and then
the one to be used.
(proc_pubkey_enc): Store also the key we are going to use.
* mainproc.c (check_sig_and_print): Don't list revoked user IDs.
(is_uid_revoked): New.
2000-12-08 Werner Koch <wk@gnupg.org>
* pipemode.c: Made the command work. Currently only for
non-armored detached signatures.
* mainproc.c (release_list): Reset the new pipemode vars.
(add_gpg_control): Handle the control packets for pipemode
* status.c, status.h: New stati {BEGIN,END}_STREAM.
2000-12-07 Werner Koch <wk@gnupg.org>
* g10.c: New option --allow-secret-key-import.
* import.c (import_keys,import_keys_stream): Honor this option.
(import): New arg allow_secret and pass that arg down to ...
(import_secret_one): to this and print a warning if secret key
importing is not allowed.
2000-12-05 Werner Koch <wk@gnupg.org>
* cipher.c (cipher_filter): Moved the end_encryption status ...
* encode.c (encode_simple,encode_crypt): to here
* sign.c (sign_file): and here.
* status.c (mywrite): Removed.
(get_status_string): Removed the LFs from the strings.
(set_status_fd,is_status_enabed,write_status_text,
write_status_buffer): Replaced all mywrite by stdio calls and use
fdopen to create a strem. This is needed to make things smoother
in the W32 version.
2000-12-04 Werner Koch <wk@gnupg.org>
* import.c (merge_blocks): Increment n_sigs for revocations.
2000-11-30 Werner Koch <wk@gnupg.org>
* g10.c (main): Use iobuf_translate_file_handle for all options
with filehandles as arguments. This is function does some magic
for the W32 API.
* verify.c (verify_signatures): Add a comment rant about the
detached signature problem.
* mainproc.c (proc_tree): Issue an error if a detached signature
is assumed but a standard one was found.
* plaintext.c (hash_datafiles): Don't fall back to read signature
from stdin.
* openfile.c (open_sigfile): Print verbose message only if the
file could be accessed.
2000-11-24 Werner Koch <wk@gnupg.org>
* passphrase.c [HAVE_DOSISH_SYSTEM]: Disabled all the agent stuff.
2000-11-16 Werner Koch <wk@gnupg.org>
* g10.c: New option --use-agent
* passphrase.c (agent_open,agent_close): New.
(agent_get_passphrase,agent_clear_passphrase): New.
(passphrase_clear_cache): New.
(passphrase_to_dek): Use the agent here.
* seckey-cert.c (do_check): Clear cached passphrases.
2000-11-15 Werner Koch <wk@gnupg.org>
* status.c (write_status_text): Moved the big switch to ...
(get_status_string): ... new function.
(write_status_buffer): New.
* status.c (mywrite): New and replaced all write() by this.
* status.c, status.h: Add 3 status lcodes for notaions and policy.
* mainproc.c (print_notation_data): Do status output of notations.
2000-11-13 Werner Koch <wk@gnupg.org>
* sign.c (clearsign_file): Use LF macro to print linefeed.
2000-11-11 Paul Eggert <eggert@twinsun.com>
Clean up the places in the code that incorrectly use "long" or
"unsigned long" for file offsets. The correct type to use is
"off_t". The difference is important on large-file hosts,
where "off_t" is longer than "long".
* keydb.h (struct keyblock_pos_struct.offset):
Use off_t, not ulong, for file offsets.
* packet.h (dbg_search_packet, dbg_copy_some_packets,
search_packet, copy_some_packets): Likewise.
* parse-packet.c (parse, dbg_search_packet, search_packet,
dbg_copy_some_packets, copy_some_packets): Likewise.
* ringedit.c (keyring_search): Likewise.
* parse-packet.c (parse): Do not use %lu to report file
offsets in error diagnostics; it's not portable.
* ringedit.c (keyring_search): Likewise.
2000-11-09 Werner Koch <wk@gnupg.org>
* g10.c (main): New option --enable-special-filenames.
2000-11-07 Werner Koch <wk@gnupg.org>
* g10.c (main): New command --pipemode.
* pipemode.c: New.
2000-10-23 Werner Koch <wk@gnupg.org>
* armor.c (armor_filter): Changed output of hdrlines, so that a CR
is emitted for DOS systems.
* keygen.c (read_parameter_file): Add a cast for isspace().
* status.c (myread): Use SIGINT instead of SIGHUP for DOS.
2000-10-19 Werner Koch <wk@gnupg.org>
* g10.c: New option --ignore-crc-error
* armor.c (invalid_crc): New.
(radix64_read): Act on new option.
* openfile.c (try_make_homedir): Klaus Singvogel fixed a stupid
error introduced on Sep 6th.
2000-10-18 Werner Koch <wk@gnupg.org>
* misc.c (print_cipher_algo_note): Don't print the note for AES.
Changed wording.
2000-10-16 Werner Koch <wk@gnupg.org>
* mainproc.c (do_proc_packets): Hack to fix the problem that
signatures are not detected when there is a MDC packet but no
compression packet.
* g10.c (print_hashline): New.
(print_mds): Use above func with --with-colons.
* mainproc.c (check_sig_and_print): Detect multiple signatures
and don't verify them.
2000-10-14 Werner Koch <wk@gnupg.org>
* mainproc.c (add_onepass_sig): There is an easier solution to the
error fixed yesterday; just check that we only have onepass
packets. However, the other solution provides an cleaner
interface and opens the path to get access to other information
from the armore headers.
(release_list): Reset some more variables.
2000-10-13 Werner Koch <wk@gnupg.org>
* mainproc.c (add_gpg_control): New.
(do_proc_packets): use it.
(proc_plaintext): Changed logic to detect clearsigns.
(proc_tree): Check the cleartext sig with some new code.
* packet.h: New packet PKT_GPG_CONTROL.
* parse-packet.c (parse_gpg_control): New.
* misc.c (get_session_marker): New.
* armor.c (armor_filter): Replaced the faked 1-pass packet by the
new control packet.
* keyedit.c (keyedit_menu): Allow batchmode with a command_fd.
* status.c (my_read): New.
(do_get_from_fd): use it.
2000-10-12 Werner Koch <wk@gnupg.org>
* keygen.c (keygen_add_std_prefs): Add Rijndael to the prefs.
2000-10-07 Werner Koch <wk@gnupg.org>
* gpgv.c: Add more stubs for ununsed code to make the binary smaller.
Wed Oct 4 15:50:18 CEST 2000 Werner Koch <wk@openit.de>
* sign.c (hash_for): New arg to take packet version in account, changed
call callers.
* gpgv.c: New.
* Makefile.am: Rearranged source files so that gpgv can be build with
at least files as possible.
Mon Sep 18 12:13:52 CEST 2000 Werner Koch <wk@openit.de>
* hkp.c (not_implemented): Print a notice for W32
Fri Sep 15 18:40:36 CEST 2000 Werner Koch <wk@openit.de>
* keygen.c (keygen_add_std_prefs): Changed order of preferences to
twofish, cast5, blowfish.
* pkclist.c (algo_available): Removed hack to disable Twofish.
Thu Sep 14 17:45:11 CEST 2000 Werner Koch <wk@openit.de>
* parse-packet.c (dump_sig_subpkt): Dump key flags. Print special
warning in case of faked ARRs.
* getkey.c (finsih_lookup): Hack so that for v4 RSA keys the subkey
is used for encryption.
Thu Sep 14 14:20:38 CEST 2000 Werner Koch <wk@openit.de>
* g10.c (main): Default S2K algorithms are now SHA1 and CAST5 - this
should solve a lot of compatibility problems with other OpenPGP
apps because those algorithms are SHOULD and not optional. The old
way to force it was by using the --openpgp option whith the drawback
that this would disable a couple of workarounds for PGP.
* g10.c (main): Don't set --quite along with --no-tty. By Frank Tobin.
* misc.c (disable_core_dump): Don't display a warning here but a return
a status value and ...
* g10.c (main): ...print warnining here. Suggested by Sam Roberts.
Wed Sep 13 18:12:34 CEST 2000 Werner Koch <wk@openit.de>
* keyedit.c (keyedit_menu): Allow to use "debug" on the secret key.
* ringedit.c (cmp_seckey): Fix for v4 RSA keys.
* seckey-cert.c (do_check): Workaround for PGP 7 bug.
Wed Sep 6 17:55:47 CEST 2000 Werner Koch <wk@openit.de>
* misc.c (print_pubkey_algo_note): Do not print the RSA notice.
* sig-check.c (do_signature_check): Do not emit the RSA status message.
* pubkey-enc.c (get_session_key): Ditto.
* encode.c (encode_simple, encode_crypt): Fix for large files.
* sign.c (sign_file): Ditto.
Wed Sep 6 14:59:09 CEST 2000 Werner Koch <wk@openit.de>
* passphrase.c (hash_passphrase): Removed funny assert. Reported by
David Mathog.
* openfile.c (try_make_homedir): Changes for non-Posix systems.
* g10.c (main): Take the default homedir from macro.
* g10.c: The --trusted-key option is back.
* trustdb.c (verify_own_key): Handle this option.
(add_ultimate_key): Moved stuff from verify_own_key to this new func.
(register_trusted_key): New.
Fri Aug 25 16:05:38 CEST 2000 Werner Koch <wk@openit.de>
* parse-packet.c (dump_sig_subpkt): Print info about the ARR.
* openfile.c (overwrite_filep): Always return okay if the file is
called /dev/null.
(make_outfile_name): Add ".sign" to the list of know extensions.
(open_sigfile): Ditto.
Wed Aug 23 19:52:51 CEST 2000 Werner Koch <wk@openit.de>
* g10.c: New option --allow-freeform-uid. By Jeroen C. van Gelderen.
* keygen.c (ask_user_id): Implemented here.
Fri Aug 4 14:23:05 CEST 2000 Werner Koch <wk@openit.de>
* status.c (do_get_from_fd): Ooops, we used fd instead of opt.command_fd.
Thanks to Michael Tokarev.
Tue Aug 1 20:06:23 CEST 2000 Werner Koch <wk@openit.de>
* g10.c: New opttion --try-all-secrets on suggestion from Matthias Urlichs.
* pubkey-enc.c (get_session_key): Quite easy to implement here.
Thu Jul 27 17:33:04 CEST 2000 Werner Koch <wk@openit.de>
* g10.c: New option --merge-only. Suggested by Brendan O'Dea.
* import.c (import_one): Implemented it here
(import_secret_one): Ditto.
(print_stats): and give some stats.
Thu Jul 27 12:01:00 CEST 2000 Werner Koch <wk@openit.de>
* g10.c: New options --show-session-key and --override-session-key
* pubkey-enc.c (hextobyte): New.
(get_override_session_key): New.
* mainproc.c (proc_pubkey_enc): Add session-key stuff.
* status.h, status.c (STATUS_SESSION_KEY): New.
Thu Jul 27 10:02:38 CEST 2000 Werner Koch <wk@openit.de>
* g10.c (main): Use setmode(O_BINARY) for MSDOS while generating random bytes
(print_mds): Likewise for stdin.
* plaintext.c (handle_plaintext): Likewise for stdout.
Mon Jul 24 10:30:17 CEST 2000 Werner Koch <wk@openit.de>
* keyedit.c (menu_expire): expire date for primary key can be set again.
Wed Jul 19 11:26:43 CEST 2000 Werner Koch <wk@openit.de>
* keylist.c (is_uid_valid): New.
(list_keyblock): Print validity information for all user IDs. Note, this
has to be done at other places too; for now we have only minimal support.
Wed Jul 12 13:32:06 CEST 2000 Werner Koch <wk@openit.de>
* helptext.c, pkclist.c: s/superseeded/superseded/
Mon Jul 10 16:08:57 CEST 2000 Werner Koch <wk@openit.de>
* parse-packet.c (enum_sig_subpkt): Fixed testing on crtitical bit in case
of a NULL buffer. Reported by Peter Marschall.
Wed Jul 5 13:28:45 CEST 2000 Werner Koch <wk@openit.de>
* keyedit.c, keyid.c: Add some _()
* argparse.c: Changed the flag to suppress --version handling to also
suppress --help.
Wed Jun 28 11:54:44 CEST 2000 Werner Koch <wk@openit.de>
* armor.c (armor_filter): Set sigclass to 0 in case of non-dash-escaped
clearsig. This makes this mode work again.
* mainproc.c (proc_tree): Fixed handling of one-pass-sig packets in textmode.
Disabled the ugly workaround for PGP 5 - let's see whether thi breaks less
cases. Found by Ted Cabeen.
* options.h (DBG_HASHING): New. All commented md_start_debug are now
controlled by this debug option.
* sign.c (print_status_sig_created): New and called from 2 places.
* keygen.c (gen_rsa): New, but commented.
(ask_algo): Commented support for RSA.
* seckey-cert.c (protect_secret_key): Started to fix the code for v4 RSA
keys - it is not solved yet. However, we have time until, Sep 20th ;)
Wed Jun 14 12:27:09 CEST 2000 Werner Koch <wk@openit.de>
* status.c (init_shm_coprocessing): Changed the sequence of the get,attach
to cope with the changes in newer Linux kernels. This bug has been found
by <dmitri@advantrix.com> who also proposed this solution. Hopefully
this does not break gpg on to many systems.
* cipher.c (write_header): Protect the IV with the MDC too.
* encr-data.c (decrypt_data): Likewise.
Fri Jun 9 10:09:52 CEST 2000 Werner Koch <wk@openit.de>
* g10.c: New options --no-auto-key-retrieve
* options.h (auto_key_retrieve): New.
* mainproc.c (check_sig_and_print): Implemented that.
Wed Jun 7 19:19:09 CEST 2000 Werner Koch <wk@openit.de>
* sig-check.c (do_check): Use EMULATE_MDENCODE also on v4 packets.
Wed Jun 7 17:25:38 CEST 2000 Werner Koch <wk@openit.de>
* cipher.c (write_header): Use plain CFB mode for MDC encrypted packets.
* encr-data.c (decrypt_data): Ditto.
Mon Jun 5 23:41:54 CEST 2000 Werner Koch <wk@openit.de>
* seskey.c (do_encode_md, encode_md_value): Add new arg v3compathack to work
around a bug in old versions.
* sig-check.c (do_check): use the aboved workaround when enabled.
* g10.c: New option --emulate-md-decode-bug
Mon Jun 5 12:37:43 CEST 2000 Werner Koch <wk@openit.de>
* build-packet.c (do_mdc): New.
(do_encrypted_mdc): Changed for the new proposal.
* parse-packet.c (parse_mdc): New.
(parse_encrypted): Fixed for the new proposal.
* packet.h (PKT_MDC): New.
* cipher.c (cipher_filter): Build the MDC packet here.
* g10.c (main): Enable --force-mdc.
* encr-data.c (mdc_decode_filter): Fixed for new MDC method
* options.h(rfc2440): New.
* g10.c (main): Changed the selected values for --openpgp to not include
optional algorithms.
Thu May 18 11:38:54 CEST 2000 Werner Koch <wk@openit.de>
* keyedit.c (keyedit_menu): Add a keyword arg to the prompt.
* status.c, status.h: Added 3 new status tokens.
* status.c (do_get_from_fd): New.
(cpr_enabled,cpr_get,cpr_get_hidden,cpr_kill_prompt,
cpr_get_answer_is_yes,cpr_get_answer_yes_no_quit): Modified to work
with the new function.
* g10.c: Add new option --command-fd.
* status.c (progress_cb): New.
(set_status_fd): Register progress functions
Fri May 12 14:01:20 CEST 2000 Werner Koch <wk@openit.de>
* delkey.c (delete_key): Add 2 new status messages
* status.c, status.h (STATUS_DELETE_PROBLEM): New.
Fixed years of copyright in all source files.
Mon May 1 17:08:14 CEST 2000 Werner Koch <wk@openit.de>
* trustdb.c (propagate_validity): Fixed the bug that only one uid
gets fully trusted even when all are signed by an ultimate key.
Mon May 1 15:38:04 CEST 2000 Werner Koch <wk@openit.de>
* getkey.c (key_byname): Always returned a defined context. Fixed
a segv for invalid user id specifications. Reported by Walter Koch.
* getkey.c (get_user_id): I18ned "no user id" string. By Walter.
* pkclist.c (do_show_revocation_reason): Typo fixes.
* helptext.c: Ditto.
* armor.c (armor_filter): Fixed some CRLF issues. By Mike McEwan.
Fri Apr 14 19:37:08 CEST 2000 Werner Koch <wk@openit.de>
* pkclist.c (do_show_revocation_reason): New.
(show_revocation_reason): New and called at various places.
* g10.c (main): Fixed small typo.
* pkclist.c (do_we_trust): Act on always_trust but not for revoked
keys. Suggested by Chip Salzenberg.
* g10.c: New option --lock-never.
* ringedit.c (get_writable_keyblock_file): New.
* keygen.c (do_generate_keypair): Use this instead of the hardwired one.
* keygen.c (ask_user_id): Check that the email address is in the
correct field. Suggested by Christian Kurz.
Mon Apr 10 13:34:19 CEST 2000 Werner Koch <wk@openit.de>
* keyedit.c (show_key_with_all_names): s/sbb/ssb/
Tue Mar 28 14:26:58 CEST 2000 Werner Koch <wk@openit.de>
* trustdb.c (verify_own_keys): Do not print warning about unprotected
key when in quiet mode.
Wed Mar 22 13:50:24 CET 2000 Werner Koch <wk@openit.de>
* mainproc.c (print_userid): Do UTF8 conversion before printing.
* import.c (import_one): Ditto.
(import_secret_one): Ditto.
(delete_inv_parts): Ditto.
Thu Mar 16 16:20:23 CET 2000 Werner Koch <wk@openit.de>
* keylist.c (print_key_data): Handle a NULL pk gracefully.
* getkey.c (merge_one_pk_and_selfsig): Fixed silly code for
getting the primary keys keyID but kept using the one from the
subkey.
* pubkey-enc.c (get_it): Print a note for expired subkeys.
* getkey.c (has_expired): New.
(subkeys_expiretime): New.
(finish_lookup): Check for expired subkeys needed for encryption.
(merge_keys_and_selfsig): Fixed expiration date merging for subkeys.
* keylist.c (list_keyblock): Print expiration time for "sub".
(list_one): Add missing merging for public keys.
* mainproc.c (list_node): Ditto.
2000-03-14 13:49:38 Werner Koch (wk@habibti.openit.de)
* keygen.c (keyedit_menu): Do not allow to use certain commands
while the secret key is selected.
2000-03-09 12:53:09 Werner Koch (wk@habibti.openit.de)
* keygen.c (ask_expire_interval): Movede parsig to ...
(parse_expire_string): ... this new function. And some new control
commands.
(proc_parameter_file): Add expire date parsing.
(do_generate_keypair): Allow the use of specified output files.
2000-03-08 10:38:38 Werner Koch (wk@habibti.openit.de)
* keygen.c (ask_algo): Removed is_v4 return value and the commented
code to create Elg keys in a v3 packet. Removed the rounding
of key sizes here.
(do_create): Likewise removed arg v4_packet.
(gen_elg): Likewise removed arg version. Now rounding keysizes here.
(gen_dsa): Rounding keysize now here.
(release_parameter_list): New
(get_parameter*): New.
(proc_parameter_file): New.
(read_parameter_file): New.
(generate_keypair): Splitted. Now uses read_parameter_file when in
batch mode. Additional argument to specify a parameter file.
(do_generate_keypair): Main bulk of above fucntion and uses the
parameter list.
(do_create): Don't print long notice in batch mode.
* g10.c (main): Allow batched key generation.
Thu Mar 2 15:37:46 CET 2000 Werner Koch <wk@gnupg.de>
* pubkey-enc.c (get_it): Print a note about unknown cipher algos.
* g10.c (opts): Add a note to the help listing about the man page
and removed some options from the help listing.
* keyedit.c (print_and_check_one_sig): Use a new function to truncate
the output of the user ID. Suggested by Jan-Benedict Glaw.
Wed Feb 23 10:07:57 CET 2000 Werner Koch <wk@gnupg.de>
* helptext.c: typo fix.
Thu Feb 17 13:39:32 CET 2000 Werner Koch <wk@gnupg.de>
* revoke.c: Removed a bunch of commented code.
* packet.h (SIGSUBPKT_REVOC_REASON): New.
* build-packet.c (build_sig_subpkt): Support new sub packet.
* parse-packet.c (parse_one_sig_subpkt): Ditto.
(dump_sig_subpkt): Ditto.
* revoke.c (ask_revocation_reason): New.
(release_revocation_reason_info): New.
(revocation_reason_build_cb): New.
(gen_revoke): Ask for reason.
* main.h (struct revocation_reason_info): Add declaration.
* keyedit.c (menu_revsig): Add support for revocation reason.
(menu_revkey): Ditto.
(sign_uid_mk_attrib): Renamed to ...
(sign_mk_attrib): ... this, made static and add support for reasons.
Tue Feb 15 08:48:13 CET 2000 Werner Koch <wk@gnupg.de>
* build-packet.c (build_packet): Fixed fixing of old comment packets.
* import.c (import_keys): Fixed importing from stdin when called with
nnames set to zero as it normally happens.
Mon Feb 14 14:30:20 CET 2000 Werner Koch <wk@gnupg.de>
* sig-check.c (check_key_signature2): Add new arg r_expired.
(do_signature_check): New arg to pass it down to ...
(do_check): New arg r-expire which is set when the signature
has expired.
* trustdb.c (check_sig_record): Set SIGF_EXPIRED flag and set
the expiretime to zero so that thi signature will not be checked
anymore.
Fri Feb 11 17:44:40 CET 2000 Werner Koch <wk@gnupg.de>
* g10.c (g10_exit): Update the random seed_file.
(main): Set the random seed file. New option --no-random-seed-file.
Thu Feb 10 17:39:44 CET 2000 Werner Koch <wk@gnupg.de>
* keyedit.c (menu_expire): Fixed segv due to unitialized sub_pk.
By Rémi.
Thu Feb 10 11:39:41 CET 2000 Werner Koch <wk@gnupg.de>
* keylist.c (list_keyblock): Don't print warnings in the middle of
regulat output lines. By Rémi.
* sig-check.c: Include options.h
Wed Feb 9 15:33:44 CET 2000 Werner Koch <wk@gnupg.de>
* gpg.c: New option --ignore-time-conflict
* sig-check.c (do_check): Implemented this option.
* trustdb.c (check_trust): Ditto.
* sign.c (do_sign): Ditto.
* keygen.c (generate_subkeypair): Ditto.
* encode.c (encode_simple): use iobuf_cancel after open failure.
Reported by Huy Le.
Fri Jan 14 18:32:01 CET 2000 Werner Koch <wk@gnupg.de>
* packet.h (STRING2KEY): Changed mode from byte to int.
* parse-packet.c (parse_key): Add the special GNU protection stuff
* build-packet.c (so_secret_key): Ditto.
* seckey-cert.c (do_check): Ditto.
* keyedit.c (change_passphrase): Ditto.
* export.c (export_secsubkeys): New.
(do_export_stream): Hack to export the primary key using mode 1001.
* g10.c: New command --export-secret-subkeys
Thu Jan 13 19:31:58 CET 2000 Werner Koch <wk@gnupg.de>
* armor.c (is_armored): Check for 1-pass-sig packets. Reported by
David Hallinan <hallinan@rtd.com>.
(armor_filter): Replaced one LF by the LF macro. Reported by
Wolfgang Redtenbacher.
Wed Jan 5 11:51:17 CET 2000 Werner Koch <wk@gnupg.de>
* g10.c (main): Reset new global flag opt.pgp2_workarounds
when --openpgp is used.
* mainproc.c (proc_plaintext): Do the PGP2,5 workarounds only
when the global flag is set.
(proc_tree): Ditto.
* textfilter.c (copy_clearsig_text): Ditto.
* armor.c (armor_filter): Ditto.
* g10.c: New option --list-only
* mainproc.c (proc_tree): Don't do it if opt.list_only is active.
(proc_pubkey_enc): Implement option.
* status.h, status.c ({BEGIN,END}_{EN,DE}CRYPTION): New.
* cipher.c (cipher_filter): New status outputs.
* mainproc.c (proc_encrypted): New status outputs.
Fri Dec 31 14:08:15 CET 1999 Werner Koch <wk@gnupg.de>
* armor.c (armor_filter): Made the "Comment:" header translatable.
* hkp.c (hkp_import): Make sure that the program does not return
success when there is a connection problem. Reported by Phillip Jones.
Sun Dec 19 15:22:26 CET 1999 Werner Koch <wk@gnupg.de>
* armor.c (LF): Use this new macro at all places where a line LF
is needed. This way DOSish textfiles should be created when the
input data is also in dos mode.
* sign.c (LF): Ditto.
* textfilter.c (LF): Ditto.
(copy_clearsig_text): Disabled the forcing of CR,LF sequences
for DOS systems.
* plaintext.c (handle_plaintext): Fixes for line endings on DOS.
and react on a LF in cleartext.
* armor.c (fake_packet): Restore the original line ending after
removing trailing spaces.
* signal.c (got_fatal_signal): DOS fix.
Thu Dec 16 10:07:58 CET 1999 Werner Koch <wk@gnupg.de>
* mainproc.c (print_failed_pkenc): Fix for unknown algorithm.
Found by fygrave@epr0.org.
Thu Dec 9 10:31:05 CET 1999 Werner Koch <wk@gnupg.de>
* hkp.c: i18n the strings.
Sat Dec 4 15:32:20 CET 1999 Werner Koch <wk@gnupg.de>
* trustdb.c (verify_key): Shortcut for ultimately trusted keys.
Sat Dec 4 12:30:28 CET 1999 Werner Koch <wk@gnupg.de>
* pkclist.c (build_pk_list): Validate the trust using the namehash
if this one has been set by the key lookup.
* g10.c: Add --delete-secret-key to the help page.
* openfile.c (copy_options_file): Made static.
(try_make_homedir): New.
* ringedit.c (add_keyblock_resource): Use the try_make_hoemdir logic.
* tdbio.c (tdbio_set_dbname): Likewise.
* keygen.c (generate_user_id): Use m_alloc_clear() here. We should
better use an allocation function specific to the user_id packet.
* keygen.c (keygen_add_std_prefs): Changed symmetric preferences
to include Blowfish again. This is due to it's better speed compared
to CAST5.
* g10.c (strusage): Print the home directory.
* armor.c (armor_filter): Take action on the cancel control msg.
* filter.h (armor_filter_context_t): Add cancel flag.
Mon Nov 29 21:52:11 CET 1999 Werner Koch <wk@gnupg.de>
* g10.c: New option --fast-list-mode ..
* keylist.c (list_keyblock): .. and implemented.
* mainproc.c (list_node): Ditto.
* import.c (mark_non_selfsigned_uids_valid): Fixed the case that there
is a uid without any packet following.
Mon Nov 22 11:14:53 CET 1999 Werner Koch <wk@gnupg.de>
* mainproc.c (proc_plaintext): Never enable the hash processing
when skip_verify is active.
* armor.c (parse_header_line): Stop parsing on a WS line too.
Suggested by Aric Cyr.
* tdbdump.c (HEXTOBIN): Changed the name of the argument, so that
traditional cpp don't mess up the macros. Suggested by Jos Backus.
* mainproc.c (list_node): Print the PK algo in the --with-colon mode.
* keylist.c (list_keyblock): Ditto.
* signal.c (got_fatal_signal): Found the reason why exit(8) did not
work - it is better to set the disposition back to default before
raising the signal. Print the notice on stderr always.
Fri Nov 12 20:33:19 CET 1999 Werner Koch <wk@gnupg.de>
* g10.c (make_username): Swapped the logic.
* keylist.c (public_key_list): Now takes a STRLIST as arg and moved
the creation ot this list to the caller, so that he can copy with
UTF-conversion of user IDs. Changed all callers.
(secret_key_list): Likewise.
* getkey.c (get_user_id_string_native): New and ...
* encode.c (write_pubkey_enc_from_list): ... use it here.
* pubring.asc: Updated.
* packet.h (PKT_PHOTO_ID): New.
* parse-packet.c (parse_photo_id): New.
* build-packet.c (do_user_id: Handle photo IDs.
(build_packet): Change CTB for photo IDs
* free-packet.c (free_user_id): Release memory used for photo IDs
* sig-check.c (hash_uid_node): Handle photo IDs too.
* trustdb.c (print_uid_from_keyblock): Hash photo ID.
(make_uid_records): Ditto.
* getkey.c (find_by_name): Ditto.
* keyedit.c (show_prefs): Ditto.
* keylist.c (list_keyblock): Ditto.
Thu Oct 28 16:08:20 CEST 1999 Werner Koch <wk@gnupg.de>
* keygen.c (ask_expire_interval): Print a warning for systems
with a signed 32 time_t if the exiration time is beyoind 2038.
Fri Oct 8 20:40:50 CEST 1999 Werner Koch <wk@gnupg.de>
* ringedit.c (enum_keyblocks): The last fix way really stupid;
reverted and set rt to Unknown.
Fri Oct 8 20:32:01 CEST 1999 Werner Koch <wk@gnupg.de>
* ringedit.c (enum_keyblocks): Zero the entire kbpos out on open.
* g10.c (oEntropyDLL): Removed option.
(main): Made the warning on development versions more verbose.
* g10.c (oHonorHttpProxy): New option.
* hkp.c (hkp_ask_import,hkp_export): Implement this option.
* options.skel: Enable this option for new installations
Mon Oct 4 21:23:04 CEST 1999 Werner Koch <wk@gnupg.de>
* import.c (import_keys): Changed calling interface, adjusted caller.
(import): Moved printing of stats out ...
(print_stats): New. ... to here.
(import_keys_stream): Call stats print here.
(import_keys): Print stats as totals for all files.
* tdbio.h (DIRF_NEWKEYS): New
* tdbio.c (tdbio_dump_record): Print the new flag.
* trustdb.c (check_trust_record): New arg sigs_only. Adapted all
callers.
(do_update_trust_record): Removed recheck arg and add a new sigs_only
do we can later improve on the performance. Changed all callers too.
(check_trustdb): Evalutate the new flag and add a status output.
Do a check when the dir record has not been checked.
(build_cert_tree): Evaluate the new flag.
(check_trust): Ditto. Do a trust_record check, when the dir record
is not marked as checked.
(mark_fresh_keys): New.
(clear_lid_table): New.
(sync_trustdb): New.
* import.c (import_keys): Call sync_trustdb() after processing.
(import_keys_stream): Ditto.
* tdbdump.c (import_ownertrust): Ditto.
* import.c (import_revoke_cert): Notify the trust DB.
(do_update_trust_record): Use |= to set the REVOKED bit and not &=;
shame on me for this bad copy+paste introduced bug.
(do_we_trust): Add trustmask to allow revoked key override to work.
Chnaged are to allow return of a mofified trustlevel. Adapted the
one caller.
* g10.c: New options --emulate-3des-s2k-bug
* passphrase.c (hash_passphrase): Implemented above.
* mainproc.c (proc_tree): Check for standalone signatures.
(do_check_sig): Print a notice for a standalone revocation
(check_sig_and_print): Do not print an error for unchecked standalone
revocations.
Tue Sep 28 20:54:37 CEST 1999 Werner Koch <wk@gnupg.de>
* encode.c (encode_simple): Use new CTB when we don't have the
length of the file. This is somewhat strange as the comment above
indicates that this part is actually fixed for PGP 5 - maybe I simply
lost the source line, tsss.
* armor.c (armor_filter): Set a flag if no OpenPGP data has been found.
* verify.c (verify_signatures): Add an error helptext.
Thu Sep 23 19:24:30 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* openfile.c (open_outfile): Fixed the 8dot3 handling.
* passphrase.c (passphrase_to_dek): Print uid using utf8 func.
* delkey.c (delete_key): Ditto.
* pkclist.c (show_paths,do_edit_ownertrust,do_we_trust): Ditto
(do_we_trust_pre): Ditto.
* trustdb.c (print_user_id,check_uidsigs): Ditto.
* revoke.c (gen_revoke,ask_revoke_sig): Ditto.
Thu Sep 23 09:52:58 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* verify.c (print_file_status): New.
(verify_one_file): Moved status print to th new fnc. Add error status.
* status.c, status.h (STATUS_FILE_ERROR): New
Wed Sep 22 10:14:17 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* openfile.c (make_outfile_name): Use case-insenstive compare for
DOS systems. Add ".pgp" to the list of know extensions.
(open_outfile): For DOS systems try to replace the suffiy instead of
appending it.
* status.c, status.h: Add STATUS_FILE_{START,DONE}.
* verify.c (verify_one_file): Emit these new stati.
* sign.c (clearsign_file): Avoid duplicated Entries in the "Hash:"
line. Those headers are now only _not_ printed when there are
only old-style keys _and_ all hashs are MD5.
Mon Sep 20 12:24:41 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* verify.c (verify_files, ferify_one_file): New.
* g10.c: New command --verify-files
Fri Sep 17 12:56:42 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c: Add UK spelling as alias for armor options ;-)
* import.c (append_uid): Fixed a SEGV when there is no selfsig and
no subkey.
(merge_sigs): Ditto. Removed the assertion.
Wed Sep 15 16:22:17 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c: New option --entropy-dll-name
Mon Sep 13 10:51:29 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* signal.c (got_fatal_signal): Print message using write(2) and
only for development versions.
Mon Sep 6 19:59:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* tdbio.c (tdbio_set_dbname): Use mkdir macro
* ringedit.c (add_keyblock_resource): Ditto.
Fri Sep 3 10:04:45 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (build_pk_list): Skip keys set with --encrypt-to also
when asking for a key.
* plaintext.c (handle_plaintext): Make sure that we don't read a
second EOF in the read loop for partial length packets.
* mainproc.c (check_sig_and_print): print user ID as utf-8.
Thu Sep 2 16:40:55 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* import.c (merge_blocks): First add new subkeys, then merge subkey
certificates.
(merge_sigs): Don't merge subkey signatures here.
Wed Sep 1 15:30:44 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* keygen.c (ask_expire_interval): Fixed bug related to cpr_xx (tnx
Francis J. Lacoste).
Tue Aug 31 17:20:44 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* plaintext.c (do_hash): Hash CR,LF for a single CR.
(ask_for_detached_datafile): Changed arguments to be closer to
those of hash_datafiles and cleanup the code a bit.
* mainproc.c (proc_tree): Workaround for pgp5 textmode detached
signatures. Changed behavior of asking for data file to be the same
as with provided data files.
* keylist.c (list_keyblock): Use UTF8 print functions.
Mon Aug 30 20:38:33 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* import.c (chk_self_sigs): some s/log_error/log_info/ so that gpg
does not return an error if a key has some invalid packets.
* helptext.c: Fixed some typos and changed the way the
translation works. The english text is now the keyword for gettext
and not anymore the keyword supplied to the function. Done after
some discussion with Walter who thinks this is much easier for the
translators.
* misc.c (disable_core_dumps): Don't do it for DOSish systems.
* signal.c (signal_name): Bounds check on signum.
Wed Aug 4 10:34:18 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pubring.asc: Updated.
* pkclist.c (do_we_trust_pre,check_signatures_trust): Do not print
the warning about --always_trust when --quiet is used.
* pkclist.c (fpr_info): New and called at several places.
* parse-packet.c (dump_sig_subpkt): List revocation key contents.
Mon Jul 26 09:34:46 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (build_pk_list): Fixed typo in format string.
* trustdb.c (create_shadow_dir): Don't translate the error string.
* g10.c (main): Fixed spelling of user-id.
* getkey.c (find_by_name_pk,find_by_name_sk,
find_by_keyid,find_by_keyid_sk): Ditto and translate it.
* import.c (mark_non_selfsigned_uids_valid,delete_inv_parts): Ditto.
Mon Jul 26 01:01:39 CEST 1999 Michael Roth <mroth@nessie.de>
* g10.c, options.h: New options --no-literal and --set-filesize
* encode.c (encode_simple, encode_crypt): Support for the options
--no-literal and --set-filesize.
* sign.c (sign_file): ditto.
Fri Jul 23 13:53:03 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* ringedit.c (enum_keyblocks): Removed annoying error message in cases
when we have no keyring at all to enum.
* getkey.c (classify_user_id): Rewrote to relax the recognition of
keyIDs and fingerprints (Michael).
* mainproc.c (check_sig_and_print): Print status NO_PUBKEY.
(print_failed_pkenc): Print status NO_SECKEY.
* import.c (mark_non_selfsigned_uids_valid): New.
* g10.c: New option --allow-non-selfsigned-uid.
* pkclist.c (print_fpr): New.
(do_we_trust_pre): Print the fpr before asking whether to use the key
anyway.
(do_edit_ownertrust): Likewise.
Thu Jul 22 20:03:03 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* ringedit.c (enum_keyblocks): Removed annoying error message in cases
when we have no keyring at all to enum.
* getkey.c (classify_user_id): Rewrote to relax the recognition of
keyIDs and fingerprints (Michael).
* mainproc.c (check_sig_and_print): Print status NO_PUBKEY.
(print_failed_pkenc): Print status NO_SECKEY.
* import.c (mark_non_selfsigned_uids_valid): New.
* g10.c: New option --allow-non-selfsigned-uid.
Thu Jul 15 10:15:35 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c: New options --disable-{cipher,pubkey}-algo.
Wed Jul 14 19:42:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* status.h (STATUS_IMPORTED): New.
* import.c (import): Print some status information (Holger Schurig).
* g10.c (main): Make --no-greeting work again. Add a warning when
--force-mds is used.
Tue Jul 13 17:39:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (do_edit_ownertrust): Changed the way help works.
(build_pk_list): Implemented default recipient stuff.
* g10.c: New options --default-recipient[-self]
(main): Suppress greeting in most cases, entering a passphrase or
a missing value is not considered to be interactive use.
Merged --print-md and --print-mds; the latter is now obsolete.
Changed the way --gen-random works and documented it.
Changed the way --gen-prime works and add a man entry.
* g10.c (MAINTAINER_OPTIONS): Removed.
Mon Jul 12 18:45:57 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* keyedit.c (keyedit_menu): Add arg sign_mode and changed callers
* g10.c (main): New command --lsign-key.
Mon Jul 12 14:55:34 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* mainproc.c (kidlist_item): New.
(release_list): Release failed pk-enc-list.
(print_failed_pkenc): New
(proc_encrypted): Print info about failed PK enc.
* openfile.c (make_outfile_name): s/error/info/
* passphrase.c (passphrase_to_dek): Return an empty passphrase when
in batch mode and don't make the warning message fatal
* seckey-cert.c (check_secret_key): Try only once when in batch mode.
* g10.c (make_username): New.
Thu Jul 8 16:21:27 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* packet.h (PKT_ring_trust): New
* parse-packet.c (parse_trust): Store trust value
* build-packet (build_packet): Ignore ring trust packets.
* mainproc.c (add_ring_trust): New.
(list_node): Print "rtv" records.
* g10.c: New option --with-fingerprint.
* trustdb.c (verify_own_keys): Don't insert if we are dry running
(check_trust): Ditto.
Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* Makefile.am: Support for libtool.
* keygen.c (ask_expire_interval): Hack to allow for an expire date.
* trustdb.c (do_update_trust_record,update_trust_record): Splitted.
(check_trust_record): New.
(check_trust,build_cert_tree): Check the dir record as needed.
(upd_pref_record): Removed.
(make_pref_record): New.
(propagate_validity): Stop as soon as we have enough validity.
* tbdio.c (MAX_CACHE_ENTRIES_HARD): Increased the limit.
Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c (g10_exit): Dump random stats.
* sig-check.c (check_key_signature,check_key_signature2): Enhanced
version and wrapper for old function.
(do_signature_check,signature_check): Ditto.
Thu Jul 1 12:47:31 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* keyedit.c (show_key_with_all_names): Print a notice for disabled keys.
(enable_disable_keys): Add functionality
* pkclist.c (edit_ownertrust): preserve disabled state.
(build_pk_list): Skip disabled keys.
* trustdb.c (upd_one_ownertrust): Ditto.
(build_cert_tree): Mask the ownertrust.
(trust_letter): Mask the value.
(do_check): Take disabled flag into account.
* passphrase.c (passphrase_to_dek): Add a pubkey_algo arg and changed
all callers.
* g10.c (utf8_strings): 2 new options.
* trustdb.c (insert_trust_record_by_pk): New, replaces the next one.
(insert_trust_record): Now takes a keyblock as arg. Changed all
callers to use the appropritae function.
* openfile.c (ask_outfile_name): New.
* plaintext.c (handle_plaintext): Ask for filename if there is
no valid syntax. Don't use fname varbatim but filter it.
Tue Jun 29 21:44:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* trustdb.h (TRUST_FLAG_DISABLED): New.
* status.c (USE_CAPABILITIES): Capabilities support (Remi).
* tdbio.c : Added new fields to the DIR record.
(tdbio_write_record): Fixed the update of the hash tables.
(tdbio_delete_record): Drop the record from the hash tables.
(drop_from_hashtbl): New.
* status.c (cpr_get): Special online help mode.
* helptext.c ("keyedit.cmd"): Removed.
* keyedit.c (keyedit_menu): Use only help system.
(enable_disable_key): New bit doies not yet work.
Sat Jun 26 12:15:59 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* dearmor.c (enarmor_file): Fixed comment string.
* tdbdump.c (export_ownertrust): Text fix.
* tbio.c (tdbio_invalid): Ditto.
* parse-packet.c (parse_key): Made temp buffer larger.
* Makefile.am (install-data-local): Add missing backslashes
Tue Jun 15 12:21:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c (main): Made iterated+salted the default S2K method.
* Makefile.am (install-data-local): Use DESTDIR.
* passphrase.c (passphrase_to_dek): Emit missing-passphrase while in
batchmode.
* parse-packet.c (parse_pubkeyenc): Fixed a SEGV.
Mon Jun 14 21:18:54 CEST 1999 Michael Roth <mroth@nessie.de>
* g10.c: New options --openpgp, --no-tty, --emit-version,
--default-comment and --lock-multiple
Thu Jun 10 14:18:23 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* free-packet.c (free_encrypted): Fixed EOF case (Remi).
(free_plaintext): Ditto.
* helptext.c (keyedit.delsig.unknown): New (Remi).
* keyedit.c (print_and_check_one_sig): Add arg print_without_key and
changed all callers to make use of it (Remi):
Tue Jun 8 13:36:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* keylist.c (print_key_data): New and called elsewhere.
* g10.c: New option --with-key-data
Wed Jun 2 14:17:19 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* mainproc.c (proc_tree): Yet another bad hack to cope with
broken pgp2 created detached messages in textmode.
Tue Jun 1 16:01:46 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* openfile.c (make_outfile_name): New.
* plaintext.c (handle_plaintext): Outputfile is now the inputfile
without the suffix.
* g10.c: New option --use-embedded-filename
Mon May 31 19:41:10 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c (main): Fix for SHM init (Michael).
* compress.c, encr-data.c, mdfilter.c,
plaintext.c, free-packet.c: Speed patches (Rémi).
Thu May 27 09:40:55 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* status.c (cpr_get_answer_yes_no_quit): New.
* keyedit.c (menu_delsig): New.
(check_all_keysigs): Splitted.
(print_and_check_one_sig): New.
Wed May 26 14:36:29 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* build-packet.c (build_sig_subpkt): Support large packets.
* parse-packet.c (enum_sig_subpkt): Replaces parse_sig_subpkt.
* mainproc.c (print_notation_data): Print all notation packets.
* g10.c (add_notation_data): Add a way to specify the critical flag.
(main): Add option --set-policy-url.
(check_policy_url): Basic checks.
* sign.c (mk_notation_and_policy): Replaces mk_notation.
* parse-packet.c (can_handle_critical): Moved decision whether we can
handle critical subpacket to an extra function.
Tue May 25 19:50:32 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* sign.c (sign_file): Always use compression algo 1 for signed
onyl file becuase we can´ be sure the the verifier supports other
algorithms.
* build-packet.c (build_sig_subpkt): Support for notation data.
* sign.c (sign_file,clearsign_file,make_keysig_packet): Ditto.
(mk_notation): New.
* g10.c (add_notation_data): New and add option -N
* mainproc.c (print_notation_data): New.
(check_sig_and_print): Print any notation data of the signed text.
Sun May 23 14:20:22 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (check_signatures_trust): Print a warning and return
immediateley if opt.always_trust is true.
* g10.c (main): Corrected handling of no-default-keyring
* pkclist.c (algo_available): Disable Twofish until we have settled
how to do the MDC.
* hkp.c: Disable everything for mingw32
Sat May 22 22:47:26 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* mainproc.c (check_sig_and_print): Add sig creation time to the
VALIDSIG status output. Add more info to the ERRSIG output.
* sig-check.c (signature_check): Add sig time after epoch to SIG_ID.
* import.c (import_one): Merge duplicate user IDs.
(collapse_uids): New.
* kbnode.c (move_kbnode): New.
(remove_kbnode): New.
* keyedit.c (keyedit_menu): Call collapse_uids.
* g10.c: new option --logger-fd.
* import.c: s/log_*_f/log_*/
Thu May 20 14:04:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* misc.c (pull_in_libs): do the volatile only for gcc
* sig-check (signature_check): Emit SIG_iD only for classes 0 and 1.
* armor.c (armor_filter): Add detection of PGP2 created clearsigs.
(fake_packet): A tab is not a WS for pgp2 - handle this.
* textfilter.c (len_without_trailing_chars): New.
(copy_clearsig_text): Add pgp2mode arg.
* sign.c (clearsign_file): pass old_style to the above fnc.
Wed May 19 16:04:30 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c: New option --interactive.
* mainproc.c (proc_plaintext): Add workaround for pgp2 bug
(do_check_sig): Ditto.
(proc_tree): Ditto.
* plaintext.c (do_hash): Ditto.
(hash_datafiles): Ditto, add an arg, changed all callers.
* mdfilter.c (md_filter): Add support for the alternate hash context.
Mon May 17 21:54:43 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* parse-packet.c (parse_encrypted): Support for PKT_ENCRYPTED_MDC.
* build-packet.c (do_encrypted_mdc): Ditto.
* cipher.c (write_header): Add mdc hashing.
(cipher_filter): write out the hash.
* mainproc.c (do_proc_packets): Add PKT_ENCRYPTED_MDC.
* encr-data.c (decrypt_data): Add mdc hashing.
(mdc_decode_filter): New.
* parse-packet.c (parse_sig_subpkt): Fixed stupid bug for subpkt
length calculation
(parse_signature): Fixed even more stupid bug.
Sat May 8 19:28:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* build-packet.c (do_signature): Removed MDC hack.
* encode.c (encode_crypt_mdc): Removed.
* mainproc.c (do_check_sig): Removed MDC hack.
(check_sig_and_print): Ditto.
* parse-packet.c (parse_signature): Ditto.
* sig-check.c (mdc_kludge_check): Ditto.
* free-packte.c (copy_signature, free_seckey_enc): Ditto.
* parse-packet.c (parse_signature,parse_key): Store data of
unknown algorithms with mpi_set_opaque inseatd of the old
faked data stuff.
(read_rest): Removed.
(read_rest2): Renamed to read_rest
* build-packet.c (write_fake_data): Use mpi_get_opaque.
* free-packet.c (cp_fake_data): Removed and cahnged all callers
to use mpi_copy.
(free_pubkey_enc,free_seckey_enc,release_public_key_parts,
release_secret_key_parts): Use mpi_free for opaque data.
Thu May 6 14:18:17 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* trustdb.c (check_trust): Check for revoked subkeys.
* pkclist.c (do_we_trust): Handled revoked subkeys.
(do_we_trust_pre): Ditto.
(check_signatures_trust): Ditto.
* build-packet.c (hash_public_key): Fix for ancient g10 keys.
* mainproc.c (do_proc_packets): Return EOF if no data has been read.
* g10.c (main): Catch errors for default operation.
Thu Apr 29 12:29:22 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* sign.c (sign_file): Fixed hashing in case of no subpackets.
(clearsign_file): Ditto.
(make_keysig_packet): Ditto.
Wed Apr 28 13:03:03 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* keyedit.c (keyedit_menu): Add new command revkey.
* (menu_revkey): New.
Mon Apr 26 17:48:15 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* parse-packet.c (parse_signature): Add the MDC hack.
* build-packet.c (do_signature): Ditto.
* free-packet.c (free_seckey_enc,copy_signature,cmp_signatures): Ditto.
* mainproc.c (do_check_sig): Ditto.
* sig-check.c (mdc_kludge_check): New.
* encode.c (encrypt_mdc_file): New.
* keyedit.c (check_all_keysigs): List revocations.
* (menu_revsig): New.
* sign (make_keysig_packet): Support for class 0x30.
Sun Apr 18 20:48:15 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (select_algo_from_prefs): Fixed the case that one key
has no preferences (Remi Guyomarch).
keylist.c (list_keyblock): ulti_hack to propagate trust to all uids.
Sun Apr 18 10:11:28 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* seckey-cert.c (do_check): Use real IV instead of a 0 one, so that
it works even if the length of the IV doesn't match the blocksize.
Removed the save_iv stuff.
(protect_secret_key): Likewise. Create the IV here.
* packet.h (PKT_secret_key): Increased size of IV field and add a
ivlen field.
* parse-packet.c (parse_key): Use the len protect.ivlen.
* build-packet.c (do_secret_key). Ditto.
* getkey.c (key_byname): Close keyblocks.
* Makefile.am (gpgm): Removed this
* g10.c: Merged gpg and gpgm
* import.c (import): Utilize option quiet.
* tdbio.c (tdbio_set_dbname): Ditto.
* ringedit.c (add_keyblock_resource,keyring_copy): Ditto.
* keyedit.c (sign_uids): Add some batch support.
* g10.c (main): add call to tty_batchmode.
Fri Apr 9 12:26:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* status.c (write_status_text): Some more status codes.
* passphrase_to_dek (passphrase_to_dek): add a status code.
* seckey_cert.c (check_secret_key): Likewise.
* encr-data.c (decrypt_data): Reverse the last changes
* cipher.c (write_header): Ditto.
* parse-packet.c (parse_key): Dropped kludge for ancient blowfish mode.
Thu Apr 8 09:35:53 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* mainproc.c (proc_encrypted): Add a new status output
* passphrase.c (passphrase_to_dek): Ditto.
* status.h status.c: Add new status tokens.
Wed Apr 7 20:51:39 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* encr-data.c (decrypt_data): Fixes for 128 bit blocksize
* cipher.c (write_header): Ditto.
* seckey-cert.c (do_check): Ditto.
(protect_secret_key). Ditto.
* misc.c (print_cipher_algo_note): Twofish is now a standard algo.
* keygen.c (do_create): Fixed spelling (Gaël Quéri)
(ask_keysize): Only allow keysizes up to 4096
* ringedit.c (add_keyblock_resource): chmod newly created secrings.
* import.c (delete_inv_parts): Fixed accidently deleted subkeys.
Tue Apr 6 19:58:12 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* armor.c: Removed duped include (John Bley)
* mainproc.c: Ditto.
* build-packet.c (hash_public_key): Fixed hashing of the header.
* import.c (delete_inv_parts): Allow import of own non-exportable sigs.
Sat Mar 20 13:59:47 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (fake_packet): Fix for not not-dash-escaped
Sat Mar 20 11:44:21 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c (main): Added command --recv-keys
* hkp.c (hkp_import): New.
Wed Mar 17 13:09:03 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* trustdb.c (check_trust): add new arg add_fnc and changed all callers.
(do_check): Ditto.
(verify_key): Ditto.
(propagate_validity): Use the new add_fnc arg.
(print_user_id): Add the FILE arg.
(propagate_ownertrust): New.
* pkclist.c (add_ownertrust_cb): New and changed the add_ownertrust
logic.
* getkey.c (get_keyblock_bylid): New.
* trustdb.c (print_uid_from_keyblock): New.
(dump_tn_tree_with_colons): New.
(list_trust_path): Add colon print mode.
* trustdb.c (insert_trust_record): Always use the primary key.
* encode.c (encode_simple): Added text_mode filter (Rémi Guyomarch)
(encode_crypt): Ditto.
* mainproc.c (proc_pubkey_enc): Added status ENC_TO.
* armor.c (armor_filter): Added status NODATA.
* passphrase.c (passphrase_to_dek): Always print NEED_PASSPHRASE
* seckey_cert.c (check_secret_key): Added BAD_PASS status.
* g10.c (main): Set g10_opt_homedir.
Sun Mar 14 19:34:36 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* keygen.c (do_create): Changed wording of the note (Hugh Daniel)
Thu Mar 11 16:39:46 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* tdbdump.c: New
* trustdb.c (walk_sigrecs,do_list_sigs,list_sigs,
list_records,list_trustdb,export_ownertrust,import_ownertrust): Moved
to tdbdump.c
(init_trustdb): renamed to setup_trustdb. Changed all callers.
(do_init_trustdb): renamed to init_trustdb().
* trustdb.c (die_invalid_db): replaced by tdbio_invalid.
* tdbio.c (tdbio_invalid): New.
* import.c (delete_inv_parts): Skip non exportable signatures.
* keyedit.c (sign_uid_mk_attrib): New.
(sign_uids): Add the local argument.
(keyedit_menu): New "lsign" command.
* trustdb.c (register_trusted_key): Removed this and all related stuff.
* g10.c (oTrustedKey): Removed option.
* tdbio.h (dir.valcheck): New trustdb field.
* tdbio.c: Add support for this field
(tdbio_read_modify_stamp): New.
(tdbio_write_modify_stamp): New.
* trustdb.c (do_check): Check against this field. Removed cache update.
(verify_key): Add cache update.
(upd_uid_record): Some functional changes.
(upd_cert_record): Ditto
Wed Mar 10 11:26:18 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* keylist.c (list_keyblock): Fixed segv in uid. Print 'u' as
validity of sks.
Mon Mar 8 20:47:17 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* getkey.c (classify_user_id): Add new mode 12 (#<lid>).
* seckey-cert.c (check_secret_key): replaced error by info.
* trustdb.c (query_trust_info): Add another arg, changed all callers.
(check_trust): Ditto.
(do_check): Ditto.
(verify_key): Handle namehash.
* keylist.c (list_keyblock): print trust info for user ids.
* sig-check.c (signature_check): Add sig-created to status output.
Tue Mar 2 16:44:57 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* textfilter.c (copy_clearsig_text): New.
(clearsign): Removed.
* sign.c (clearsign_file): does not use textfiler anymore.
* keygen.c (ask_user_id): print a note about the used charset.
Tue Mar 2 10:38:42 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* sig-check.c (signature_check): sig-id now works for all algos.
* armor.c (armor_filter): Fixed armor bypassing.
Sun Feb 28 19:11:00 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* keygen.c (ask_user_id): Don't change the case of email addresses.
(has_invalid_email_chars): Adjusted.
* keylist.c (list_one): Really list serect keys (Remi Guyomarch)
* keyedit.c (menu_select_uid): Add some braces to make egcs happy.
(menu_select_key): Ditto.
* mainproc.c (do_proc_packets): List sym-enc packets (Remi Guyomarch)
Fri Feb 26 17:55:41 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (build_pk_list): Return error if there are no recipients.
* sig-check.c (signature_check): New signature id feature.
* armor.c (make_radic64_string): New.
* mainproc.c (proc_pubkey_enc): early check for seckey availability.
* pkclist.c (do_we_trust_pre): print user id before asking.
* ringedit.c (add_keyblock_resource,get_keyblock_handle): Cleaner
handling of default resource.
Thu Feb 25 18:47:39 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (algo_available): New.
(select_algo_from_prefs): Check whether algo is available.
* ringedit.c (keyring_copy): Take care of opt.dry_run.
(do_gdbm_store): Ditto.
* openfile.c (open_outfile). Ditto.
(copy_options_file): Ditto.
* trustdb.c (update_trustdb): Ditto.
(clear_trust_checked_flag): Ditto.
(update_trust_record): Ditto.
(insert_trust_record): Ditto.
Wed Feb 24 11:07:27 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* keylist.c (secret_key_list): Now really list the secret key.
* trustdb.c (do_init_trustdb): New. Init is now deferred.
Mon Feb 22 20:04:00 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* getkey.c (lookup_sk): Return G10ERR_NO_SECKEY and not x_PUBKEY.
Fri Feb 19 15:49:15 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (select_algo_from_prefs): retrieve LID if not there.
* armor.c (fake_packet): Replaced ugly lineending handling.
* g10.c (oNoEncryptTo): New.
* pkclist.c (build_pk_list): Implemented this option.
* g10.c (main): Greeting is now printed to stderr and not to tty.
Use add_to_strlist() instead of direct coding.
* import.c (import): Use iobuf_push_filter2.
* mainproc.c (check_sig_and_print): Print all user ids
for good signatures.
* getkey.c (get_pubkeyblock): New.
* import.c (chk_self_sigs): Fixed SEGV for unbounded class 0x18 keys.
(delete_inv_parts): Delete special marked packets.
Tue Feb 16 14:10:02 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c (main): New option --encrypt-to
* pkclist.c (build_pk_list): Implemented encrypt-to.
* parse-packet.c (parse_user_id): Removed the hack to work with
utf-8 strings.
* g10.c (main): Install lockfile cleanup handler.
* tdbio.c (cleanup): Removed: this is now handled by dotlock.
Sat Feb 13 14:13:04 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* tdbio.c (tdbio_set_dbname): Init lockhandle for a new trustdb
Wed Feb 10 17:15:39 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c (main): check for development version now in configure
* tdbio.c (tdbio_write_record): Add uid.validity
(tdbio_read_record) : Ditto.
(tdbio_dump_record) : Ditto.
* keygen.c (keygen_add_std_prefs): Replaced Blowfish by Twofish,
removed MD5 and Tiger.
* pubkey-enc.c (get_it): Suppress warning about missing Blowfish
in preferences in certain cases.
* ringedit.c (lock_rentry,unlock_rentry): New.
* getkey.c (key_byname): Pass ret_kb down to lookup_xx.
* armor.c (armor_filter): No output of of empty comment lines.
Add option --no-version to suppress the output of the version string.
* getkey.c: Release the getkey context for auto context variables.
Sun Jan 24 18:16:26 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* getkey.c: Changed the internal design to allow simultaneous
lookup of multible user ids
(get_pubkey_bynames): New.
(get_seckey_bynames): New.
(get_seckey_next): New.
(get_seckey_end): New.
* keylist.c (list_one): Use the new functions.
* keylist.c (list_keyblock): add a newline for normal listings.
* g10.c (--recipient): New option name to replace --remote-user
Wed Jan 20 18:59:49 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* textfilter.c: Mostly rewritten
* plaintext.c (handle_plaintext): Use now text_filter semantics.
Tue Jan 19 19:34:58 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* export.c (export_pubkeys_stream): New.
(do_export_stream): New.
* g10.c (aSendKeys): New command.
* hkp.c (hkp_export): New.
* compress.c (do_uncompress): Hack for algo 1 and 1.1.3
Sun Jan 17 11:04:33 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* textfilter.c (text_filter): Now uses iobuf_read_line().
(read_line): Removed.
* armor.c (trim_trailing_spaces): Removed and replaced
by trim_trailing_ws from libutil
Sat Jan 16 12:03:27 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* hkp.c (hkp_ask_import): Use only the short keyid
Sat Jan 16 09:27:30 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* import.c (import_key_stream): New
(import): New, moved most of import_keys here.
* g10.c: New option --keyserver
* mainproc.c (check_sig_and_print): Hook to import a pubkey.
* pref.c pref.h : Removed
* hkp.c hkp.h: New
Wed Jan 13 14:10:15 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (radix64_read): Print an error if a bad armor was detected.
Wed Jan 13 12:49:36 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (radix64_read): Now handles malformed armors produced
by some buggy MUAs.
Tue Jan 12 11:17:18 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* ringedit.c (find_keyblock_bysk): New.
* skc_list.c (is_insecure): New.
(build_sk_list): usage check for insecure keys.
* import.c (chk_self_sigs): Add handling for subkeys.
(delete_inv_parts): Skip unsigned subkeys
* sig-check.c (do_check): Print info if the signature is older
than the key.
* keygen.c (generate_subkeypair): Fail on time warp.
* sign.c (do_sign): Ditto.
Sun Jan 10 15:10:02 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (fake_packet): Fixed not-dash-escaped bug.
Sat Jan 9 16:02:23 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* sig-check.c (do_check): Output time diff on error
* status.c (STATUS_VALIDSIG): New.
(is_status_enabled): New.
* mainproc.c (check_sig_and_print): Issue that status message.
* plaintext.c (special_md_putc): Removed
* armor.c (armor_filter): print error for truncated lines.
* free-packet.c (free_encrypted): Revomed call to set_block_mode.
(free_plaintext): Ditto.
Thu Jan 7 18:00:58 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (add_ownertrust): Fixed return value.
* encr-data.c (decrypt_data): Disabled iobuf_set_limit and
iobuf_pop_filter stuff.
* compress.c (handle_compressed): Disabled iobuf_pop_filter.
* packet.h (PKT_secret_key): Add is_primary flag.
* parse-packet.c (parse_key): Set this flag.
* passphrase.c (passphrase_to_dek): Kludge to print the primary
keyid - changed the API: keyid must now hold 2 keyids.
* getkey.c (get_primary_seckey): New.
* seckey-cert.c (do_check): pass primary keyid to passphrase query
* tbdio.c (open_db): removed the atexit
(tdbio_set_dbname): and moved it to here.
* armor.c: Rewrote large parts.
Tue Dec 29 19:55:38 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* revoke.c (gen_revoke): Removed compression.
* pkclist.c (do_we_trust_pre): special check for revoked keys
* trustdb.c (update_trust_record): Fixed revoke flag.
Tue Dec 29 14:41:47 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* misc.c (disable_core_dumps): Check for EINVAL (Atari)
* getkey (merge_one_pk_and_selfsig): Fixed search of expiredate.
(merge_keys_and_selfsig): Ditto.
* free-packet.c (cmp_public_keys): cmp expire only for v3 packets
(cmp_secret_keys): Ditto.
(cmp_public_secret_key): Ditto.
Wed Dec 23 17:12:24 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (find_header): Reset not_dashed at every header
Wed Dec 23 13:18:14 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (add_ownertrust): Refresh validity values.
* trustdb.c (enum_cert_paths_print): New arg refresh.
* ringedit.c: Fixed problems fix keyrings
* parse-packet.c (dbg_parse_packet): New debug functions.
* getkey.c (getkey_disable_caches): New.
* import.c (import_keys): Disable caches.
Thu Dec 17 18:31:15 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* misc.c (trap_unaligned): Only for glibc 1
* sign.c (write_dash_escaped): Now escapes "From " lines
* g10.c: New option --escape-from-lines
* trustdb.c (sort_tsl_list): New
(list_trust_path): Now prints sorted list.
(enum_cert_paths): Likewise.
(enum_cert_paths_print): New.
(print_paths): New printing format.
* pkclist.c (add_ownertrust): New arg quit.
(edit_ownertrust): New quit selection and does not query
the recipients ownertrust anymore.
(add_ownertrust): Print the ceritficate path.
Mon Dec 14 21:18:49 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* parse-packet.c (parse_signature): Now checks for critical bit
(parse_sig_subpkt): Splitted.
(parse_one_sig_subpkt): New.
* sig-check.c (do_check): handle critical bit.
Sun Dec 13 14:10:56 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* pcklist.c (select_algo_from_prefs): Preferences should
now work (lost the != ? )
Thu Dec 10 20:15:36 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* ringedit.c (gdbm_store): Fix for inserts
* g10.c (main): New option --export-all
* export.c (export_pubkeys): New arg.
(do_export): Now may skip old keys.
* status.c: Minor patches for Sun's cc
* keygen.c (ask_algo): Disabled v3 ElGamal choice, rearranged
the numbers. Add a warning question when a sign+encrypt key
is selected.
* g10.c (do_not_use_RSA): Removed.
* misc.c (print_pubkey_algo_note): New as replacement for the
do_not_use_RSA() and chnaged all callers.
(print_cipher_algo_note): New.
(print_hash_algo_note): New.
* cipher.c (write_header): Add a call to print_cipher_algo_note.
* seckey-cert.c (protect_secret_key): Ditto
* sign.c (do_sign): Add a call to print_digest_algo_note.
* getkey.c (get_long_user_id_string): New.
* mainproc.c (check_sig_and_print): Changed the format of the
status output.
* encrypt.c (write_pubkey_enc_from_list): print used symmetric cipher.
* pkclist.c (do_we_trust): Changed a message.
Wed Dec 9 13:41:06 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* misc.c (trap_unaligned) [ALPHA]: Only if UAC_SIGBUS is defined.
* sign.c (write_dash_escaped): Add the forgotten patch by Brian Moore.
* compress.c (do_uncompress): Fixed the inflating bug.
Tue Dec 8 13:15:16 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* trustdb.c (upd_uid_record): Now uses the newest self-signature
(insert_trust_record): Now calls update with recheck set to true.
(register_trusted_key): New.
(verify_own_keys): Enhanced by list of trusted keys.
* g10.c (main): Print a warning when a devel version is used.
(main): New option --trusted-key
* import.c (merge_blocks): Fixed merging of new user ids and
added merging of subkeys.
(append_uid): Ditto.
(merge_keysig): New.
(append_key): New.
* getkey.c (merge_one_pk_and_selfsig): Get the expiration time
from the newest self-signature.
(merge_keys_and_selfsig): Ditto.
* free-packet.c (cmp_secret_key): New.
Fri Nov 27 21:37:41 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* g10.c: New option --lock-once
* tdbio.c (open_db): Add an atexit
(cleanup): New.
(tdbio_sync): Add locking.
(tdbio_end_transaction): Ditto.
(put_record_into_cache): Ditto.
* ringedit.c (keyring_copy): Ditto.
(cleanup): New.
(add_keyblock_resource): Add an atexit.
Fri Nov 27 15:30:24 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (find_header): Another fix for clearsigs.
Fri Nov 27 12:39:29 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* status.c (display_help): Removed.
* helptext.c: New and removed the N_() from all cpr_gets.
Fri Nov 20 16:54:52 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): New option --not-dash-escaped
* sign.c (write_dashed_escaped): Ditto.
* armor.c (find_header): Support for NotDashEscaped header.
* getkey.c: print "disabled cache.." only if verbose is used.
Thu Nov 19 07:17:31 1998 Werner Koch <werner.koch@guug.de>
* parse-packet.c (dump_sig_subpkt): Fixed expire listing
* getkey.c (merge_keys_and_selfsig): Fixed expire calculation.
(merge_one_pk_and_selfsig): Ditto.
* keyedit.c (menu_expire). Ditto.
* keygen.c (keygen_add_key_expire): Ditto.
(ask_expire_interval): New and changed all local function to use
this instead.
(keygen_add_key_expire): Opaque should now be a public key;
changed all callers.
* parse.packet.c (parse): use skip_rest to skip packets.
* keyedit.c (keyedit_menu): New arg for cmdline cmds.
Wed Nov 18 20:33:50 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (check_trustdb): Now rechecks all gived userids.
(collect_paths): Some fixes.
(upd_pref_records): Skips empty items, evaluate all items.
* parse-packet.c (dump_sig_subpkt): Better listing of prefs.
(skip_packet): Now knows about marker packet
* g10.c: removed cmd "--edit-sig".
* pubring.asc: Updated.
Sat Nov 14 14:01:29 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Changed syntax of --list-trust-path
* trustdb.c (list_trust_path): Replaced max_depth by
opt.max_cert_depth
Fri Nov 13 07:39:58 1998 Werner Koch <werner.koch@guug.de>
* trustdb.c (collect_paths): Removed a warning message.
(enum_trust_web): Removed.
(enum_cert_paths): New.
* pkclist.c (add_ownertrust): Changed to use enum_cert_paths.
(edit_ownertrust): Now list ceritficates on request.
(show_paths): New.
Wed Nov 11 18:05:44 1998 Werner Koch <werner.koch@guug.de>
* g10.c (main): New option --max-cert-depth
* tdbio.h: add new fields to ver and dir record.
* tdbio.c: read/write/dump of these fields.
(tdbio_db_matches_options): New.
* trustdb.c: replaced MAC_CERT_DEPTH by opt.max_cert_depth.
(do_check): cache validity and changed other functions
to reset the cached value.
* keylist.c (list_one): Now lists the ownertrust.
* mainproc.c (list_node): Ditto.
Tue Nov 10 10:08:59 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (g10_exit): Now looks at the new g10_errors_seen.
* mainproc.c (check_sig_and_print): Sets g10_errors_seen.
* *.c : i18n many more strings.
* ringedit.c (locate_keyblock_by_keyid): Add HAVE_LIBGDBM
(locate_keyblock_by_fpr): Ditto.
* g10.c (main): removed unsused "int errors".
(main): Add new option --charset.
* g10.c (main): special message for the unix newbie.
Mon Nov 9 07:17:42 1998 Werner Koch <werner.koch@guug.de>
* getkey.c (finish_lookup): Kludge to prefere algo 16.
* trustdb.c (new_lid_table): Clear cached item.
* status.c (cpr_get_utf8): New.
* pkclist.c (build_pk_list): Uses this.
Sun Nov 8 17:20:39 1998 Werner Koch (wk@isil.d.shuttle.de)
* mainproc.c (check_sig_and_print): Why did I use strlen()-1
in the printf? - This truncated the TZ.
Sat Nov 7 15:57:28 1998 me,,, (wk@tobold)
* getkey.c (lookup): Changes to support a read_next.
(get_pubkey): Fixed a memory leak.
* keylist.c (list_one): Now lists all matching user IDs.
Tue Nov 3 16:19:21 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (ask_user_id): Now converted to UTF-8
* g10.c (main): Kludge for pgp clearsigs and textmode.
Fri Oct 30 16:40:39 1998 me,,, (wk@tobold)
* signal.c (block_all_signals): New.
(unblock_all_signals): New
* tdbio.c (tdbio_end_transaction): Now blocks all signals.
* trustdb.c (new_lid_table): Changed the representation of the
former local_lid_info stuff.
* trustdb.c (update_trust_record): Reorganized the whole thing.
* sig-check.c (check_key_signature): Now handles class 0x28
Wed Oct 28 18:56:33 1998 me,,, (wk@tobold)
* export.c (do_export): Takes care of the exportable sig flag.
Tue Oct 27 14:53:04 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (update_trust_record): New "fast" parameter.
Sun Oct 25 19:32:05 1998 Werner Koch (wk@isil.d.shuttle.de)
* openfile.c (copy_options_File): New.
* ringedit.c (add_keyblock_resource): Creates options file
* tdbio.c (tdbio_set_dbname): Ditto.
Sat Oct 24 14:10:53 1998 brian moore <bem@cmc.net>
* mainproc.c (proc_pubkey_enc): Don't release the DEK
(do_proc_packets): Ditto.
Fri Oct 23 06:49:38 1998 me,,, (wk@tobold)
* keyedit.c (keyedit_menu): Comments are now allowed
* trustdb.c: Rewrote large parts.
Thu Oct 22 15:56:45 1998 Michael Roth (mroth@nessie.de)
* encode.c: (encode_simple): Only the plain filename without
a given directory is stored in generated packets.
(encode_crypt): Ditto.
* sign.c: (sign_file) Ditto.
Thu Oct 22 10:53:41 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (update_trust_record): Add new optional arg.
* import.c (import_keys): Add statistics output
* trustdb.c (update_trustdb): Ditto.
(insert_trustdb): Ditto.
* tdbio.c (tdbio_begin_transaction): New.
(tdbio_end_transaction): New.
(tdbio_cancel_transaction): New.
* g10.c (main): New option --quit.
* trustdb.c (check_hint_sig): No tests for user-id w/o sig.
This caused an assert while checking the sigs.
* trustdb.c (upd_sig_record): Splitted into several functions.
* import.c (import_keys): New arg "fast".
* g10.c (main): New command --fast-import.
Wed Oct 21 18:19:36 1998 Michael Roth <mroth@nessie.de>
* ringedit.c (add_keyblock_resource): Directory is now created.
* tdbio.c (tdbio_set_dbname): New info message.
Wed Oct 21 11:52:04 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (update_trustdb): released keyblock in loop.
* keylist.c (list_block): New.
(list_all): Changed to use list_block.
* trustdb.c: Completed support for GDBM
* sign.c (only_old_style): Changed the way force_v3 is handled
(sign_file): Ditto.
(clearsign_file): Ditto.
* keygen.c (has_invalid_email_chars): Splitted into mailbox and
host part.
* keylist.c (list_one): Add a merge_keys_and_selfsig.
* mainproc.c (proc_tree): Ditto.
Sun Oct 18 11:49:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* sign.c (only_old_style): Add option force_v3_sigs
(sign_file): Fixed a bug in sig->version
(clearsign_file): Ditto.
* parse-packet.c (dump_sig_subpkt): New
* keyedit.c (menu_expire): New.
* free-packet.c (cmp_signatures): New
Sat Oct 17 10:22:39 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c: changed output line length from 72 to 64.
* keyedit.c (fix_keyblock): New.
Fri Oct 16 10:24:47 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c: Rewrote most.
* tdbio.c: Add cache and generalized hash tables.
* options.h (ENABLE_COMMENT_PACKETS): New but undef'ed.
* encode.c, sign.c, keygen.c: Disabled comment packets.
* export.c (do_export): Comment packets are never exported,
except for those in the secret keyring.
* g10.c (main): Removed option do-no-export-rsa; should be
be replaced by a secpial tool.
* export.c (do_export): Removed the code for the above option.
* armor.c (find_header): Support for new only_keyblocks.
* import.c (import_keys): Only looks for keyblock armors.
* packet.h: replaced valid_days by expiredate and changed all users.
* build-packet.c (do_public_key): calculates valid-days
(do_secret_key): Ditto.
* parse-packet.c (parse_key): expiredate is calucated from the
valid_period in v3 packets.
* keyid.c (do_fingerprint_md): calculates valid_dates.
* keygen.c (add_key_expire): fixed key expiration time for v4 packets.
* armor.c (find_header): A LF in the first 28 bytes
was skipped for non-armored data.
Thu Oct 8 11:35:51 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (is_armored): Add test on old comment packets.
* tdbio.c (tdbio_search_dir_bypk): fixed memory leak.
* getkey.c: Changed the caching algorithms.
Wed Oct 7 19:33:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* kbnodes.c (unused_nodes): New.
Wed Oct 7 11:15:36 1998 Werner Koch (wk@isil.d.shuttle.de)
* keyedit.c (sign_uids): Fixed a problem with SK which could caused
a save of an unprotected key.
(menu_adduid): Ditto.
* keyedit.c (keyedit_menu): Prefs are now correctly listed for
new user ids.
* trustdb.c (update_trust_record): New.
(insert_trust_record): Now makes use of update_trust_record.
Tue Oct 6 16:18:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (read_record): replaces most of the tdbio_read_records.
(write_record): Ditto.
Sat Oct 3 11:01:21 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (ask_alogo): enable ElGamal enc-only only for addmode.
Wed Sep 30 10:15:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* import.c (import_one): Fixed update of wrong keyblock.
Tue Sep 29 08:32:08 1998 me,,, (wk@tobold)
* mainproc.c (proc_plaintext): Display note for special filename.
* plaintext.c (handle_plaintext): Suppress output of special file.
Mon Sep 28 12:57:12 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (verify_own_keys): Add warning if a key is not protected.
* passphrase (hash_passphrase): Fixed iterated+salted mode and
setup for keysizes > hashsize.
* g10.c (main): New options: --s2k-{cipher,digest,mode}.
Fri Sep 25 09:34:23 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c: Chnaged some help texts.
Tue Sep 22 19:34:39 1998 Werner Koch (wk@isil.d.shuttle.de)
* passphrase.c (read_passphrase_from_fd): fixed bug for long
passphrases.
Mon Sep 21 11:28:05 1998 Werner Koch (wk@(none))
* getkey.c (lookup): Add code to use the sub key if the primary one
does not match the usage.
* armor.c (armor_filter): New error message: no valid data found.
(radix64_read): Changes to support multiple messages.
(i18n.h): New.
* mainproc.c (add_onepass_sig): bug fix.
Mon Sep 21 08:03:16 1998 Werner Koch (wk@isil.d.shuttle.de)
* pkclist.c (do_we_trust): Add keyid to most messages.
* passphrase.c (read_passphrase_from_fd): New.
(have_static_passphrase): New
(get_passphrase_fd): Removed.
(set_passphrase_fd): Removed.
* g10.c (main): passphrase is now read here.
* keyedit.c (keyedit_menu): "help" texts should now translate fine.
Mon Sep 21 06:40:02 1998 Werner Koch (wk@isil.d.shuttle.de)
* encode.c (encode_simple): Now disables compression
when --rfc1991 is used.
(encode_crypt): Ditto.
Fri Sep 18 16:50:32 1998 Werner Koch (wk@isil.d.shuttle.de)
* getkey.c (merge_key_and_selfsig): New.
Fri Sep 18 10:20:11 1998 Werner Koch (wk@isil.d.shuttle.de)
* pkclist.c (select_algo_from_prefs): Removed 3DES kludge.
* seskey.c (make_session_key): Fixed SERIOUS bug introduced
by adding the weak key detection code.
* sign.c (sign_file): Changed aremor header in certain cases.
Tue Sep 15 17:52:55 1998 Werner Koch (wk@isil.d.shuttle.de)
* mainproc.c (check_sig_and_print): Replaced ascime by asctimestamp.
Mon Sep 14 11:40:52 1998 Werner Koch (wk@isil.d.shuttle.de)
* seskey.c (make_session_key): Now detects weak keys.
* trustdb (clear_trust_checked_flag): New.
* plaintext.c (handle_plaintext): Does no anymore suppress CR from
cleartext signed messages.
Sun Sep 13 12:54:29 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (insert_trust_record): Fixed a stupid bug in the free
liunked list loops.
Sat Sep 12 15:49:16 1998 Werner Koch (wk@isil.d.shuttle.de)
* status.c (remove_shmid): New.
(init_shm_comprocess): Now sets permission to the real uid.
Wed Sep 9 11:15:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h (PKT_pubkey_enc): New flah throw_keyid, and add logic to
implement it.
* g10.c (main): New Option --throw-keyid
* getkey.c (enum_secret_keys): Add new ar and changed all callers.
Tue Sep 8 20:04:09 1998 Werner Koch (wk@isil.d.shuttle.de)
* delkey.c (delete_key): Moved from keyedit.c.
Mon Sep 7 16:37:52 1998 Werner Koch (wk@isil.d.shuttle.de)
* build-packet.c (calc_length_header): New arg new_ctb to correctly
calculate the length of new style packets.
* armor.c (is_armored): Checks for symkey_enc packets.
* pkclist.c (select_algo_from_prefs): 3DEs substitute is now CAST5.
Tue Aug 11 17:54:50 1998 Werner Koch (wk@isil.d.shuttle.de)
* build-packet.c (do_secret_key): Fixed handling of old keys.
* getkey.c (compare_name): Fixed exact and email matching
* openfile.c (open_outfile): Changed arguments and all callers.
Tue Aug 11 09:14:35 1998 Werner Koch (wk@isil.d.shuttle.de)
* encode.c (encode_simple): Applied option set-filename and comment.
(encode_crypt): Ditto.
* sign.c (sign_file): Ditto.
* armor.c (armor_filter): Applied option comment.
* encode.c (encode_crypt): Moved init_packet to the begin.
(encode_simple): add an init_packet().
* comment (write_comment): Now enforces a hash sign as the 1st byte.
* import.c (import_one): Add explanation for "no user ids".
* compress.c (do_uncompress): Applied Brian Warner's patch to support
zlib 1.1.3 etc.
* trustdb.c (check_trust): Fixed a problem after inserting new keys.
* getkey (lookup): do not return the primary key if usage is given
(lookup_sk): Ditto and take usage into account.
* status.c (cpr_get_answer_is_yes): add display_help.
Mon Aug 10 10:11:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* getkey.c (lookup_sk): Now always returns the primary if arg
primary is true.
(lookup): Likewise.
(get_pubkey_byname): Now returns the primary key
(get_seckey_byname): Ditto.
Mon Aug 10 08:34:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* keyid.c (pubkey_letter): ELG_E is now a small g.
Sat Aug 8 17:26:12 1998 Werner Koch (wk@isil.d.shuttle.de)
* openfile (overwrite_filep): Changed semantics and all callers.
Sat Aug 8 12:17:07 1998 Werner Koch (wk@isil.d.shuttle.de)
* status.c (display_help): New.
Thu Aug 6 16:30:41 1998 Werner Koch,mobil,,, (wk@tobold)
* seskey.c (encode_session_key): Now uses get_random_bits().
Thu Aug 6 07:34:56 1998 Werner Koch,mobil,,, (wk@tobold)
* ringedit.c (keyring_copy): No more backupfiles for
secret keyrings and add additional warning in case of
a failed secret keyring operation.
Wed Aug 5 11:54:37 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (check_opts): Moved to main. Changed def_cipher_algo
semantics and chnaged all users.
* pubkey-enc.c (get_sssion_key): New informational output
about preferences.
* parse-packet.c (parse_symkeyenc): Fixed salted+iterated S2K
(parse_key): Ditto.
* build-packet.c (do_secret_key): Ditto.
(do_symkey_enc): Ditto.
Tue Aug 4 08:59:10 1998 Werner Koch (wk@isil.d.shuttle.de)
* getkey.c (enum_secret_keys): Now returns only primary keys.
* getkey (lookup): Now sets the new namehash field.
* parse-packet.c (parse_sig_subpkt2): New.
* sign.c (sign_file): one-pass sigs are now emiited reverse.
Preference data is considered when selecting the compress algo.
Wed Jul 29 12:53:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* free-packet.c (copy_signature): New.
* keygen.c (generate_subkeypair): rewritten
* g10.c (aKeyadd): Removed option --add-key
Mon Jul 27 10:37:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* seckey-cert.c (do_check): Additional check on cipher blocksize.
(protect_secret_key): Ditto.
* encr-data.c: Support for other blocksizes.
* cipher.c (write_header): Ditto.
Fri Jul 24 16:47:59 1998 Werner Koch (wk@isil.d.shuttle.de)
* kbnode.c (insert_kbnode): Changed semantics and all callers.
* keyedit.c : More or less a complete rewrite
Wed Jul 22 17:10:04 1998 Werner Koch (wk@isil.d.shuttle.de)
* build-packet.c (write_sign_packet_header): New.
Tue Jul 21 14:37:09 1998 Werner Koch (wk@isil.d.shuttle.de)
* import.c (import_one): Now creates a trustdb record.
* g10.c (main): New command --check-trustdb
Mon Jul 20 11:15:07 1998 Werner Koch (wk@isil.d.shuttle.de)
* genkey.c (generate_keypair): Default key is now DSA with
encryption only ElGamal subkey.
Thu Jul 16 10:58:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* keyid.c (keyid_from_fingerprint): New.
* getkey.c (get_pubkey_byfprint): New.
Tue Jul 14 18:09:51 1998 Werner Koch (wk@isil.d.shuttle.de)
* keyid.c (fingerprint_from_pk): Add argument and changed all callers.
(fingerprint_from_sk): Ditto.
Tue Jul 14 10:10:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* plaintext.c (handle_plaintext): Now returns create error if
the file could not be created or the user responded not to overwrite
the file.
* mainproc.c (proc_plaintext): Tries again if the file could not
be created to check the signature without output.
* misc.c (disable_core_dumps): New.
* g10.c (main): disable coredumps for gpg
* g10.c (MAINTAINER_OPTIONS): New to disable some options
Mon Jul 13 16:47:54 1998 Werner Koch (wk@isil.d.shuttle.de)
* plaintext.c (hash_datafiles): New arg for better support of
detached sigs. Changed all callers.
* mainproc.c (proc_signature_packets): Ditto.
* g10.c (main): New option "compress-sigs"
* sig.c (sign_file): detached signatures are not anymore compressed
unless the option --compress-sigs is used.
Thu Jul 9 19:54:54 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c: Fixes to allow zero length cleartext signatures
Thu Jul 9 14:52:47 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (build_list): Now drops setuid.
(main): Changed the way keyrings and algorithms are registered .
Wed Jul 8 14:17:30 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h (PKT_public_key): Add field keyid.
* parse-packet.c (parse_key): Reset the above field.
* keyid.c (keyid_from_pk): Use above field as cache.
* tdbio.c, tdbio.h: New
* trustdb.c: Moved some functions to tdbio.c.
(print_keyid): New.
* pkclist.c (check_signatures_trust): New.
Wed Jul 8 10:45:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* plaintext.c (special_md_putc): New.
(handle_plaintext): add clearsig argument
* mainproc.c (proc_plaintext): detection of clearsig
* sign.c (write_dased_escaped): Changed clearsig format
Tue Jul 7 18:56:19 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (find_header): Now makes sure that there is only one
empty line for clearsigs, as this is what OP now says.
Mon Jul 6 13:09:07 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): New option default-secret-key
* getkey.c (get_seckey_byname): support for this option.
Mon Jul 6 09:03:49 1998 Werner Koch (wk@isil.d.shuttle.de)
* getkey.c (add_keyring): Keyrings are now added to end of the
list of keyrings. The first added keyringwill be created.
(add_secret_keyring): Likewise.
* ringedit.c (add_keyblock_resource): Files are created here.
* g10.c (aNOP): Removed
* getkey.c (lookup): Add checking of usage for name lookups
* packet.h (pubkey_usage): Add a field which may be used to store
usage capabilities.
* pkclist.c (build_pk_list): getkey now called with usage arg.
* skclist.c (build_sk_list): Ditto.
* sign.c (clearsign_file): Fixed "Hash:" headers
Sat Jul 4 13:33:31 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (list_ownertrust): New.
* g10.c (aListOwnerTrust): New.
* g10.c (def_pubkey_algo): Removed.
* trustdb.c (verify_private_data): Removed and also the call to it.
(sign_private_data): Removed.
Fri Jul 3 13:26:10 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (aEditKey): was aEditSig. Changed usage msg.
* keyedit.c: Done some i18n stuff.
* g10.c (do_not_use_RSA): New.
* sign.c (do_sign): Add call to above function.
* encode.c (write_pubkey_enc_from_list): Ditto.
Thu Jul 2 21:01:25 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c: Now is able sto store data of unknown
algorithms.
* free-packet.c: Support for this.
* build-packet.c: Can write data of packet with unknown algos.
Thu Jul 2 11:46:36 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c (parse): fixed 4 byte length header
Wed Jul 1 12:36:55 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h (new_ctb): New field for some packets
* build-packet.c (build_packet): Support for new_ctb
* parse-packet.c (parse): Ditto.
Mon Jun 29 12:54:45 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h: changed all "_cert" to "_key", "subcert" to "subkey".
* free-packet.c (free_packet): Removed memory leak for subkeys.
Sun Jun 28 18:32:27 1998 Werner Koch (wk@isil.d.shuttle.de)
* import.c (import_keys): Renamed from import_pubkeys.
(import_secret_one): New.
* g10.c (aExportSecret): New.
* export.c (export_seckeys): New.
* parse-packet.c (parse_certificate): Cleaned up.
(parse_packet): Trust packets are now considered as unknown.
(parse_pubkey_warning): New.
Fri Jun 26 10:37:35 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (has_invalid_email_chars): New.
Wed Jun 24 16:40:22 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (armor_filter): Now creates valid onepass_sig packets
with all detected hash algorithms.
* mainproc.c (proc_plaintext): Now uses the hash algos as specified
in the onepass_sig packets (if there are any)
Mon Jun 22 11:54:08 1998 Werner Koch (wk@isil.d.shuttle.de)
* plaintext.c (handle_plaintext): add arg to disable outout
* mainproc.c (proc_plaintext): disable output when in sigs_only mode.
Thu Jun 18 13:17:27 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c: Removed all rsa packet stuff, chnaged defaults
for key generation.
Sun Jun 14 21:28:31 1998 Werner Koch (wk@isil.d.shuttle.de)
* misc.c (checksum_u16): Fixed a stupid bug which caused a
wrong checksum calculation for the secret key protection and
add a backward compatibility option.
* g10.c (main): Add option --emulate-checksum-bug.
Thu Jun 11 13:26:44 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h: Major changes to the structure of public key material
which is now stored in an array and not anaymore in a union of
algorithm specific structures. These is needed to make the system
more extendable and makes a lot of stuff much simpler. Changed
all over the system.
* dsa.c, rsa.c, elg.c: Removed.
Wed Jun 10 07:22:02 1998 Werner Koch,mobil,,, (wk@tobold)
* g10.c ("load-extension"): New option.
Mon Jun 8 22:23:37 1998 Werner Koch (wk@isil.d.shuttle.de)
* seckey-cert.c (do_check): Removed cipher constants
(protect_secret_key): Ditto.
Fri May 29 10:00:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (query_trust_info): New.
* keylist.c (list_one): Add output of trust info
* mainproc (list_node): ditto.
* g10.c (main): full trustdb init if -with-colons and any of the
key list modes.
Thu May 28 10:34:42 1998 Werner Koch (wk@isil.d.shuttle.de)
* status.c (STATUS_RSA_OR_IDEA): New.
* sig-check.c (check_signature): Output special status message.
* pubkey-enc.c (get_session_key): Ditto.
* mainproc.c (check_sig_and_print): Changed format of output.
* passpharse.c (passphrase_to_dek): Likewise.
Wed May 27 13:46:48 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (aListSecretKeys): New option --list-secret-keys
* keylist.c (std_key_list): Renamed to public_key_list.
(secret_key_list): New
(list_one, list_all): Add support for secret keys.
* getkey.c (get_secret_keyring): New.
* mainproc.c (list_node): Add option --with-colons for secret keys
* sig-check.c (check_key_signature): detection of selfsigs
* mainproc.c (list_node): fixed listing.
* g10.c (aListSecretKeys): New option --always-trust
* pkclist.c (do_we_trust): Override per option added
* status.c (write_status_text): Add a prefix to every output line.
Wed May 27 07:49:21 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10 (--compress-keys): New.
* options.h (compress_keys): New.
* export.c (export_pubkeys): Only compresses with the new option.
Tue May 26 11:24:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* passphrase.c (get_last_passphrase): New
(set_next_passphrase): New.
(passphrase_to_dek): add support for the above functions.
* keyedit.c (make_keysig_packet): Add sigclass 0x18,
changed all callers due to a new argument.
* keygen.c (write_keybinding): New
(generate_subkeypair): Add functionality
(ask_algo, ask_keysize, ask_valid_days): Broke out of generate_keypair
(ask_user_id, ask_passphrase): Ditto.
Thu May 21 11:26:13 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c,gpgd.c (main): Does now return an int, so that egcs does
not complain.
* armor.c (fake_packet): Removed erro message and add a noticed
that this part should be fixed.
* sign.c (sign_file): Compression now comes in front of encryption.
* encode.c (encode_simple): Ditto.
(encode_crypt): Ditto.
Tue May 19 16:18:19 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (fake_packet): Changed assertion to log_error
Sat May 16 16:02:06 1998 Werner Koch (wk@isil.d.shuttle.de)
* build-packet.c (build_packet): Add SUBKEY packets.
Fri May 15 17:57:23 1998 Werner Koch (wk@isil.d.shuttle.de)
* sign.c (hash_for): New and used in all places here.
* main.h (DEFAULT_): new macros.
* g10.c (opt.def_digest_algo): Now set to 0
* compress.c (init_compress): Add support for algo 1
* options.h (def_compress_algo): New
* g10.c (main): New option --compress-algo
Fri May 15 13:23:59 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (print_mds): New feature to print only one hash,
chnaged formatting.
Thu May 14 15:36:24 1998 Werner Koch (wk@isil.d.shuttle.de)
* misc.c (trap_unaligned) [__alpha__]: New
* g10.c (trap_unaligned): Add call to this to track down SIGBUS
on Alphas (to avoid the slow emulation code).
Wed May 13 11:48:27 1998 Werner Koch (wk@isil.d.shuttle.de)
* build-packet.c (do_signature): Support for v4 pakets.
* keyedit.c (make_keysig_packet): Ditto.
* build-packet.c (build_sig_subpkt_from_sig): New.
(build_sig_subpkt): New.
* elg.c (g10_elg_sign): removed keyid_from_skc.
* dsa.c (g10_dsa_sign): Ditto.
* rsa.c (g10_rsa_sign): Ditto.
* keyedit.c (make_keysig_packet): Add call to keyid_from_skc
* sign.c (clearsign_file): Support for v4 signatures.
(sign_file): Ditto.
Wed May 6 09:31:24 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c (do_parse): add support for 5 byte length leader.
(parse_subpkt): Ditto.
* build-packet.c (write_new_header): Ditto.
* packet.h (SIGSUBPKT_): New constants.
* parse-packet.c (parse_sig_subpkt): Changed name, made global,
and arg to return packet length, chnaged all callers
Tue May 5 22:11:59 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (gen_dsa): New.
* build_packet.c (do_secret_cert): Support for DSA
Mon May 4 19:01:25 1998 Werner Koch (wk@isil.d.shuttle.de)
* compress.c: doubled buffer sizes
* parse-packet.c (do_plaintext): now uses iobuf_read/write.
Mon May 4 09:35:53 1998 Werner Koch (wk@isil.d.shuttle.de)
* seskey.c (encode_md_value): Add optional argument hash_algo,
changed all callers.
* passphrase.c (make_dek_from_passphrase): Removed
* (get_passhrase_hash): Changed name to passphrase_to_dek, add arg,
changed all callers.
* all: Introduced the new ELG identifier and added support for the
encryption only one (which is okay to use by GNUPG for signatures).
Sun May 3 17:50:26 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h (PKT_OLD_COMMENT): New name for type 16.
* parse-packet.c (parse_comment): Now uses type 61
Fri May 1 12:44:39 1998 Werner Koch,mobil,,, (wk@tobold)
* packet.h (count): Chnaged s2k count from byte to u32.
* seckey-cert.c (do_check): Changed s2k algo 3 to 4, changed
reading of count.
* build-packet.c (do_secret_cert): ditto.
* parse-packet.c (parse_certificate): ditto.
* parse-packet.c (parse_symkeyenc): New.
* build-packet.c (do_symkey_enc): New.
Thu Apr 30 16:33:34 1998 Werner Koch (wk@isil.d.shuttle.de)
* sign.c (clearsign_file): Fixed "Hash: " armor line.
Tue Apr 28 14:27:42 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c (parse_subpkt): Some new types.
Mon Apr 27 12:53:59 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Add option --skip-verify.
* mainproc.c (check_sig_and_print): Ditto.
* g10.c (print_mds): Add output for Tiger.
* sign.c (sign_file): Now uses partial length headers if used
in canonical textmode (kludge to fix a bug).
* parse-packet.c (parse_certificate): Changed BLOWFISH id.
* pubkey-enc.c (get_session_key): Ditto.
* seskey.c (make_session_key): Ditto.
* seckey-cert.c (protect_secret_key,do_check): Add BLOWFISH160.
Fri Apr 24 17:38:48 1998 Werner Koch,mobil,,, (wk@tobold)
* sig-check.c (check_key_signature): Add sig-class 0x14..0x17
* keyedit.c (sign-key): Some changes to start with support of
the above new sig-classes.
Wed Apr 22 09:01:57 1998 Werner Koch,mobil,,, (wk@tobold)
* getkey.c (compare_name): add email matching
Tue Apr 21 16:17:12 1998 Werner Koch,mobil,,, (wk@tobold)
* armor.c (armor_filter): fixed missing last LF before CSUM.
Thu Apr 9 11:35:22 1998 Werner Koch (wk@isil.d.shuttle.de)
* seckey-cert.c (do_check): New; combines all the check functions
into one.
* sign.c: removed all key management functions
* keyedit.c: New.
Thu Apr 9 09:49:36 1998 Werner Koch (wk@isil.d.shuttle.de)
* import.c (chk_self_sigs): Changed an error message.
Wed Apr 8 16:19:39 1998 Werner Koch (wk@isil.d.shuttle.de)
* packet.h: packet structs now uses structs from the pubkey,
removed all copy operations from packet to pubkey structs.
Wed Apr 8 13:40:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (verify_own_certs): Fixed "public key not found".
* getkey.c (key_byname): New, combines public and secret key search.
* pkclist.c (build_pkc_list): Add new arg usage, changed all callers.
* skclist.c (build_skc_list): Likewise.
* ringedit.c (find_keyblock, keyring_search2): Removed.
Wed Apr 8 09:47:21 1998 Werner Koch (wk@isil.d.shuttle.de)
* sig-check.c (do_check): Applied small fix from Ulf Möller.
Tue Apr 7 19:28:07 1998 Werner Koch (wk@isil.d.shuttle.de)
* cipher.c, encr-data.c, seckey-cert.c: Now uses cipher_xxxx
functions instead of blowfish_xxx or cast_xxx
Tue Apr 7 11:04:02 1998 Werner Koch (wk@isil.d.shuttle.de)
* Makefile.am (g10maint.o): Changed the way it is created.
Mon Apr 6 11:17:08 1998 Werner Koch (wk@isil.d.shuttle.de)
* misc.c: New.
* keygen.c (checksum,checksum_u16,checksum_mpi): Moved to misc.c
* seckey-cert.c: Kludge for wrong ELG checksum implementation.
Sat Apr 4 20:07:01 1998 Werner Koch (wk@isil.d.shuttle.de)
* cipher.c (cipher_filter): Support for CAST5
* encr-data.c (decode_filter): Ditto.
(decrypt_data): Ditto.
* seskey.c (make_session_key): Ditto.
* seckey-cert.c (check_elg, check_dsa): Ditto,
(protect_secret_key): Ditto.
* pubkey-enc.c (get_session_key): Ditto.
* passphrase.c (hash_passphrase): Ditto.
Thu Apr 2 20:22:35 1998 Werner Koch (wk@isil.d.shuttle.de)
* gpgd.c: New
Thu Apr 2 10:38:16 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (generate_keypair): Add valid_days stuff.
* trustdb.c (check_trust): Add check for valid_days.
Wed Apr 1 16:15:58 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (generate_keypair): Addional question whether the
selected large keysize is really needed.
Wed Apr 1 15:56:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* seckey-cert.c (protect_secret_key): merged protect_xxx to here.
Wed Apr 1 10:34:46 1998 Werner Koch (wk@isil.d.shuttle.de)
* Makefile.am (g10maint.c): Changed creation rule, so that it works
on FreeBSD (missing CFLAGS).
* parse-packet.c (parse_subkey): Removed.
Thu Mar 19 15:22:36 1998 Werner Koch (wk@isil.d.shuttle.de)
* ringedit.c (keyring_enum): Fixed problem with reading too
many packets. Add support to read secret keyrings.
* getkey.c (scan_keyring): Removed
(lookup): New to replace scan_keyring.
(scan_secret_keyring): Removed.
(lookup_skc): New.
Wed Mar 18 11:47:34 1998 Werner Koch (wk@isil.d.shuttle.de)
* ringedit.c (enum_keyblocks): New read mode 11.
* keyid.c (elg_fingerprint_md): New and changed all other functions
to call this if the packet version is 4 or above.
Tue Mar 17 20:46:16 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c (parse_certificate): Add listing support for subkeys.
Tue Mar 17 20:32:22 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (is_armored): Allow marker packet.
Thu Mar 12 13:36:49 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (check_trust): Checks timestamp of pubkey.
* sig-check. (do_check): Compares timestamps.
Tue Mar 10 17:01:56 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Add call to init_signals.
* signal.c: New.
Mon Mar 9 12:43:42 1998 Werner Koch (wk@isil.d.shuttle.de)
* dsa.c: New
* packet.h, free-packet.c, parse-packet.c : Add support for DSA
* sig-check.c, getkey.c, keyid.c, ringedit.c: Ditto.
* seckey-cert.c: Ditto.
* packet.h : Moved .digest_algo of signature packets to outer
structure. Changed all references
Sun Mar 8 13:06:42 1998 Werner Koch (wk@isil.d.shuttle.de)
* openfile.c : Support for stdout filename "-".
* mainproc.c (check_sig_and_print): Enhanced status output:
* status.c (write_status_text): New.
Fri Mar 6 16:10:54 1998 Werner Koch (wk@isil.d.shuttle.de)
* kbnode.c (clone_kbnode): Fixed private_flag.
* mainproc.c (list_node): Output of string "Revoked" as user-id.
Fri Mar 6 14:26:39 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Add userids to "-kv" and cleaned up this stuff.
Fri Mar 6 12:45:58 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Changed semantics of the list-... commands
and added a new one. Removed option "-d"
* decrypt.c: New.
* trustdb.c (init_trustdb): Autocreate directory only if it ends
in "/.gnupg".
Thu Mar 5 12:12:11 1998 Werner Koch (wk@isil.d.shuttle.de)
* mainproc.c (do_proc_packets): New. Common part of proc_packet.
(proc_signature_packets): special version to handle signature data.
* verify.c: New.
* g10.c (aVerify): New.
* plaintext.c (hash_datafiles): New.
* compress.c (handle_compressed): Add callback arg, changed caller.
Thu Mar 5 10:20:06 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c: Is nom the common source for gpg and gpgm
* g10maint.c: Removed
* Makefile.am: Add rule to build g10maint.c
Thu Mar 5 08:43:59 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Changed the way clear text sigs are faked.
Wed Mar 4 19:47:37 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10maint.c (aMuttKeyList): New
* keylist.c: New.
Wed Mar 4 17:20:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* getkey.c (get_pubkey_byname): Kludge to allow 0x prefix.
Tue Mar 3 13:46:55 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10maint.c (main): New option --gen-random.
Tue Mar 3 09:50:08 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (aDeleteSecretKey): New.
(aEditSig): Add option "--edit-key" as synonym for "--edit-sig".
(aDeleteSecretKey): New.
* getkey.c (seckey_available): New.
* sign.c (delete_key): Enhanced to delete secret keys, changed all
callers.
Mon Mar 2 21:23:48 1998 Werner Koch (wk@isil.d.shuttle.de)
* pkc_list.c (build_pkc_list): Add interactive input of user ID.
Mon Mar 2 20:54:05 1998 Werner Koch (wk@isil.d.shuttle.de)
* pkclist.c (do_we_trust_pre): New.
(add_ownertrust): Add message.
* trustdb.c (enum_trust_web): Quick fix.
Mon Mar 2 13:50:53 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): New action aDeleteKey
* sign.c (delete_key): New.
Sun Mar 1 16:38:58 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (do_check): No returns TRUST_UNDEFINED instead of
eof error.
Fri Feb 27 18:14:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (find_header): Removed trailing CR on headers.
Fri Feb 27 18:02:48 1998 Werner Koch (wk@isil.d.shuttle.de)
* ringedit.c (keyring_search) [MINGW32]: Open and close file here
because rename does not work on open files. Chnaged callers.
Fri Feb 27 16:43:11 1998 Werner Koch (wk@isil.d.shuttle.de)
* sig-check.c (do_check): Add an md_enable.
* mainproc.c (do_check_sig): Use md_open in case of detached sig
(proc_tree): Take detached sigs into account.
Fri Feb 27 15:22:46 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): Make use of GNUPGHOME envvar.
* g10main.c (main): Ditto.
Wed Feb 25 11:40:04 1998 Werner Koch (wk@isil.d.shuttle.de)
* plaintext.c (ask_for_detached_datafile): add opt.verbose to
info output.
* openfile.c (open_sigfile): Try also name ending in ".asc"
Wed Feb 25 08:41:00 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (generate_keypair): Fixed memory overflow.
Tue Feb 24 15:51:55 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c (parse_certificate): Support for S2K.
* build-packet.c (do_secret_cert): Ditto.
* keygen.c (gen_elg): Ditto.
* seckey-cert.c (check_elg): Ditto
(protect_elg): Ditto.
* sign.c (chnage_passphrase): Ditto.
* passphrase.c (get_passphrase_hash): Support for a salt and
changed all callers.
(make_dek_from_passphrase): Ditto.
Tue Feb 24 12:30:56 1998 Werner Koch (wk@isil.d.shuttle.de)
* build-packet.c (hash_public_cert): Disabled debug output.
Fri Feb 20 17:22:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (init_trustdb) [MINGW32]: Removed 2nd mkdir arg.
(keyring_copy) [MINGW32]: Add a remove prior to the renames.
Wed Feb 18 18:39:02 1998 Werner Koch (wk@isil.d.shuttle.de)
* Makefile.am (OMIT_DEPENDENCIES): New.
* rsa.c: Replaced log_bug by BUG.
Wed Feb 18 13:35:58 1998 Werner Koch (wk@isil.d.shuttle.de)
* mainproc.c (do_check_sig): Now uses hash_public_cert.
* parse-packet.c (parse_certificate): Removed hashing.
* packet.h (public_cert): Removed hash variable.
* free-packet.c (copy_public_cert, free_public_cert): Likewise.
* sig-check.c (check_key_signatures): Changed semantics.
Wed Feb 18 12:11:28 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (do_check): Add handling for revocation certificates.
(build_sigrecs): Ditto.
(check_sigs): Ditto.
Wed Feb 18 09:31:04 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (armor_filter): Add afx->hdrlines.
* revoke.c (gen_revoke): Add comment line.
* dearmor.c (enarmor_file): Ditto.
* sig-check.c (check_key_signature): Add handling for class 0x20.
* mainproc.c : Ditto.
Tue Feb 17 21:24:17 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c : Add header lines "...ARMORED FILE .."
* dearmor.c (enarmor_file): New.
* g10maint.c (main): New option "--enarmor"
Tue Feb 17 19:03:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* mainproc.c : Changed a lot, because the packets are now stored
a simple linlked list and not anymore in a complicatd tree structure.
Tue Feb 17 10:14:48 1998 Werner Koch (wk@isil.d.shuttle.de)
* free_packet.c (cmp_public_certs): New.
(cmp_user_ids): New.
* kbnode.c (clone_kbnode): New.
(release_kbnode): Add clone support.
* ringedit.c (find_keyblock_bypkc): New.
* sign.c (remove_keysigs): Self signatures are now skipped,
changed arguments and all callers.
* import.c : Add functionality.
Tue Feb 17 09:31:40 1998 Werner Koch (wk@isil.d.shuttle.de)
* options.h (homedir): New option.
* g10.c, g10maint.c, getkey.c, keygen.c, trustdb.c (opt.homedir): New.
* trustdb.c (init_trustdb): mkdir for hoem directory
(sign_private_data): Renamed "sig" to "g10.sig"
Mon Feb 16 20:02:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* kbnode.c (commit_kbnode): New.
(delete_kbnode): removed unused first arg. Changed all Callers.
* ringedit.c (keyblock_resource_name): New.
(get_keyblock_handle): NULL for filename returns default resource.
Mon Feb 16 19:38:48 1998 Werner Koch (wk@isil.d.shuttle.de)
* sig-check.s (check_key_signature): Now uses the supplied
public key to check the signature and not any more the one
from the getkey.c
(do_check): New.
(check_signature): Most work moved to do_check.
Mon Feb 16 14:48:57 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (find_header): Fixed another bug.
Mon Feb 16 12:18:34 1998 Werner Koch (wk@isil.d.shuttle.de)
* getkey.c (scan_keyring): Add handling of compressed keyrings.
Mon Feb 16 10:44:51 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c, g10maint.c (strusage): Rewrote.
(build_list): New
Mon Feb 16 08:58:41 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (use_armor): New.
Sat Feb 14 14:30:57 1998 Werner Koch (wk@isil.d.shuttle.de)
* mainproc.c (proc_tree): Sigclass fix.
Sat Feb 14 14:16:33 1998 Werner Koch (wk@isil.d.shuttle.de)
* armor.c (armor_filter): Changed version and comment string.
* encode.c, sign.c, keygen.c: Changed all comment packet strings.
Sat Feb 14 12:39:24 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (aGenRevoke): New command.
* revoke.c: New.
* sign.c (make_keysig_packet): Add support for sigclass 0x20.
Fri Feb 13 20:18:14 1998 Werner Koch (wk@isil.d.shuttle.de)
* ringedit.c (enum_keyblocks, keyring_enum): New.
Fri Feb 13 19:33:40 1998 Werner Koch (wk@isil.d.shuttle.de)
* export.c: Add functionality.
* keygen.c (generate_keypair): Moved the leading comment behind the
key packet.
* kbnode.c (walk_kbnode): Fixed.
* g10.c (main): listing armored keys now work.
Fri Feb 13 16:17:43 1998 Werner Koch (wk@isil.d.shuttle.de)
* parse-packet.c (parse_publickey, parse_signature): Fixed calls
to mpi_read used for ELG b.
Fri Feb 13 15:13:23 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): changed formatting of help output.
Thu Feb 12 22:24:42 1998 Werner Koch (wk@frodo)
* pubkey-enc.c (get_session_key): rewritten
Copyright 1998,1999,2000,2001,2002,2003,2004,2005,
2006,2007,2008,2009 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
modifications, as long as this notice is preserved.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/g10/card-util.c b/g10/card-util.c
index 7d36ebf9c..e12e4a7a1 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -1,1748 +1,1749 @@
/* card-util.c - Utility functions for the OpenPGP card.
* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GnuPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#if GNUPG_MAJOR_VERSION != 1
# include "gpg.h"
#endif /*GNUPG_MAJOR_VERSION != 1*/
#include "util.h"
#include "i18n.h"
#include "ttyio.h"
#include "status.h"
#include "options.h"
#include "main.h"
#include "keyserver-internal.h"
#if GNUPG_MAJOR_VERSION == 1
# ifdef HAVE_LIBREADLINE
# define GNUPG_LIBREADLINE_H_INCLUDED
# include <stdio.h>
# include <readline/readline.h>
# endif /*HAVE_LIBREADLINE*/
# include "cardglue.h"
#else /*GNUPG_MAJOR_VERSION!=1*/
# include "call-agent.h"
#endif /*GNUPG_MAJOR_VERSION!=1*/
#define CONTROL_D ('D' - 'A' + 1)
/* Change the PIN of a an OpenPGP card. This is an interactive
function. */
void
change_pin (int unblock_v2, int allow_admin)
{
struct agent_card_info_s info;
int rc;
rc = agent_learn (&info);
if (rc)
{
log_error (_("OpenPGP card not available: %s\n"),
gpg_strerror (rc));
return;
}
log_info (_("OpenPGP card no. %s detected\n"),
info.serialno? info.serialno : "[none]");
agent_clear_pin_cache (info.serialno);
if (opt.batch)
{
agent_release_card_info (&info);
log_error (_("can't do this in batch mode\n"));
return;
}
if (unblock_v2)
{
if (!info.is_v2)
log_error (_("This command is only available for version 2 cards\n"));
else if (!info.chvretry[1])
log_error (_("Reset Code not or not anymore available\n"));
else
{
rc = agent_scd_change_pin (2, info.serialno);
if (rc)
tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc));
else
{
write_status (STATUS_SC_OP_SUCCESS);
tty_printf ("PIN changed.\n");
}
}
}
else if (!allow_admin)
{
rc = agent_scd_change_pin (1, info.serialno);
if (rc)
tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc));
else
{
write_status (STATUS_SC_OP_SUCCESS);
tty_printf ("PIN changed.\n");
}
}
else
for (;;)
{
char *answer;
tty_printf ("\n");
tty_printf ("1 - change PIN\n"
"2 - unblock PIN\n"
"3 - change Admin PIN\n"
"4 - set the Reset Code\n"
"Q - quit\n");
tty_printf ("\n");
answer = cpr_get("cardutil.change_pin.menu",_("Your selection? "));
cpr_kill_prompt();
if (strlen (answer) != 1)
continue;
rc = 0;
if (*answer == '1')
{
/* Change PIN. */
rc = agent_scd_change_pin (1, info.serialno);
if (rc)
tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc));
else
{
write_status (STATUS_SC_OP_SUCCESS);
tty_printf ("PIN changed.\n");
}
}
else if (*answer == '2')
{
/* Unblock PIN. */
rc = agent_scd_change_pin (101, info.serialno);
if (rc)
tty_printf ("Error unblocking the PIN: %s\n", gpg_strerror (rc));
else
{
write_status (STATUS_SC_OP_SUCCESS);
tty_printf ("PIN unblocked and new PIN set.\n");
}
}
else if (*answer == '3')
{
/* Change Admin PIN. */
rc = agent_scd_change_pin (3, info.serialno);
if (rc)
tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc));
else
{
write_status (STATUS_SC_OP_SUCCESS);
tty_printf ("PIN changed.\n");
}
}
else if (*answer == '4')
{
/* Set a new Reset Code. */
rc = agent_scd_change_pin (102, info.serialno);
if (rc)
tty_printf ("Error setting the Reset Code: %s\n",
gpg_strerror (rc));
else
{
write_status (STATUS_SC_OP_SUCCESS);
tty_printf ("Reset Code set.\n");
}
}
else if (*answer == 'q' || *answer == 'Q')
{
break;
}
}
agent_release_card_info (&info);
}
static const char *
get_manufacturer (unsigned int no)
{
/* Note: Make sure that there is no colon or linefeed in the string. */
switch (no)
{
case 0x0001: return "PPC Card Systems";
case 0x0002: return "Prism";
case 0x0003: return "OpenFortress";
case 0x0004: return "Wewid AB";
+ case 0x0005: return "ZeitControl";
/* 0x00000 and 0xFFFF are defined as test cards per spec,
0xFFF00 to 0xFFFE are assigned for use with randomly created
serial numbers. */
case 0x0000:
case 0xffff: return "test card";
default: return (no & 0xff00) == 0xff00? "unmanaged S/N range":"unknown";
}
}
static void
print_sha1_fpr (FILE *fp, const unsigned char *fpr)
{
int i;
if (fpr)
{
for (i=0; i < 20 ; i+=2, fpr += 2 )
{
if (i == 10 )
tty_fprintf (fp, " ");
tty_fprintf (fp, " %02X%02X", *fpr, fpr[1]);
}
}
else
tty_fprintf (fp, " [none]");
tty_fprintf (fp, "\n");
}
static void
print_sha1_fpr_colon (FILE *fp, const unsigned char *fpr)
{
int i;
if (fpr)
{
for (i=0; i < 20 ; i++, fpr++)
fprintf (fp, "%02X", *fpr);
}
putc (':', fp);
}
static void
print_name (FILE *fp, const char *text, const char *name)
{
tty_fprintf (fp, "%s", text);
/* FIXME: tty_printf_utf8_string2 eats everything after and
including an @ - e.g. when printing an url. */
if (name && *name)
{
if (fp)
print_utf8_string2 (fp, name, strlen (name), '\n');
else
tty_print_utf8_string2 (name, strlen (name), 0);
}
else
tty_fprintf (fp, _("[not set]"));
tty_fprintf (fp, "\n");
}
static void
print_isoname (FILE *fp, const char *text, const char *tag, const char *name)
{
if (opt.with_colons)
fprintf (fp, "%s:", tag);
else
tty_fprintf (fp, "%s", text);
if (name && *name)
{
char *p, *given, *buf = xstrdup (name);
given = strstr (buf, "<<");
for (p=buf; *p; p++)
if (*p == '<')
*p = ' ';
if (given && given[2])
{
*given = 0;
given += 2;
if (opt.with_colons)
print_string (fp, given, strlen (given), ':');
else if (fp)
print_utf8_string2 (fp, given, strlen (given), '\n');
else
tty_print_utf8_string2 (given, strlen (given), 0);
if (opt.with_colons)
putc (':', fp);
else if (*buf)
tty_fprintf (fp, " ");
}
if (opt.with_colons)
print_string (fp, buf, strlen (buf), ':');
else if (fp)
print_utf8_string2 (fp, buf, strlen (buf), '\n');
else
tty_print_utf8_string2 (buf, strlen (buf), 0);
xfree (buf);
}
else
{
if (opt.with_colons)
putc (':', fp);
else
tty_fprintf (fp, _("[not set]"));
}
if (opt.with_colons)
fputs (":\n", fp);
else
tty_fprintf (fp, "\n");
}
/* Return true if the SHA1 fingerprint FPR consists only of zeroes. */
static int
fpr_is_zero (const char *fpr)
{
int i;
for (i=0; i < 20 && !fpr[i]; i++)
;
return (i == 20);
}
/* Return true if the SHA1 fingerprint FPR consists only of 0xFF. */
static int
fpr_is_ff (const char *fpr)
{
int i;
for (i=0; i < 20 && fpr[i] == '\xff'; i++)
;
return (i == 20);
}
/* Print all available information about the current card. */
void
card_status (FILE *fp, char *serialno, size_t serialnobuflen)
{
struct agent_card_info_s info;
PKT_public_key *pk = xcalloc (1, sizeof *pk);
int rc;
unsigned int uval;
const unsigned char *thefpr;
int i;
if (serialno && serialnobuflen)
*serialno = 0;
rc = agent_learn (&info);
if (rc)
{
if (opt.with_colons)
fputs ("AID:::\n", fp);
log_error (_("OpenPGP card not available: %s\n"),
gpg_strerror (rc));
xfree (pk);
return;
}
if (opt.with_colons)
fprintf (fp, "AID:%s:", info.serialno? info.serialno : "");
else
tty_fprintf (fp, "Application ID ...: %s\n",
info.serialno? info.serialno : "[none]");
if (!info.serialno || strncmp (info.serialno, "D27600012401", 12)
|| strlen (info.serialno) != 32 )
{
if (info.apptype && !strcmp (info.apptype, "NKS"))
{
if (opt.with_colons)
fputs ("netkey-card:\n", fp);
log_info ("this is a NetKey card\n");
}
else if (info.apptype && !strcmp (info.apptype, "DINSIG"))
{
if (opt.with_colons)
fputs ("dinsig-card:\n", fp);
log_info ("this is a DINSIG compliant card\n");
}
else if (info.apptype && !strcmp (info.apptype, "P15"))
{
if (opt.with_colons)
fputs ("pkcs15-card:\n", fp);
log_info ("this is a PKCS#15 compliant card\n");
}
else if (info.apptype && !strcmp (info.apptype, "GELDKARTE"))
{
if (opt.with_colons)
fputs ("geldkarte-card:\n", fp);
log_info ("this is a Geldkarte compliant card\n");
}
else
{
if (opt.with_colons)
fputs ("unknown:\n", fp);
}
log_info ("not an OpenPGP card\n");
agent_release_card_info (&info);
xfree (pk);
return;
}
if (!serialno)
;
else if (strlen (serialno)+1 > serialnobuflen)
log_error ("serial number longer than expected\n");
else
strcpy (serialno, info.serialno);
if (opt.with_colons)
fputs ("openpgp-card:\n", fp);
if (opt.with_colons)
{
fprintf (fp, "version:%.4s:\n", info.serialno+12);
uval = xtoi_2(info.serialno+16)*256 + xtoi_2 (info.serialno+18);
fprintf (fp, "vendor:%04x:%s:\n", uval, get_manufacturer (uval));
fprintf (fp, "serial:%.8s:\n", info.serialno+20);
print_isoname (fp, "Name of cardholder: ", "name", info.disp_name);
fputs ("lang:", fp);
if (info.disp_lang)
print_string (fp, info.disp_lang, strlen (info.disp_lang), ':');
fputs (":\n", fp);
fprintf (fp, "sex:%c:\n", (info.disp_sex == 1? 'm':
info.disp_sex == 2? 'f' : 'u'));
fputs ("url:", fp);
if (info.pubkey_url)
print_string (fp, info.pubkey_url, strlen (info.pubkey_url), ':');
fputs (":\n", fp);
fputs ("login:", fp);
if (info.login_data)
print_string (fp, info.login_data, strlen (info.login_data), ':');
fputs (":\n", fp);
fprintf (fp, "forcepin:%d:::\n", !info.chv1_cached);
for (i=0; i < DIM (info.key_attr); i++)
if (info.key_attr[0].algo)
fprintf (fp, "keyattr:%d:%d:%u:\n", i+1,
info.key_attr[i].algo, info.key_attr[i].nbits);
fprintf (fp, "maxpinlen:%d:%d:%d:\n",
info.chvmaxlen[0], info.chvmaxlen[1], info.chvmaxlen[2]);
fprintf (fp, "pinretry:%d:%d:%d:\n",
info.chvretry[0], info.chvretry[1], info.chvretry[2]);
fprintf (fp, "sigcount:%lu:::\n", info.sig_counter);
for (i=0; i < 4; i++)
{
if (info.private_do[i])
{
fprintf (fp, "private_do:%d:", i+1);
print_string (fp, info.private_do[i],
strlen (info.private_do[i]), ':');
fputs (":\n", fp);
}
}
fputs ("cafpr:", fp);
print_sha1_fpr_colon (fp, info.cafpr1valid? info.cafpr1:NULL);
print_sha1_fpr_colon (fp, info.cafpr2valid? info.cafpr2:NULL);
print_sha1_fpr_colon (fp, info.cafpr3valid? info.cafpr3:NULL);
putc ('\n', fp);
fputs ("fpr:", fp);
print_sha1_fpr_colon (fp, info.fpr1valid? info.fpr1:NULL);
print_sha1_fpr_colon (fp, info.fpr2valid? info.fpr2:NULL);
print_sha1_fpr_colon (fp, info.fpr3valid? info.fpr3:NULL);
putc ('\n', fp);
fprintf (fp, "fprtime:%lu:%lu:%lu:\n",
(unsigned long)info.fpr1time, (unsigned long)info.fpr2time,
(unsigned long)info.fpr3time);
}
else
{
tty_fprintf (fp, "Version ..........: %.1s%c.%.1s%c\n",
info.serialno[12] == '0'?"":info.serialno+12,
info.serialno[13],
info.serialno[14] == '0'?"":info.serialno+14,
info.serialno[15]);
tty_fprintf (fp, "Manufacturer .....: %s\n",
get_manufacturer (xtoi_2(info.serialno+16)*256
+ xtoi_2 (info.serialno+18)));
tty_fprintf (fp, "Serial number ....: %.8s\n", info.serialno+20);
print_isoname (fp, "Name of cardholder: ", "name", info.disp_name);
print_name (fp, "Language prefs ...: ", info.disp_lang);
tty_fprintf (fp, "Sex ..............: %s\n",
info.disp_sex == 1? _("male"):
info.disp_sex == 2? _("female") : _("unspecified"));
print_name (fp, "URL of public key : ", info.pubkey_url);
print_name (fp, "Login data .......: ", info.login_data);
if (info.private_do[0])
print_name (fp, "Private DO 1 .....: ", info.private_do[0]);
if (info.private_do[1])
print_name (fp, "Private DO 2 .....: ", info.private_do[1]);
if (info.private_do[2])
print_name (fp, "Private DO 3 .....: ", info.private_do[2]);
if (info.private_do[3])
print_name (fp, "Private DO 4 .....: ", info.private_do[3]);
if (info.cafpr1valid)
{
tty_fprintf (fp, "CA fingerprint %d .:", 1);
print_sha1_fpr (fp, info.cafpr1);
}
if (info.cafpr2valid)
{
tty_fprintf (fp, "CA fingerprint %d .:", 2);
print_sha1_fpr (fp, info.cafpr2);
}
if (info.cafpr3valid)
{
tty_fprintf (fp, "CA fingerprint %d .:", 3);
print_sha1_fpr (fp, info.cafpr3);
}
tty_fprintf (fp, "Signature PIN ....: %s\n",
info.chv1_cached? _("not forced"): _("forced"));
if (info.key_attr[0].algo)
{
tty_fprintf (fp, "Key attributes ...:");
for (i=0; i < DIM (info.key_attr); i++)
tty_fprintf (fp, " %u%c",
info.key_attr[i].nbits,
info.key_attr[i].algo == 1? 'R':
info.key_attr[i].algo == 17? 'D': '?');
tty_fprintf (fp, "\n");
}
tty_fprintf (fp, "Max. PIN lengths .: %d %d %d\n",
info.chvmaxlen[0], info.chvmaxlen[1], info.chvmaxlen[2]);
tty_fprintf (fp, "PIN retry counter : %d %d %d\n",
info.chvretry[0], info.chvretry[1], info.chvretry[2]);
tty_fprintf (fp, "Signature counter : %lu\n", info.sig_counter);
tty_fprintf (fp, "Signature key ....:");
print_sha1_fpr (fp, info.fpr1valid? info.fpr1:NULL);
if (info.fpr1valid && info.fpr1time)
tty_fprintf (fp, " created ....: %s\n",
isotimestamp (info.fpr1time));
tty_fprintf (fp, "Encryption key....:");
print_sha1_fpr (fp, info.fpr2valid? info.fpr2:NULL);
if (info.fpr2valid && info.fpr2time)
tty_fprintf (fp, " created ....: %s\n",
isotimestamp (info.fpr2time));
tty_fprintf (fp, "Authentication key:");
print_sha1_fpr (fp, info.fpr3valid? info.fpr3:NULL);
if (info.fpr3valid && info.fpr3time)
tty_fprintf (fp, " created ....: %s\n",
isotimestamp (info.fpr3time));
tty_fprintf (fp, "General key info..: ");
thefpr = (info.fpr1valid? info.fpr1 : info.fpr2valid? info.fpr2 :
info.fpr3valid? info.fpr3 : NULL);
/* If the fingerprint is all 0xff, the key has no asssociated
OpenPGP certificate. */
if ( thefpr && !fpr_is_ff (thefpr)
&& !get_pubkey_byfprint (pk, thefpr, 20))
{
KBNODE keyblock = NULL;
print_pubkey_info (fp, pk);
if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) )
print_card_key_info (fp, keyblock);
else if ( !get_keyblock_byfprint (&keyblock, thefpr, 20) )
{
release_kbnode (keyblock);
keyblock = NULL;
if (!auto_create_card_key_stub (info.serialno,
info.fpr1valid? info.fpr1:NULL,
info.fpr2valid? info.fpr2:NULL,
info.fpr3valid? info.fpr3:NULL))
{
if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) )
print_card_key_info (fp, keyblock);
}
}
release_kbnode (keyblock);
}
else
tty_fprintf (fp, "[none]\n");
}
free_public_key (pk);
agent_release_card_info (&info);
}
static char *
get_one_name (const char *prompt1, const char *prompt2)
{
char *name;
int i;
for (;;)
{
name = cpr_get (prompt1, prompt2);
if (!name)
return NULL;
trim_spaces (name);
cpr_kill_prompt ();
for (i=0; name[i] && name[i] >= ' ' && name[i] <= 126; i++)
;
/* The name must be in Latin-1 and not UTF-8 - lacking the code
to ensure this we restrict it to ASCII. */
if (name[i])
tty_printf (_("Error: Only plain ASCII is currently allowed.\n"));
else if (strchr (name, '<'))
tty_printf (_("Error: The \"<\" character may not be used.\n"));
else if (strstr (name, " "))
tty_printf (_("Error: Double spaces are not allowed.\n"));
else
return name;
xfree (name);
}
}
static int
change_name (void)
{
char *surname = NULL, *givenname = NULL;
char *isoname, *p;
int rc;
surname = get_one_name ("keygen.smartcard.surname",
_("Cardholder's surname: "));
givenname = get_one_name ("keygen.smartcard.givenname",
_("Cardholder's given name: "));
if (!surname || !givenname || (!*surname && !*givenname))
{
xfree (surname);
xfree (givenname);
return -1; /*canceled*/
}
isoname = xmalloc ( strlen (surname) + 2 + strlen (givenname) + 1);
strcpy (stpcpy (stpcpy (isoname, surname), "<<"), givenname);
xfree (surname);
xfree (givenname);
for (p=isoname; *p; p++)
if (*p == ' ')
*p = '<';
if (strlen (isoname) > 39 )
{
tty_printf (_("Error: Combined name too long "
"(limit is %d characters).\n"), 39);
xfree (isoname);
return -1;
}
rc = agent_scd_setattr ("DISP-NAME", isoname, strlen (isoname), NULL );
if (rc)
log_error ("error setting Name: %s\n", gpg_strerror (rc));
xfree (isoname);
return rc;
}
static int
change_url (void)
{
char *url;
int rc;
url = cpr_get ("cardedit.change_url", _("URL to retrieve public key: "));
if (!url)
return -1;
trim_spaces (url);
cpr_kill_prompt ();
if (strlen (url) > 254 )
{
tty_printf (_("Error: URL too long "
"(limit is %d characters).\n"), 254);
xfree (url);
return -1;
}
rc = agent_scd_setattr ("PUBKEY-URL", url, strlen (url), NULL );
if (rc)
log_error ("error setting URL: %s\n", gpg_strerror (rc));
xfree (url);
return rc;
}
/* Fetch the key from the URL given on the card or try to get it from
the default keyserver. */
static int
fetch_url(void)
{
#if GNUPG_MAJOR_VERSION == 1
int rc;
struct agent_card_info_s info;
memset(&info,0,sizeof(info));
rc=agent_scd_getattr("PUBKEY-URL",&info);
if(rc)
log_error("error retrieving URL from card: %s\n",gpg_strerror(rc));
else
{
struct keyserver_spec *spec=NULL;
rc=agent_scd_getattr("KEY-FPR",&info);
if(rc)
log_error("error retrieving key fingerprint from card: %s\n",
gpg_strerror(rc));
else if (info.pubkey_url && *info.pubkey_url)
{
spec=parse_keyserver_uri(info.pubkey_url,1,NULL,0);
if(spec && info.fpr1valid)
{
/* This is not perfectly right. Currently, all card
fingerprints are 20 digits, but what about
fingerprints for a future v5 key? We should get the
length from somewhere lower in the code. In any
event, the fpr/keyid is not meaningful for straight
HTTP fetches, but using it allows the card to point
to HKP and LDAP servers as well. */
rc=keyserver_import_fprint(info.fpr1,20,spec);
free_keyserver_spec(spec);
}
}
else if (info.fpr1valid)
{
rc = keyserver_import_fprint (info.fpr1, 20, opt.keyserver);
}
}
return rc;
#else
return 0;
#endif
}
/* Read data from file FNAME up to MAXLEN characters. On error return
-1 and store NULl at R_BUFFER; on success return the number of
bytes read and store the address of a newly allocated buffer at
R_BUFFER. */
static int
get_data_from_file (const char *fname, size_t maxlen, char **r_buffer)
{
FILE *fp;
char *data;
int n;
*r_buffer = NULL;
fp = fopen (fname, "rb");
#if GNUPG_MAJOR_VERSION == 1
if (fp && is_secured_file (fileno (fp)))
{
fclose (fp);
fp = NULL;
errno = EPERM;
}
#endif
if (!fp)
{
tty_printf (_("can't open `%s': %s\n"), fname, strerror (errno));
return -1;
}
data = xtrymalloc (maxlen? maxlen:1);
if (!data)
{
tty_printf (_("error allocating enough memory: %s\n"), strerror (errno));
fclose (fp);
return -1;
}
if (maxlen)
n = fread (data, 1, maxlen, fp);
else
n = 0;
fclose (fp);
if (n < 0)
{
tty_printf (_("error reading `%s': %s\n"), fname, strerror (errno));
xfree (data);
return -1;
}
*r_buffer = data;
return n;
}
static int
change_login (const char *args)
{
char *data;
int n;
int rc;
if (args && *args == '<') /* Read it from a file */
{
for (args++; spacep (args); args++)
;
n = get_data_from_file (args, 254, &data);
if (n < 0)
return -1;
}
else
{
data = cpr_get ("cardedit.change_login",
_("Login data (account name): "));
if (!data)
return -1;
trim_spaces (data);
cpr_kill_prompt ();
n = strlen (data);
}
if (n > 254 )
{
tty_printf (_("Error: Login data too long "
"(limit is %d characters).\n"), 254);
xfree (data);
return -1;
}
rc = agent_scd_setattr ("LOGIN-DATA", data, n, NULL );
if (rc)
log_error ("error setting login data: %s\n", gpg_strerror (rc));
xfree (data);
return rc;
}
static int
change_private_do (const char *args, int nr)
{
char do_name[] = "PRIVATE-DO-X";
char *data;
int n;
int rc;
assert (nr >= 1 && nr <= 4);
do_name[11] = '0' + nr;
if (args && (args = strchr (args, '<'))) /* Read it from a file */
{
for (args++; spacep (args); args++)
;
n = get_data_from_file (args, 254, &data);
if (n < 0)
return -1;
}
else
{
data = cpr_get ("cardedit.change_private_do",
_("Private DO data: "));
if (!data)
return -1;
trim_spaces (data);
cpr_kill_prompt ();
n = strlen (data);
}
if (n > 254 )
{
tty_printf (_("Error: Private DO too long "
"(limit is %d characters).\n"), 254);
xfree (data);
return -1;
}
rc = agent_scd_setattr (do_name, data, n, NULL );
if (rc)
log_error ("error setting private DO: %s\n", gpg_strerror (rc));
xfree (data);
return rc;
}
static int
change_cert (const char *args)
{
char *data;
int n;
int rc;
if (args && *args == '<') /* Read it from a file */
{
for (args++; spacep (args); args++)
;
n = get_data_from_file (args, 16384, &data);
if (n < 0)
return -1;
}
else
{
tty_printf ("usage error: redirectrion to file required\n");
return -1;
}
rc = agent_scd_writecert ("OPENPGP.3", data, n);
if (rc)
log_error ("error writing certificate to card: %s\n", gpg_strerror (rc));
xfree (data);
return rc;
}
static int
change_lang (void)
{
char *data, *p;
int rc;
data = cpr_get ("cardedit.change_lang",
_("Language preferences: "));
if (!data)
return -1;
trim_spaces (data);
cpr_kill_prompt ();
if (strlen (data) > 8 || (strlen (data) & 1))
{
tty_printf (_("Error: invalid length of preference string.\n"));
xfree (data);
return -1;
}
for (p=data; *p && *p >= 'a' && *p <= 'z'; p++)
;
if (*p)
{
tty_printf (_("Error: invalid characters in preference string.\n"));
xfree (data);
return -1;
}
rc = agent_scd_setattr ("DISP-LANG", data, strlen (data), NULL );
if (rc)
log_error ("error setting lang: %s\n", gpg_strerror (rc));
xfree (data);
return rc;
}
static int
change_sex (void)
{
char *data;
const char *str;
int rc;
data = cpr_get ("cardedit.change_sex",
_("Sex ((M)ale, (F)emale or space): "));
if (!data)
return -1;
trim_spaces (data);
cpr_kill_prompt ();
if (!*data)
str = "9";
else if ((*data == 'M' || *data == 'm') && !data[1])
str = "1";
else if ((*data == 'F' || *data == 'f') && !data[1])
str = "2";
else
{
tty_printf (_("Error: invalid response.\n"));
xfree (data);
return -1;
}
rc = agent_scd_setattr ("DISP-SEX", str, 1, NULL );
if (rc)
log_error ("error setting sex: %s\n", gpg_strerror (rc));
xfree (data);
return rc;
}
static int
change_cafpr (int fprno)
{
char *data;
const char *s;
int i, c, rc;
unsigned char fpr[20];
data = cpr_get ("cardedit.change_cafpr", _("CA fingerprint: "));
if (!data)
return -1;
trim_spaces (data);
cpr_kill_prompt ();
for (i=0, s=data; i < 20 && *s; )
{
while (spacep(s))
s++;
if (*s == ':')
s++;
while (spacep(s))
s++;
c = hextobyte (s);
if (c == -1)
break;
fpr[i++] = c;
s += 2;
}
xfree (data);
if (i != 20 || *s)
{
tty_printf (_("Error: invalid formatted fingerprint.\n"));
return -1;
}
rc = agent_scd_setattr (fprno==1?"CA-FPR-1":
fprno==2?"CA-FPR-2":
fprno==3?"CA-FPR-3":"x", fpr, 20, NULL );
if (rc)
log_error ("error setting cafpr: %s\n", gpg_strerror (rc));
return rc;
}
static void
toggle_forcesig (void)
{
struct agent_card_info_s info;
int rc;
int newstate;
memset (&info, 0, sizeof info);
rc = agent_scd_getattr ("CHV-STATUS", &info);
if (rc)
{
log_error ("error getting current status: %s\n", gpg_strerror (rc));
return;
}
newstate = !info.chv1_cached;
agent_release_card_info (&info);
rc = agent_scd_setattr ("CHV-STATUS-1", newstate? "\x01":"", 1, NULL);
if (rc)
log_error ("error toggling signature PIN flag: %s\n", gpg_strerror (rc));
}
/* Helper for the key generation/edit functions. */
static int
get_info_for_key_operation (struct agent_card_info_s *info)
{
int rc;
memset (info, 0, sizeof *info);
rc = agent_scd_getattr ("SERIALNO", info);
if (rc || !info->serialno || strncmp (info->serialno, "D27600012401", 12)
|| strlen (info->serialno) != 32 )
{
log_error (_("key operation not possible: %s\n"),
rc ? gpg_strerror (rc) : _("not an OpenPGP card"));
return rc? rc: -1;
}
rc = agent_scd_getattr ("KEY-FPR", info);
if (!rc)
rc = agent_scd_getattr ("CHV-STATUS", info);
if (!rc)
rc = agent_scd_getattr ("DISP-NAME", info);
if (rc)
log_error (_("error getting current key info: %s\n"), gpg_strerror (rc));
return rc;
}
/* Helper for the key generation/edit functions. */
static int
check_pin_for_key_operation (struct agent_card_info_s *info, int *forced_chv1)
{
int rc = 0;
agent_clear_pin_cache (info->serialno);
*forced_chv1 = !info->chv1_cached;
if (*forced_chv1)
{ /* Switch off the forced mode so that during key generation we
don't get bothered with PIN queries for each
self-signature. */
rc = agent_scd_setattr ("CHV-STATUS-1", "\x01", 1, info->serialno);
if (rc)
{
log_error ("error clearing forced signature PIN flag: %s\n",
gpg_strerror (rc));
*forced_chv1 = 0;
}
}
if (!rc)
{
/* Check the PIN now, so that we won't get asked later for each
binding signature. */
rc = agent_scd_checkpin (info->serialno);
if (rc)
log_error ("error checking the PIN: %s\n", gpg_strerror (rc));
}
return rc;
}
/* Helper for the key generation/edit functions. */
static void
restore_forced_chv1 (int *forced_chv1)
{
int rc;
if (*forced_chv1)
{ /* Switch back to forced state. */
rc = agent_scd_setattr ("CHV-STATUS-1", "", 1, NULL);
if (rc)
{
log_error ("error setting forced signature PIN flag: %s\n",
gpg_strerror (rc));
}
}
}
/* Helper for the key generation/edit functions. */
static void
show_card_key_info (struct agent_card_info_s *info)
{
tty_fprintf (NULL, "Signature key ....:");
print_sha1_fpr (NULL, info->fpr1valid? info->fpr1:NULL);
tty_fprintf (NULL, "Encryption key....:");
print_sha1_fpr (NULL, info->fpr2valid? info->fpr2:NULL);
tty_fprintf (NULL, "Authentication key:");
print_sha1_fpr (NULL, info->fpr3valid? info->fpr3:NULL);
tty_printf ("\n");
}
/* Helper for the key generation/edit functions. */
static int
replace_existing_key_p (struct agent_card_info_s *info, int keyno)
{
assert (keyno >= 0 && keyno <= 3);
if ((keyno == 1 && info->fpr1valid)
|| (keyno == 2 && info->fpr2valid)
|| (keyno == 3 && info->fpr3valid))
{
tty_printf ("\n");
log_info ("WARNING: such a key has already been stored on the card!\n");
tty_printf ("\n");
if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_key",
_("Replace existing key? (y/N) ")))
return -1;
}
return 0;
}
static void
generate_card_keys (void)
{
struct agent_card_info_s info;
int forced_chv1;
int want_backup;
if (get_info_for_key_operation (&info))
return;
#if GNUPG_MAJOR_VERSION == 1
{
char *answer=cpr_get("cardedit.genkeys.backup_enc",
_("Make off-card backup of encryption key? (Y/n) "));
want_backup=answer_is_yes_no_default(answer,1);
cpr_kill_prompt();
xfree(answer);
}
#else
want_backup = cpr_get_answer_is_yes
( "cardedit.genkeys.backup_enc",
_("Make off-card backup of encryption key? (Y/n) "));
/*FIXME: we need answer_is_yes_no_default()*/
#endif
if ( (info.fpr1valid && !fpr_is_zero (info.fpr1))
|| (info.fpr2valid && !fpr_is_zero (info.fpr2))
|| (info.fpr3valid && !fpr_is_zero (info.fpr3)))
{
tty_printf ("\n");
log_info ("NOTE: keys are already stored on the card!\n");
tty_printf ("\n");
if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_keys",
_("Replace existing keys? (y/N) ")))
{
agent_release_card_info (&info);
return;
}
}
else if (!info.disp_name || !*info.disp_name)
{
tty_printf ("\n");
tty_printf (_("Please note that the factory settings of the PINs are\n"
" PIN = `%s' Admin PIN = `%s'\n"
"You should change them using the command --change-pin\n"),
"123456", "12345678");
tty_printf ("\n");
}
if (check_pin_for_key_operation (&info, &forced_chv1))
goto leave;
generate_keypair (NULL, info.serialno,
want_backup? opt.homedir:NULL);
leave:
agent_release_card_info (&info);
restore_forced_chv1 (&forced_chv1);
}
/* This function is used by the key edit menu to generate an arbitrary
subkey. */
int
card_generate_subkey (KBNODE pub_keyblock, KBNODE sec_keyblock)
{
struct agent_card_info_s info;
int okay = 0;
int forced_chv1 = 0;
int keyno;
if (get_info_for_key_operation (&info))
return 0;
show_card_key_info (&info);
tty_printf (_("Please select the type of key to generate:\n"));
tty_printf (_(" (1) Signature key\n"));
tty_printf (_(" (2) Encryption key\n"));
tty_printf (_(" (3) Authentication key\n"));
for (;;)
{
char *answer = cpr_get ("cardedit.genkeys.subkeytype",
_("Your selection? "));
cpr_kill_prompt();
if (*answer == CONTROL_D)
{
xfree (answer);
goto leave;
}
keyno = *answer? atoi(answer): 0;
xfree(answer);
if (keyno >= 1 && keyno <= 3)
break; /* Okay. */
tty_printf(_("Invalid selection.\n"));
}
if (replace_existing_key_p (&info, keyno))
goto leave;
if (check_pin_for_key_operation (&info, &forced_chv1))
goto leave;
okay = generate_card_subkeypair (pub_keyblock, sec_keyblock,
keyno, info.serialno);
leave:
agent_release_card_info (&info);
restore_forced_chv1 (&forced_chv1);
return okay;
}
/* Store the key at NODE into the smartcard and modify NODE to
carry the serialno stuff instead of the actual secret key
parameters. USE is the usage for that key; 0 means any
usage. */
int
card_store_subkey (KBNODE node, int use)
{
struct agent_card_info_s info;
int okay = 0;
int rc;
int keyno, i;
PKT_secret_key *copied_sk = NULL;
PKT_secret_key *sk;
size_t n;
const char *s;
int allow_keyno[3];
assert (node->pkt->pkttype == PKT_SECRET_KEY
|| node->pkt->pkttype == PKT_SECRET_SUBKEY);
sk = node->pkt->pkt.secret_key;
if (get_info_for_key_operation (&info))
return 0;
show_card_key_info (&info);
if (!is_RSA (sk->pubkey_algo) || nbits_from_sk (sk) != 1024 )
{
tty_printf ("You may only store a 1024 bit RSA key on the card\n");
tty_printf ("\n");
goto leave;
}
allow_keyno[0] = (!use || (use & (PUBKEY_USAGE_SIG)));
allow_keyno[1] = (!use || (use & (PUBKEY_USAGE_ENC)));
allow_keyno[2] = (!use || (use & (PUBKEY_USAGE_SIG|PUBKEY_USAGE_AUTH)));
tty_printf (_("Please select where to store the key:\n"));
if (allow_keyno[0])
tty_printf (_(" (1) Signature key\n"));
if (allow_keyno[1])
tty_printf (_(" (2) Encryption key\n"));
if (allow_keyno[2])
tty_printf (_(" (3) Authentication key\n"));
for (;;)
{
char *answer = cpr_get ("cardedit.genkeys.storekeytype",
_("Your selection? "));
cpr_kill_prompt();
if (*answer == CONTROL_D || !*answer)
{
xfree (answer);
goto leave;
}
keyno = *answer? atoi(answer): 0;
xfree(answer);
if (keyno >= 1 && keyno <= 3 && allow_keyno[keyno-1])
break; /* Okay. */
tty_printf(_("Invalid selection.\n"));
}
if (replace_existing_key_p (&info, keyno))
goto leave;
/* Unprotect key. */
switch (is_secret_key_protected (sk) )
{
case 0: /* Not protected. */
break;
case -1:
log_error (_("unknown key protection algorithm\n"));
goto leave;
default:
if (sk->protect.s2k.mode == 1001)
{
log_error (_("secret parts of key are not available\n"));
goto leave;
}
if (sk->protect.s2k.mode == 1002)
{
log_error (_("secret key already stored on a card\n"));
goto leave;
}
/* We better copy the key before we unprotect it. */
copied_sk = sk = copy_secret_key (NULL, sk);
rc = check_secret_key (sk, 0);
if (rc)
goto leave;
}
rc = save_unprotected_key_to_card (sk, keyno);
if (rc)
goto leave;
/* Get back to the maybe protected original secret key. */
if (copied_sk)
{
free_secret_key (copied_sk);
copied_sk = NULL;
}
sk = node->pkt->pkt.secret_key;
/* Get rid of the secret key parameters and store the serial numer. */
n = pubkey_get_nskey (sk->pubkey_algo);
for (i=pubkey_get_npkey (sk->pubkey_algo); i < n; i++)
{
gcry_mpi_release (sk->skey[i]);
sk->skey[i] = NULL;
}
i = pubkey_get_npkey (sk->pubkey_algo);
sk->skey[i] = gcry_mpi_set_opaque (NULL, xstrdup ("dummydata"), 10*8);
sk->is_protected = 1;
sk->protect.s2k.mode = 1002;
s = info.serialno;
for (sk->protect.ivlen=0; sk->protect.ivlen < 16 && *s && s[1];
sk->protect.ivlen++, s += 2)
sk->protect.iv[sk->protect.ivlen] = xtoi_2 (s);
okay = 1;
leave:
if (copied_sk)
free_secret_key (copied_sk);
agent_release_card_info (&info);
return okay;
}
/* Data used by the command parser. This needs to be outside of the
function scope to allow readline based command completion. */
enum cmdids
{
cmdNOP = 0,
cmdQUIT, cmdADMIN, cmdHELP, cmdLIST, cmdDEBUG, cmdVERIFY,
cmdNAME, cmdURL, cmdFETCH, cmdLOGIN, cmdLANG, cmdSEX, cmdCAFPR,
cmdFORCESIG, cmdGENERATE, cmdPASSWD, cmdPRIVATEDO, cmdWRITECERT,
cmdUNBLOCK,
cmdINVCMD
};
static struct
{
const char *name;
enum cmdids id;
int admin_only;
const char *desc;
} cmds[] =
{
{ "quit" , cmdQUIT , 0, N_("quit this menu")},
{ "q" , cmdQUIT , 0, NULL },
{ "admin" , cmdADMIN , 0, N_("show admin commands")},
{ "help" , cmdHELP , 0, N_("show this help")},
{ "?" , cmdHELP , 0, NULL },
{ "list" , cmdLIST , 0, N_("list all available data")},
{ "l" , cmdLIST , 0, NULL },
{ "debug" , cmdDEBUG , 0, NULL },
{ "name" , cmdNAME , 1, N_("change card holder's name")},
{ "url" , cmdURL , 1, N_("change URL to retrieve key")},
{ "fetch" , cmdFETCH , 0, N_("fetch the key specified in the card URL")},
{ "login" , cmdLOGIN , 1, N_("change the login name")},
{ "lang" , cmdLANG , 1, N_("change the language preferences")},
{ "sex" , cmdSEX , 1, N_("change card holder's sex")},
{ "cafpr" , cmdCAFPR , 1, N_("change a CA fingerprint")},
{ "forcesig", cmdFORCESIG, 1, N_("toggle the signature force PIN flag")},
{ "generate", cmdGENERATE, 1, N_("generate new keys")},
{ "passwd" , cmdPASSWD, 0, N_("menu to change or unblock the PIN")},
{ "verify" , cmdVERIFY, 0, N_("verify the PIN and list all data")},
{ "unblock" , cmdUNBLOCK,0, N_("unblock the PIN using a Reset Code") },
/* Note, that we do not announce these command yet. */
{ "privatedo", cmdPRIVATEDO, 0, NULL },
{ "writecert", cmdWRITECERT, 1, NULL },
{ NULL, cmdINVCMD, 0, NULL }
};
#if GNUPG_MAJOR_VERSION == 1 && defined (HAVE_LIBREADLINE)
/* These two functions are used by readline for command completion. */
static char *
command_generator(const char *text,int state)
{
static int list_index,len;
const char *name;
/* If this is a new word to complete, initialize now. This includes
saving the length of TEXT for efficiency, and initializing the
index variable to 0. */
if(!state)
{
list_index=0;
len=strlen(text);
}
/* Return the next partial match */
while((name=cmds[list_index].name))
{
/* Only complete commands that have help text */
if(cmds[list_index++].desc && strncmp(name,text,len)==0)
return strdup(name);
}
return NULL;
}
static char **
card_edit_completion(const char *text, int start, int end)
{
/* If we are at the start of a line, we try and command-complete.
If not, just do nothing for now. */
if(start==0)
return rl_completion_matches(text,command_generator);
rl_attempted_completion_over=1;
return NULL;
}
#endif /* GNUPG_MAJOR_VERSION == 1 && HAVE_LIBREADLINE */
/* Menu to edit all user changeable values on an OpenPGP card. Only
Key creation is not handled here. */
void
card_edit (strlist_t commands)
{
enum cmdids cmd = cmdNOP;
int have_commands = !!commands;
int redisplay = 1;
char *answer = NULL;
int did_checkpin = 0, allow_admin=0;
char serialnobuf[50];
if (opt.command_fd != -1)
;
else if (opt.batch && !have_commands)
{
log_error(_("can't do this in batch mode\n"));
goto leave;
}
for (;;)
{
int arg_number;
const char *arg_string = "";
const char *arg_rest = "";
char *p;
int i;
int cmd_admin_only;
tty_printf("\n");
if (redisplay )
{
if (opt.with_colons)
{
card_status (stdout, serialnobuf, DIM (serialnobuf));
fflush (stdout);
}
else
{
card_status (NULL, serialnobuf, DIM (serialnobuf));
tty_printf("\n");
}
redisplay = 0;
}
do
{
xfree (answer);
if (have_commands)
{
if (commands)
{
answer = xstrdup (commands->d);
commands = commands->next;
}
else if (opt.batch)
{
answer = xstrdup ("quit");
}
else
have_commands = 0;
}
if (!have_commands)
{
#if GNUPG_MAJOR_VERSION == 1
tty_enable_completion (card_edit_completion);
#endif
answer = cpr_get_no_help("cardedit.prompt", _("Command> "));
cpr_kill_prompt();
#if GNUPG_MAJOR_VERSION == 1
tty_disable_completion ();
#endif
}
trim_spaces(answer);
}
while ( *answer == '#' );
arg_number = 0; /* Yes, here is the init which egcc complains about */
cmd_admin_only = 0;
if (!*answer)
cmd = cmdLIST; /* Default to the list command */
else if (*answer == CONTROL_D)
cmd = cmdQUIT;
else
{
if ((p=strchr (answer,' ')))
{
*p++ = 0;
trim_spaces (answer);
trim_spaces (p);
arg_number = atoi(p);
arg_string = p;
arg_rest = p;
while (digitp (arg_rest))
arg_rest++;
while (spacep (arg_rest))
arg_rest++;
}
for (i=0; cmds[i].name; i++ )
if (!ascii_strcasecmp (answer, cmds[i].name ))
break;
cmd = cmds[i].id;
cmd_admin_only = cmds[i].admin_only;
}
if (!allow_admin && cmd_admin_only)
{
tty_printf ("\n");
tty_printf (_("Admin-only command\n"));
continue;
}
switch (cmd)
{
case cmdHELP:
for (i=0; cmds[i].name; i++ )
if(cmds[i].desc
&& (!cmds[i].admin_only || (cmds[i].admin_only && allow_admin)))
tty_printf("%-10s %s\n", cmds[i].name, _(cmds[i].desc) );
break;
case cmdADMIN:
if ( !strcmp (arg_string, "on") )
allow_admin = 1;
else if ( !strcmp (arg_string, "off") )
allow_admin = 0;
else if ( !strcmp (arg_string, "verify") )
{
/* Force verification of the Admin Command. However,
this is only done if the retry counter is at initial
state. */
char *tmp = xmalloc (strlen (serialnobuf) + 6 + 1);
strcpy (stpcpy (tmp, serialnobuf), "[CHV3]");
allow_admin = !agent_scd_checkpin (tmp);
xfree (tmp);
}
else /* Toggle. */
allow_admin=!allow_admin;
if(allow_admin)
tty_printf(_("Admin commands are allowed\n"));
else
tty_printf(_("Admin commands are not allowed\n"));
break;
case cmdVERIFY:
agent_scd_checkpin (serialnobuf);
redisplay = 1;
break;
case cmdLIST:
redisplay = 1;
break;
case cmdNAME:
change_name ();
break;
case cmdURL:
change_url ();
break;
case cmdFETCH:
fetch_url();
break;
case cmdLOGIN:
change_login (arg_string);
break;
case cmdLANG:
change_lang ();
break;
case cmdSEX:
change_sex ();
break;
case cmdCAFPR:
if ( arg_number < 1 || arg_number > 3 )
tty_printf ("usage: cafpr N\n"
" 1 <= N <= 3\n");
else
change_cafpr (arg_number);
break;
case cmdPRIVATEDO:
if ( arg_number < 1 || arg_number > 4 )
tty_printf ("usage: privatedo N\n"
" 1 <= N <= 4\n");
else
change_private_do (arg_string, arg_number);
break;
case cmdWRITECERT:
if ( arg_number != 3 )
tty_printf ("usage: writecert 3 < FILE\n");
else
change_cert (arg_rest);
break;
case cmdFORCESIG:
toggle_forcesig ();
break;
case cmdGENERATE:
generate_card_keys ();
break;
case cmdPASSWD:
change_pin (0, allow_admin);
did_checkpin = 0; /* Need to reset it of course. */
break;
case cmdUNBLOCK:
change_pin (1, allow_admin);
did_checkpin = 0; /* Need to reset it of course. */
break;
case cmdQUIT:
goto leave;
case cmdNOP:
break;
case cmdINVCMD:
default:
tty_printf ("\n");
tty_printf (_("Invalid command (try \"help\")\n"));
break;
} /* End command switch. */
} /* End of main menu loop. */
leave:
xfree (answer);
}
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 150d680a3..c59ef06ea 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,2535 +1,2539 @@
+2009-05-27 Werner Koch <wk@g10code.com>
+
+ * encrypt.c (encrypt_dek): Make use of make_canon_sexp.
+
2009-05-18 Werner Koch <wk@g10code.com>
* server.c (option_handler): New option "no-encrypt-to".
(cmd_encrypt): Make use of it.
* gpgsm.c: Remove not implemented --verify-files.
2009-04-02 Werner Koch <wk@g10code.com>
* keylist.c (list_cert_std): Print card serial number.
2009-04-01 Werner Koch <wk@g10code.com>
* export.c (popen_protect_tool): Add command line option
--agent-program and pass flag bit 6.
* import.c (popen_protect_tool): Ditto.
2009-03-26 Werner Koch <wk@g10code.com>
* gpgsm.c (main): s/def_digest_string/forced_digest_algo/ and
activate the --digest-algo option.
* gpgsm.h (struct opt): s/def_digest_algo/forced_digest_algo/.
* sign.c (gpgsm_sign): Implement --digest-algo.
* sign.c (MAX_DIGEST_LEN): Change to 64.
* call-agent.c (gpgsm_agent_marktrusted): Format the issuer name.
2009-03-25 Werner Koch <wk@g10code.com>
* decrypt.c (gpgsm_decrypt): Print ENC_TO and NO_SECKEY stati.
Fixes bug#1020.
* fingerprint.c (gpgsm_get_short_fingerprint): Add arg R_HIGH and
change all callers.
2009-03-23 Werner Koch <wk@g10code.com>
* delete.c (delete_one): Also delete ephemeral certificates if
specified uniquely.
2009-03-20 Werner Koch <wk@g10code.com>
* keylist.c (list_internal_keys): Set released cert to NULL.
* call-agent.c (learn_status_cb): New.
(gpgsm_agent_learn): Use it.
(learn_cb): Send a progress for every certificate.
2009-03-18 Werner Koch <wk@g10code.com>
* gpgsm.h (struct opt): Move field WITH_EPHEMERAL_KEYS to struct
server_control_s.
* gpgsm.c (main): Change accordingly.
* keylist.c (list_internal_keys): Ditto.
* server.c (option_handler): Add "with-ephemeral-keys".
2009-03-12 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_dump_time): Remove.
* certdump.c, verify.c, certchain.c
* gpgsm.c: s/gpgsm_dump_time/dump_isotime/.
2009-03-06 Werner Koch <wk@g10code.com>
* call-agent.c (gpgsm_agent_keyinfo, keyinfo_status_cb): New.
* keylist.c (list_cert_colon): Print card S/N.
* keylist.c (list_internal_keys): Always list ephemeral keys if
specified by keygrip or fingerprint.
(list_cert_raw): Always show ephemeral flag.
* export.c (gpgsm_export): Export ephemeral keys if specified by
keygrip.
2009-02-09 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Change default cipher back to 3DES.
2009-01-12 Werner Koch <wk@g10code.com>
* keylist.c (print_utf8_extn_raw): Cast printf precision argument.
2009-01-08 Werner Koch <wk@g10code.com>
* fingerprint.c (gpgsm_get_keygrip_hexstring): Add error detection.
2008-12-10 Werner Koch <wk@g10code.com>
* gpgsm.c (our_cipher_test_algo): Use the GCRY constants as we now
require 1.4.
(our_md_test_algo): Ditto. Add SHA224.
(main) <aGpgConfList>: Update default cipher algo.
2008-12-09 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Call i18n_init before init_common_subsystems.
2008-12-05 Werner Koch <wk@g10code.com>
* certreqgen.c (create_request): Provide a custom prompt for the
signing.
* certdump.c (gpgsm_format_keydesc): Remove debug output.
(gpgsm_format_keydesc): Remove saving of errno as xfree is
supposed not to change it. Use the new percent_plus_escape
function which also fixes the issue that we did not escaped a
percent in the past.
2008-11-18 Werner Koch <wk@g10code.com>
* gpgsm.c (make_libversion): New.
(my_strusage): Use new function.
(build_lib_list): Remove.
2008-11-13 Werner Koch <wk@g10code.com>
* gpgsm.c: Remove all unused options. Use ARGPARSE macros.
2008-10-28 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_format_keydesc): Use xtryasprintf and xfree.
(gpgsm_es_print_name): Factor code out to ...
(gpgsm_es_print_name2): New function.
(gpgsm_format_name2, format_name_writer): Use estream so that it
works on all platforms.
(format_name_writer): Fix reallocation bug.
2008-10-23 Werner Koch <wk@g10code.com>
* import.c (popen_protect_tool): Add arg CTRL and assure that the
agent is running. Pass a value for CTRL from all caller.
* export.c (popen_protect_tool): Ditto.
2008-10-21 Werner Koch <wk@g10code.com>
* call-dirmngr.c (inq_certificate_parm_s): Add field CTRL.
(gpgsm_dirmngr_isvalid): Supply a value for that field.
(inq_certificate): Add inquiry ISTRUSTED.
* call-agent.c (gpgsm_agent_istrusted): Add new optional arg
HEXFPR. Changed all callers.
2008-10-20 Werner Koch <wk@g10code.com>
* keydb.c (keydb_locate_writable): Mark unused arg.
(keydb_search_kid): Ditto.
(keydb_clear_some_cert_flags): Ditto.
* server.c (cmd_encrypt): Ditto.
(cmd_decrypt, cmd_verify, cmd_import, cmd_genkey): Ditto.
* call-agent.c (gpgsm_scd_pksign): Ditto.
* call-dirmngr.c (release_dirmngr, release_dirmngr2)
(run_command_cb): Ditto.
* certlist.c (gpgsm_add_cert_to_certlist): Ditto.
* certchain.c (find_up_dirmngr): Ditto.
* keylist.c (print_key_data): Ditto.
(list_cert_raw, list_cert_std): Ditto.
* qualified.c (gpgsm_is_in_qualified_list): Ditto.
* gpgsm.c (set_binary) [!W32]: Mark unused arg.
2008-10-17 Werner Koch <wk@g10code.com>
* call-dirmngr.c (start_dirmngr, start_dirmngr2): Reset the lock
flag on error.
(release_dirmngr, release_dirmngr2): Replace asserts by error messages.
(gpgsm_dirmngr_lookup): Replace assert by fatal error message.
2008-10-13 Werner Koch <wk@g10code.com>
* gpgsm.c: Add alias --delete-keys.
2008-09-30 Werner Koch <wk@g10code.com>
* server.c (cmd_getinfo): New subcommand agent-check.
* call-agent.c (gpgsm_agent_send_nop): New.
2008-09-29 Werner Koch <wk@g10code.com>
* certcheck.c (MY_GCRY_PK_ECDSA): Remove. Change users to
GCRY_PK_ECDSA.
* gpgsm.c (MY_GCRY_PK_ECDSA): Ditto.
* sign.c (MY_GCRY_MD_SHA224): Remove change users to GCRY_MD_SHA224.
2008-09-04 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_format_keydesc): Work around a mingw32 bug.
2008-09-03 Werner Koch <wk@g10code.com>
* sign.c (MY_GCRY_MD_SHA224): New, so that we don't need libgcrypt
1.2.
2008-08-13 Werner Koch <wk@g10code.com>
* keylist.c (list_cert_colon): Print 'f' for validated certs.
2008-08-08 Marcus Brinkmann <marcus@g10code.de>
* gpgsm.h (struct server_control_s): Remove member dirmngr_seen.
* call-dirmngr.c (dirmngr2_ctx, dirmngr_ctx_locked)
(dirmngr2_ctx_locked): New global variables.
(prepare_dirmngr): Don't check dirmngr_seen anymore.
(start_dirmngr): Move bunch of code to ...
(start_dirmngr_ext): ... this new function.
(release_dirmngr, start_dirmngr2, release_dirmngr2): New
functions.
(gpgsm_dirmngr_isvalid): Call release_dirmngr.
(gpgsm_dirmngr_lookup): Call release_dirmngr. If dirmngr_ctx is
locked, use dirmngr2_locked.
(gpgsm_dirmngr_run_command): Call release_dirmngr.
2008-06-25 Werner Koch <wk@g10code.com>
* sign.c (gpgsm_sign): Revamp the hash algorithm selection.
* gpgsm.h (struct certlist_s): Add field HASH_ALGO and HASH_ALGO_OID.
* qualified.c (gpgsm_qualified_consent): Fix double free.
* gpgsm.c (main): Change default cipher algo to AES.
* keylist.c (print_utf8_extn_raw, print_utf8_extn): New.
(list_cert_raw, list_cert_std): Print the TeleSec restriction
extension.
2008-06-23 Werner Koch <wk@g10code.com>
* encrypt.c (encode_session_key): Replace xmalloc by xtrymalloc.
Use bin2hex instead of open coding the conversion.
(encrypt_dek): Init S_DATA.
2008-06-13 Marcus Brinkmann <marcus@ulysses.g10code.com>
* call-dirmngr.c (prepare_dirmngr): Fix error code to ignore.
2008-06-12 Marcus Brinkmann <marcus@g10code.de>
* gpgsm.h (struct keyserver_spec): New struct.
(opt): Add member keyserver.
* gpgsm.c (keyserver_list_free, parse_keyserver_line): New functions.
(main): Implement --keyserver option.
* call-dirmngr.c (prepare_dirmngr): Send LDAPSERVER commands.
2008-05-20 Werner Koch <wk@g10code.com>
* gpgsm.c (main) <aExportSecretKeyP12>: Pass FP and not stdout to
the export function. Reported by Marc Mutz.
2008-05-06 Werner Koch <wk@g10code.com>
* keylist.c (list_external_keys): Ignore NOT FOUND error code.
This is bug#907.
2008-04-23 Werner Koch <wk@g10code.com>
* certchain.c (find_up): Make correct C89 code. Declare variable
at the top of the block. Reported by Alain Guibert.
2008-04-09 Werner Koch <wk@g10code.com>
* verify.c (gpgsm_verify): Print the message hash values on error.
2008-03-31 Werner Koch <wk@g10code.com>
* call-dirmngr.c (start_dirmngr): Use log_info instead of
log_error when falling back to start dirmngr.
2008-03-20 Werner Koch <wk@g10code.com>
* certlist.c (gpgsm_add_to_certlist): Always save the first
subject and issuer. Initialize issuer with issuer and not with
subject.
(same_subject_issuer): Set issuer2 to issuer and not to subject.
2008-03-17 Werner Koch <wk@g10code.com>
* certdump.c (my_funopen_hook_size_t): New.
(format_name_writer): Use it.
2008-03-13 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_fpr_and_name_for_status): Fix signed/unsigned
char issue.
(gpgsm_format_keydesc): Remove superfluous test. Add expire date
to the prompt.
2008-02-18 Werner Koch <wk@g10code.com>
* certchain.c (gpgsm_is_root_cert): Factor code out to ...
(is_root_cert): New. Extend test for self-issued certificates
signed by other CAs.
(do_validate_chain, gpgsm_basic_cert_check)
(gpgsm_walk_cert_chain): Use it here.
* gpgsm.c: Add option --no-common-certs-import.
* certchain.c (find_up_dirmngr, find_up, do_validate_chain)
(check_cert_policy): Be more silent with --quiet.
* gpgsm.c: Add option --disable-dirmngr.
* gpgsm.h (opt): Add field DISABLE_DIRMNGR.
* call-dirmngr.c (start_dirmngr): Implement option.
2008-02-14 Werner Koch <wk@g10code.com>
* server.c (option_handler): Add option allow-pinentry-notify.
(gpgsm_proxy_pinentry_notify): New.
* call-agent.c (default_inq_cb): New.
(gpgsm_agent_pksign, gpgsm_scd_pksign, gpgsm_agent_readkey)
(gpgsm_agent_istrusted, gpgsm_agent_marktrusted)
(gpgsm_agent_passwd, gpgsm_agent_get_confirmation): Call it.
(struct cipher_parm_s, struct genkey_parm_s): Add field CTRL.
(inq_ciphertext_cb): Test keyword and fallback to default_inq_cb.
(inq_genkey_parms): Ditto.
(start_agent): Tell agent to send us the pinentry notifications.
2008-02-13 Werner Koch <wk@g10code.com>
* call-dirmngr.c (gpgsm_dirmngr_lookup): Add arg CACHE_ONLY.
* keylist.c (list_external_keys): Pass false for new arg.
* certchain.c (find_up_dirmngr): New.
(find_up): Also try to read from the dirmngr cache.
(find_up, find_up_external, gpgsm_walk_cert_chain)
(gpgsm_basic_cert_check, allowed_ca): Add arg CTRL and changed all
callers.
* call-agent.c (struct learn_parm_s): Add field CTRL.
(gpgsm_agent_learn): Set it.
2008-02-11 Werner Koch <wk@g10code.com>
* server.c (cmd_getinfo): New.
(gpgsm_server): Register GETINFO.
2008-01-29 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (list_internal_keys): New variable lastcert. Use it
to suppress duplicates which immediately follow each other.
2008-01-27 Werner Koch <wk@g10code.com>
* import.c (popen_protect_tool): Set bit 7 in the flags for
gnupg_spawn_process so that under W32 no window appears.
* export.c (popen_protect_tool): Ditto.
2007-12-13 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Add option --extra-digest-algo.
* gpgsm.h (struct): Add EXTRA_DIGEST_ALGO.
* verify.c (gpgsm_verify): Use it. Use the hash algorithm from
the signature value.
2007-12-11 Werner Koch <wk@g10code.com>
* certchain.c (do_validate_chain): Log AUDIT_ROOT_TRUSTED.
* server.c (cmd_sign, cmd_decrypt, cmd_encrypt): Start audit log.
(cmd_recipient): Start audit session.
* gpgsm.c (main): Revamp creation of the audit log.
* gpgsm.h (struct server_control_s): Add AGENT_SEEN and DIRMNGR_SEEN.
* call-agent.c (start_agent): Record an audit event.
* call-dirmngr.c (start_dirmngr): Ditto. Add new arg CTRL and pass
it from all callers.
(prepare_dirmngr): New helper for start_dirmngr.
* encrypt.c (gpgsm_encrypt): Add calls to audit_log.
2007-12-03 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Call gnupg_reopen_std.
h2007-11-22 Werner Koch <wk@g10code.com>
* server.c (cmd_getauditlog): New.
(register_commands): Register GETAUDITLOG.
2007-11-19 Werner Koch <wk@g10code.com>
* server.c (cmd_recipient, cmd_signer): Add error reason 11.
* gpgsm.c (main): Print a warning if --audit-log is used.
2007-11-15 Werner Koch <wk@g10code.com>
* gpgsm.h (struct): Add XAUTHORITY and PINENTRY_USER_DATA.
* misc.c (setup_pinentry_env): Add XAUTHORITY and PINENTRY_USER_DATA.
* gpgsm.c (main): New option --xauthority.
* call-agent.c (start_agent): Adjust for changed start_new_gpg_agent.
* server.c (option_handler): Ad the new options.
2007-11-07 Werner Koch <wk@g10code.com>
* gpgsm.c (main): New option --audit-log.
* server.c (option_handler): New option enable-audit-log.
(start_audit_session): New.
(cmd_verify): Create audit context.
(gpgsm_server): Release the context.
* gpgsm.h (struct server_control_s): Add member AUDIT, include
audit.h.
* certdump.c (gpgsm_format_sn_issuer): New.
* verify.c (hash_data): Return an error code.
(gpgsm_verify): Add calls to audit_log.
* gpgsm.c (get_status_string): Remove.
* gpgsm.h: Include status.h instead of errors.h.
2007-10-19 Werner Koch <wk@g10code.com>
* qualified.c (gpgsm_qualified_consent): Use i18N-swicth functions.
(gpgsm_not_qualified_warning): Ditto.
* certdump.c (gpgsm_format_keydesc): Ditto.
2007-09-14 Werner Koch <wk@g10code.com>
* gpgsm.c (build_lib_list): New.
(my_strusage): Print lib info.
2007-08-24 Werner Koch <wk@g10code.com>
* Makefile.am (common_libs): Swap libkeybox and jnlib.
2007-08-23 Werner Koch <wk@g10code.com>
* certlist.c (gpgsm_certs_identical_p): New.
(gpgsm_add_to_certlist): Ignore duplicate certificates in
ambigious name detection.
(gpgsm_find_cert): Ditto.
* export.c (gpgsm_p12_export): Ditto.
2007-08-22 Werner Koch <wk@g10code.com>
* certreqgen.c (create_request): Replace open coding by bin2hex.
* certreqgen-ui.c (gpgsm_gencertreq_tty): Use es_fopenmem.
2007-08-21 Werner Koch <wk@g10code.com>
* import.c (parse_p12): Use gnupg_tmpfile.
* export.c (export_p12): Ditto.
2007-08-20 Werner Koch <wk@g10code.com>
* certreqgen.c (read_parameters): Change FP to an estream_t.
(gpgsm_genkey): Replace in_fd and in_stream by a estream_t.
* server.c (cmd_genkey): Adjust for that.
* certreqgen-ui.c (gpgsm_gencertreq_tty): Use es_open_memstream
instead of a temporary file.
2007-08-14 Werner Koch <wk@g10code.com>
* call-dirmngr.c (start_dirmngr): Use dirmngr_socket_name. change
the way infostr is xstrdupped.
* gpgsm.c (main) [W32]: Make --prefer-system-dirmngr a dummy under
Windows.
2007-08-13 Werner Koch <wk@g10code.com>
* gpgsm.c (do_add_recipient): Add RECP_REQUIRED and make error
message depend on that.
(main): Add avriable RECP_REQUIRED, set ift for encryption
commands and pass it to do_add_recipient.
(our_pk_test_algo, our_cipher_test_algo, our_md_test_algo): Implement.
2007-08-09 Werner Koch <wk@g10code.com>
* gpgsm.c (main) [W32]: Enable CRL check by default.
(main): Update the default control structure after reading the
options.
(gpgsm_parse_validation_model, parse_validation_model): New.
(main): New option --validation-model.
* certchain.c (gpgsm_validate_chain): Implement this option.
* server.c (option_handler): Ditto.
* certchain.c (is_cert_still_valid): Reformatted. Add arg
FORCE_OCSP. Changed callers to set this flag when using the chain
model.
2007-08-08 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_print_serial): Fixed brown paper bag style bugs
which prefixed the output with a 3A and cut it off at a 00.
* keylist.c (list_cert_raw): Print the certificate ID first and
rename "Serial number" to "S/N".
(list_cert_std): Ditto.
2007-08-07 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Allow a string for --faked-system-time.
2007-08-06 Werner Koch <wk@g10code.com>
Implementation of the chain model.
* gpgsm.h (struct rootca_flags_s): Define new members VALID and
CHAIN_MODEL.
* call-agent.c (gpgsm_agent_istrusted): Mark ROOTCA_FLAGS valid.
(istrusted_status_cb): Set CHAIN_MODEL.
* certchain.c (gpgsm_validate_chain): Replace LM alias by LISTMODE
and FP by LISTFP.
(gpgsm_validate_chain): Factor some code out to ...
(check_validity_period, ask_marktrusted): .. new.
(check_validity_cm_basic, check_validity_cm_main): New.
(do_validate_chain): New with all code from gpgsm_validate_chain.
New arg ROOTCA_FLAGS.
(gpgsm_validate_chain): Provide ROOTCA_FLAGS and fallback to chain
model. Add RETFLAGS arg and changed all callers to pass NULL. Add
CHECKTIME arg and changed all callers to pass a nil value.
(has_validity_model_chain): New.
* verify.c (gpgsm_verify): Check for chain model and return as
part of the trust status.
* gpgsm.h (VALIDATE_FLAG_NO_DIRMNGR): New.
(VALIDATE_FLAG_NO_DIRMNGR): New.
* call-dirmngr.c (gpgsm_dirmngr_isvalid): Use constant here.
2007-08-03 Werner Koch <wk@g10code.com>
* keylist.c (list_cert_colon): Avoid duplicate listing of kludge
uids.
* verify.c (gpgsm_verify): Make STATUS_VERIFY return the hash and
pk algo.
* certcheck.c (gpgsm_check_cms_signature): Add arg R_PKALGO.
2007-08-02 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Factored GC_OPT_FLAGS out to gc-opt-flags.h.
2007-07-17 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Implement --default-key.
(main) <gpgconf-list>: Declare --default-key and --encrypt-to.
2007-07-16 Werner Koch <wk@g10code.com>
* server.c (cmd_message): Use gnupg_fd_t to avoid dependecy on
newer assuan versions.
2007-07-12 Werner Koch <wk@g10code.com>
* gpgsm.c (check_special_filename): Use translate_sys2libc_fd_int
when passing an int value.
* server.c (cmd_encrypt, cmd_decrypt, cmd_verify, cmd_import)
(cmd_export, cmd_message, cmd_genkey): Translate file descriptors.
2007-07-05 Werner Koch <wk@g10code.com>
* Makefile.am (common_libs): Changed order of libs.
2007-07-04 Werner Koch <wk@g10code.com>
* certchain.c (check_cert_policy): Remove extra checks for
GPG_ERR_NO_VALUE. They are not needed since libksba 1.0.1.
* keylist.c (print_capabilities, list_cert_raw, list_cert_std): Ditto.
* certlist.c (cert_usage_p, cert_usage_p): Ditto.
2007-06-26 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Call gnupg_rl_initialize.
* Makefile.am (gpgsm_LDADD): Add LIBREADLINE and libgpgrl.a.
2007-06-25 Werner Koch <wk@g10code.com>
* gpgsm.c (check_special_filename): Use translate_sys2libc_fd and
add new arg FOR_WRITE. Change callers to pass new arg.
2007-06-24 Werner Koch <wk@g10code.com>
* gpgsm.c (open_es_fwrite): Avoid the dup by using the new
es_fdopen_nc().
2007-06-21 Werner Koch <wk@g10code.com>
* certreqgen-ui.c: New.
* gpgsm.c (main): Let --gen-key call it.
* certreqgen.c (gpgsm_genkey): Add optional IN_STREAM arg and
adjusted caller.
* gpgsm.h (ctrl_t): Remove. It is now declared in ../common/util.h.
* call-agent.c (start_agent): Factored almost all code out to
../common/asshelp.c.
2007-06-20 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent) [W32]: Start the agent on the fly.
2007-06-18 Marcus Brinkmann <marcus@g10code.de>
* gpgsm.c (main): Percent escape output of --gpgconf-list.
2007-06-14 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Use gnupg_module_name.
* call-dirmngr.c (start_dirmngr): Ditto.
* export.c (export_p12): Ditto.
* import.c (parse_p12): Ditto.
* gpgsm.c (run_protect_tool): Ditto.
2007-06-12 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Replace some calls by init_common_subsystems.
(main): Use gnupg_datadir.
* qualified.c (read_list): Use gnupg-datadir.
2007-06-11 Werner Koch <wk@g10code.com>
* Makefile.am (common_libs): Use libcommaonstd macr.
* gpgsm.c (main) [W32]: Call pth_init.
2007-06-06 Werner Koch <wk@g10code.com>
* qualified.c (gpgsm_not_qualified_warning) [!ENABLE_NLS]: Do not
define orig_codeset.
* certdump.c (gpgsm_format_keydesc) [!ENABLE_NLS]: Do not define
orig_codeset.
(format_name_writer): Define only if funopen et al is available.
* gpgsm.c (i18n_init): Remove.
2007-05-29 Werner Koch <wk@g10code.com>
* export.c (gpgsm_p12_export): Print passphrase encoding info only
in PEM mode.
2007-05-18 Marcus Brinkmann <marcus@g10code.de>
* qualified.c (gpgsm_qualified_consent,
gpgsm_not_qualified_warning): Free ORIG_CODESET on error.
* certdump.c (gpgsm_format_keydesc): Likewise.
2007-05-07 Werner Koch <wk@g10code.com>
* certcheck.c (MY_GCRY_PK_ECDSA): New.
2007-04-20 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Parameterize failed versions check messages.
2007-04-19 Werner Koch <wk@g10code.com>
* certcheck.c (do_encode_md): Add arg PKEY. Add support for DSA2
and all ECDSA sizes.
(get_dsa_qbits): New.
(pk_algo_from_sexp): A key will never contain ecdsa as algorithm,
so remove that.
2007-04-18 Werner Koch <wk@g10code.com>
* certcheck.c (do_encode_md): Support 160 bit ECDSA.
2007-04-13 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Don't use log_error when using the
fallback hack to start the agent. This is bug 782.
2007-03-20 Werner Koch <wk@g10code.com>
* fingerprint.c (gpgsm_get_fingerprint): Add caching.
(gpgsm_get_fingerprint_string): Use bin2hexcolon().
(gpgsm_get_fingerprint_hexstring): Use bin2hex and allocate only
as much memory as required.
(gpgsm_get_keygrip_hexstring): Use bin2hex.
* certchain.c (gpgsm_validate_chain): Keep track of the
certificate chain and reset the ephemeral flags.
* keydb.c (keydb_set_cert_flags): New args EPHEMERAL and MASK.
Changed caller to use a mask of ~0. Return a proper error code if
the certificate is not available.
* gpgsm.c: Add option --p12-charset.
* gpgsm.h (struct opt): Add p12_charset.
* export.c (popen_protect_tool): Use new option.
2007-03-19 Werner Koch <wk@g10code.com>
Changes to let export and key listing use estream to help systems
without funopen.
* keylist.c: Use estream in place of stdio functions.
* gpgsm.c (open_es_fwrite): New.
(main): Use it for the list commands.
* server.c (data_line_cookie_functions): New.
(data_line_cookie_write, data_line_cookie_close): New.
(do_listkeys): Use estream.
* certdump.c (gpgsm_print_serial): Changed to use estream.
(gpgsm_print_time): Ditto.
(pretty_es_print_sexp): New.
(gpgsm_es_print_name): New.
(print_dn_part): New arg STREAM. Changed all callers.
(print_dn_parts): Ditto.
* certchain.c (gpgsm_validate_chain): Changed FP to type
estream_t.
(do_list, unknown_criticals, allowed_ca, check_cert_policy)
(is_cert_still_valid): Ditto.
* export.c (gpgsm_export): New arg STREAM.
(do_putc, do_fputs): New.
(print_short_info): Allow printing to optional STREAM.
* server.c (cmd_export): Use stream.
* base64.c (do_putc, do_fputs): New.
(base64_writer_cb, base64_finish_write): Let them cope with an
alternate output function.
(plain_writer_cb): New.
(gpgsm_create_writer): New arg STREAM and call plain_writer_cb for
binary output to an estream. Changed call callers.
2007-01-31 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Let --gen-key print a more informative error
message.
2007-01-25 Werner Koch <wk@g10code.com>
* Makefile.am (gpgsm_LDADD): Add LIBICONV. Noted by Billy Halsey.
2007-01-05 Werner Koch <wk@g10code.com>
* certchain.c (unknown_criticals): Add subjectAltName.
2006-12-21 Werner Koch <wk@g10code.com>
* gpgsm.c: Comment mtrace feature.
2006-12-21 Marcus Brinkmann <marcus@g10code.de>
* certchain.c (gpgsm_basic_cert_check): Release SUBJECT.
* encrypt.c (encrypt_dek): Release S_CIPH.
2006-12-20 Marcus Brinkmann <marcus@g10code.de>
* server.c (gpgsm_server): Release CTRL->server_local.
* base64.c: Add new members READER and WRITER in union U2.
(gpgsm_create_reader): Initialise CTX->u2.reader.
(gpgsm_destroy_reader): Invoke ksba_reader_release. Return early
if CTX is NULL.
(gpgsm_create_writer): Initialise CTX->u2.writer.
(gpgsm_destroy_writer): Invoke ksba_writer_release. Return early
if CTX is NULL.
2006-12-18 Marcus Brinkmann <marcus@g10code.de>
* fingerprint.c (gpgsm_get_fingerprint): Close MD.
2006-11-24 Werner Koch <wk@g10code.com>
* certdump.c (parse_dn_part): Take '#' as a special character only
at the beginning of a string.
2006-11-21 Werner Koch <wk@g10code.com>
* certdump.c (my_funopen_hook_ret_t): New.
(format_name_writer): Use it for the return value.
2006-11-14 Werner Koch <wk@g10code.com>
* server.c (skip_options): Skip leading spaces.
(has_option): Honor "--".
(cmd_export): Add option --data to do an inline export. Skip all
options.
* certdump.c (gpgsm_fpr_and_name_for_status): New.
* verify.c (gpgsm_verify): Use it to print correct status messages.
2006-11-11 Werner Koch <wk@g10code.com>
* server.c (skip_options): New.
2006-10-24 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS).
2006-10-23 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Remap common cipher algo names to their OIDs.
(main): New command --gpgconf-test.
2006-10-20 Werner Koch <wk@g10code.com>
* keydb.c (classify_user_id): Parse keygrip for the '&' identifier.
2006-10-18 Werner Koch <wk@g10code.com>
* keylist.c (list_cert_raw): Also test for GPG_ERR_NO_VALUE when
testing for GPG_ERR_NO_DATA.
* certlist.c (cert_usage_p, gpgsm_find_cert): Ditto.
* certchain.c (check_cert_policy): Ditto.
* keylist.c (list_cert_std, list_cert_raw): Print "none" for no
chain length available.
2006-10-17 Werner Koch <wk@g10code.com>
* gpgsm.c: No need for pth.h.
(main): or to init it. It used to be hack for W32.
* sign.c (gpgsm_get_default_cert): Changed to return only
certificates usable for signing.
2006-10-16 Werner Koch <wk@g10code.com>
* certchain.c (already_asked_marktrusted)
(set_already_asked_marktrusted): New.
(gpgsm_validate_chain) <not trusted>: Keep track of certificates
we already asked for.
2006-10-11 Werner Koch <wk@g10code.com>
* certreqgen.c (proc_parameters, create_request): Allow for
creation directly from a card.
* call-agent.c (gpgsm_agent_readkey): New arg FROMCARD.
(gpgsm_scd_pksign): New.
2006-10-06 Werner Koch <wk@g10code.com>
* Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
(gpgsm_LDADD): Ditto.
2006-10-05 Werner Koch <wk@g10code.com>
* certcheck.c (do_encode_md): Check that the has algo is valid.
2006-10-02 Marcus Brinkmann <marcus@g10code.de>
* server.c (register_commands): New commands DUMPKEYS and
DUMPSECRETKEYS.
(cmd_dumpkeys, cmd_dumpsecretkeys): New functions.
(option_handler): Support with-key-data option.
2006-09-26 Werner Koch <wk@g10code.com>
* certchain.c (gpgsm_validate_chain): More changes for the relax
feature. Use certificate reference counting instead of the old
explicit tests. Added a missing free.
2006-09-25 Werner Koch <wk@g10code.com>
* gpgsm.h (struct rootca_flags_s): New.
* call-agent.c (istrusted_status_cb): New.
(gpgsm_agent_istrusted): New arg ROOTCA_FLAGS.
* keylist.c (list_cert_colon): Use dummy for new arg.
* certchain.c (gpgsm_validate_chain): Make use of the relax flag
for root certificates.
(unknown_criticals): Ignore a GPG_ERR_NO_VALUE.
2006-09-20 Werner Koch <wk@g10code.com>
* gpgsm.c: Add alias command --dump-cert.
* Makefile.am: Changes to allow parallel make runs.
2006-09-18 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Use this to import standard certificates.
* keydb.c (keydb_add_resource): New arg AUTO_CREATED.
2006-09-14 Werner Koch <wk@g10code.com>
Replaced all call gpg_error_from_errno(errno) by
gpg_error_from_syserror().
2006-09-13 Werner Koch <wk@g10code.com>
* keylist.c (list_internal_keys): Print marker line to FP and not
to stdout.
* gpgsm.c (main): All list key list commands now make ose of
--output. Cleaned up calls to list modes. New command
--dump-chain. Renamed --list-sigs to --list-chain and added an
alias for the old one.
* server.c (cmd_message): Changed to use assuan_command_parse_fd.
(option_handler): New option list-to-output.
(do_listkeys): Use it.
2006-09-06 Werner Koch <wk@g10code.com>
* gpgsm.h (OUT_OF_CORE): Removed and changed all callers to
out_of_core.
(CTRL): Removed and changed everywhere to ctrl_t.
(CERTLIST): Ditto.
Replaced all Assuan error codes by libgpg-error codes. Removed
all map_to_assuan_status and map_assuan_err.
* gpgsm.c (main): Call assuan_set_assuan_err_source to have Assuan
switch to gpg-error codes.
* server.c (set_error): Adjusted.
2006-08-29 Werner Koch <wk@g10code.com>
* call-agent.c (gpgsm_agent_pkdecrypt): Allow decryption using
complete S-expressions as implemented by the current gpg-agent.
* gpgsm.c (main): Implement --output for encrypt, decrypt, sign
and export.
2006-07-03 Werner Koch <wk@g10code.com>
* certreqgen.c (proc_parameters): Print the component label of a
faulty DN.
2006-06-26 Werner Koch <wk@g10code.com>
* certdump.c (gpgsm_cert_log_name): New.
* certchain.c (is_cert_still_valid): Log the name of the certificate.
2006-06-20 Werner Koch <wk@g10code.com>
* gpgsm.c (gpgsm_init_default_ctrl): Take care of the command line
option --include-certs.
* keylist.c (list_cert_raw): Print the certid.
2006-05-23 Werner Koch <wk@g10code.com>
* keydb.c (hextobyte): Deleted as it is now defined in jnlib.
* Makefile.am (gpgsm_LDADD): Include ZLIBS.
2006-05-19 Marcus Brinkmann <marcus@g10code.de>
* keydb.c (keydb_insert_cert): Do not lock here, but only check if
it is locked.
(keydb_store_cert): Lock here.
* keydb.h (keydb_delete): Accept new argument UNLOCK.
* keydb.c (keydb_delete): Likewise. Only unlock if this is set.
* delete.c (delete_one): Add new argument to invocation of
keydb_delete.
2006-05-15 Werner Koch <wk@g10code.com>
* keylist.c (print_names_raw): Sanitize URI.
2006-03-21 Werner Koch <wk@g10code.com>
* certchain.c (get_regtp_ca_info): New.
(allowed_ca): Use it.
2006-03-20 Werner Koch <wk@g10code.com>
* qualified.c (gpgsm_is_in_qualified_list): New optional arg COUNTRY.
2006-02-17 Werner Koch <wk@g10code.com>
* call-dirmngr.c (start_dirmngr): Print name of dirmngr to be started.
2005-11-23 Werner Koch <wk@g10code.com>
* gpgsm.h: New member QUALSIG_APPROVAL.
* sign.c (gpgsm_sign): Print a warning if a certificate is not
qualified.
* qualified.c (gpgsm_qualified_consent): Include a note that this
is not approved software.
(gpgsm_not_qualified_warning): New.
* gpgsm.c (main): Prepared to print a note whether the software
has been approved.
2005-11-13 Werner Koch <wk@g10code.com>
* call-agent.c (gpgsm_agent_get_confirmation): New.
* keylist.c (list_cert_std): Print qualified status.
* qualified.c: New.
* certchain.c (gpgsm_validate_chain): Check for qualified
certificates.
* certchain.c (gpgsm_basic_cert_check): Release keydb handle when
no-chain-validation is used.
2005-11-11 Werner Koch <wk@g10code.com>
* keylist.c (print_capabilities): Print is_qualified status.
2005-10-28 Werner Koch <wk@g10code.com>
* certdump.c (pretty_print_sexp): New.
(gpgsm_print_name2): Use it here. This allows proper printing of
DNS names as used with server certificates.
2005-10-10 Werner Koch <wk@g10code.com>
* keylist.c: Add pkaAdress OID as reference.
2005-10-08 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (gpgsm_LDADD): Add ../gl/libgnu.a after
../common/libcommon.a.
2005-09-13 Werner Koch <wk@g10code.com>
* verify.c (gpgsm_verify): Print a note if the unknown algorithm
is MD2.
* sign.c (gpgsm_sign): Ditto.
* certcheck.c (gpgsm_check_cert_sig): Ditto.
2005-09-08 Werner Koch <wk@g10code.com>
* export.c (popen_protect_tool): Add option --have-cert. We
probably lost this option with 1.9.14 due to restructuring of
export.c.
2005-07-21 Werner Koch <wk@g10code.com>
* gpgsm.c (main): New options --no-log-file and --debug-none.
* certreqgen.c (get_parameter, get_parameter_value): Add SEQ arg
to allow enumeration. Changed all callers.
(create_request): Process DNS and URI parameters.
2005-07-20 Werner Koch <wk@g10code.com>
* keylist.c (email_kludge): Reworked.
* certdump.c (gpgsm_print_serial, gpgsm_dump_serial): Cast printf
arg to unsigned.
* call-dirmngr.c (gpgsm_dirmngr_run_command): Ditto
2005-07-19 Werner Koch <wk@g10code.com>
* fingerprint.c (gpgsm_get_certid): Cast printf arg to unsigned.
Bug accidently introduced while solving the #$%^& gcc
signed/unsigned char* warnings.
2005-06-15 Werner Koch <wk@g10code.com>
* delete.c (delete_one): Changed FPR to unsigned.
* encrypt.c (encrypt_dek): Made ENCVAL unsigned.
(gpgsm_encrypt): Ditto.
* sign.c (gpgsm_sign): Made SIGVAL unsigned.
* base64.c (base64_reader_cb): Need to use some casting to get
around signed/unsigned char* warnings.
* certcheck.c (gpgsm_check_cms_signature): Ditto.
(gpgsm_create_cms_signature): Changed arg R_SIGVAL to unsigned char*.
(do_encode_md): Made NFRAME a size_t.
* certdump.c (gpgsm_print_serial): Fixed signed/unsigned warning.
(gpgsm_dump_serial): Ditto.
(gpgsm_format_serial): Ditto.
(gpgsm_dump_string): Ditto.
(gpgsm_dump_cert): Ditto.
(parse_dn_part): Ditto.
(gpgsm_print_name2): Ditto.
* keylist.c (email_kludge): Ditto.
* certreqgen.c (proc_parameters, create_request): Ditto.
(create_request): Ditto.
* call-agent.c (gpgsm_agent_pksign): Made arg R_BUF unsigned.
(struct cipher_parm_s): Made CIPHERTEXT unsigned.
(struct genkey_parm_s): Ditto.
* server.c (strcpy_escaped_plus): Made arg S signed char*.
* fingerprint.c (gpgsm_get_fingerprint): Made ARRAY unsigned.
(gpgsm_get_keygrip): Ditto.
* keydb.c (keydb_insert_cert): Made DIGEST unsigned.
(keydb_update_cert): Ditto.
(classify_user_id): Apply cast to signed/unsigned assignment.
(hextobyte): Ditto.
2005-06-01 Werner Koch <wk@g10code.com>
* misc.c: Include setenv.h.
2005-04-21 Werner Koch <wk@g10code.com>
* gpgsm.c: New options --{enable,disable}-trusted-cert-crl-check.
* certchain.c (gpgsm_validate_chain): Make use of it.
* certchain.c (gpgsm_validate_chain): Check revocations even for
expired certificates. This is required because on signature
verification an expired key is fine whereas a revoked one is not.
2005-04-20 Werner Koch <wk@g10code.com>
* Makefile.am (AM_CFLAGS): Add PTH_CFLAGS as noted by several folks.
2005-04-19 Werner Koch <wk@g10code.com>
* certchain.c (check_cert_policy): Print the diagnostic for a open
failure of policies.txt only in verbose mode or when it is not
ENOENT.
2005-04-17 Werner Koch <wk@g10code.com>
* call-dirmngr.c (inq_certificate): Add new inquire SENDCERT_SKI.
* certlist.c (gpgsm_find_cert): Add new arg KEYID and implement
this filter. Changed all callers.
* certchain.c (find_up_search_by_keyid): New helper.
(find_up): Also try using the AKI.keyIdentifier.
(find_up_external): Ditto.
2005-04-15 Werner Koch <wk@g10code.com>
* keylist.c (list_cert_raw): Print the subjectKeyIdentifier as
well as the keyIdentifier part of the authorityKeyIdentifier.
2005-03-31 Werner Koch <wk@g10code.com>
* call-dirmngr.c (start_dirmngr): Use PATHSEP_C instead of ':'.
* call-agent.c (start_agent): Ditto.
2005-03-17 Werner Koch <wk@g10code.com>
* certcheck.c: Fixed use of DBG_CRYPTO and DBG_X509.
* certchain.c (gpgsm_basic_cert_check): Dump certificates after a
failed gcry_pk_verify.
(find_up): Do an external lookup also for an authorityKeyIdentifier
lookup. Factored external lookup code out to ..
(find_up_external): .. new.
2005-03-03 Werner Koch <wk@g10code.com>
* Makefile.am (gpgsm_LDADD): Added PTH_LIBS. Noted by Kazu Yamamoto.
2005-01-13 Werner Koch <wk@g10code.com>
* certreqgen.c (proc_parameters): Cast printf arg.
2004-12-22 Werner Koch <wk@g10code.com>
* gpgsm.c (set_binary): New.
(main, open_read, open_fwrite): Use it.
2004-12-21 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Use default_homedir().
(main) [W32]: Default to disabled CRL checks.
2004-12-20 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Before starting a pipe server start
to connect to a server on the standard socket. Use PATHSEP
* call-dirmngr.c (start_dirmngr): Use PATHSEP.
* import.c: Include unistd.h for dup and close.
2004-12-18 Werner Koch <wk@g10code.com>
* gpgsm.h (map_assuan_err): Define in terms of
map_assuan_err_with_source.
* call-agent.c (start_agent): Pass error source to
send_pinentry_environment.
2004-12-17 Werner Koch <wk@g10code.com>
* call-dirmngr.c (isvalid_status_cb, lookup_status_cb)
(run_command_status_cb): Return cancel status if gpgsm_status
returned an error.
* server.c (gpgsm_status, gpgsm_status2)
(gpgsm_status_with_err_code): Return an error code.
(gpgsm_status2): Always call va_end().
2004-12-15 Werner Koch <wk@g10code.com>
* call-dirmngr.c (lookup_status_cb): Send progress messages
upstream.
(isvalid_status_cb): Ditto.
(gpgsm_dirmngr_isvalid): Put CTRL into status CB parameters.
(gpgsm_dirmngr_run_command, run_command_status_cb): Pass CTRL to
status callback and handle PROGRESS.
* misc.c (setup_pinentry_env) [W32]: Don't use it.
* gpgsm.c (main) [W32]: Init Pth because we need it for the socket
operations and to resolve libassuan symbols.
(run_protect_tool) [W32]: Disable it.
* Makefile.am (gpgsm_LDADD): Move LIBASSUAN_LIBS more to the end.
2004-12-07 Werner Koch <wk@g10code.com>
* Makefile.am (gpgsm_LDADD): Put libassuan before jnlib because
under W32 we need the w32 pth code from jnlib.
* misc.c (setup_pinentry_env) [W32]: Disabled.
2004-12-06 Werner Koch <wk@g10code.com>
* gpgsm.c (run_protect_tool) [_WIN32]: Disabled.
* import.c (popen_protect_tool): Simplified by making use of
gnupg_spawn_process.
(parse_p12): Likewise, using gnupg_wait_process.
* export.c (popen_protect_tool): Ditto.
(export_p12): Ditto.
* keydb.c: Don't define DIRSEP_S here.
2004-12-02 Werner Koch <wk@g10code.com>
* certchain.c (gpgsm_basic_cert_check): Dump certs with bad
signature for debugging.
(gpgsm_validate_chain): Ditto.
2004-11-29 Werner Koch <wk@g10code.com>
* gpgsm.c (set_debug): Changed to use a globals DEBUG_LEVEL and
DEBUG_VALUE.
(main): Made DEBUG_LEVEL global and introduced DEBUG_VALUE. This
now allows to add debug flags on top of a debug-level setting.
2004-11-23 Werner Koch <wk@g10code.com>
* gpgsm.c: New option --prefer-system-dirmngr.
* call-dirmngr.c (start_dirmngr): Implement this option.
2004-10-22 Werner Koch <wk@g10code.com>
* certreqgen.c (gpgsm_genkey): Remove the NEW from the certificate
request PEM header. This is according to the Sphinx standard.
2004-10-08 Moritz Schulte <moritz@g10code.com>
* certchain.c (gpgsm_validate_chain): Do not use keydb_new() in
case the no_chain_validation-return-short-cut is used (fixes
memory leak).
2004-10-04 Werner Koch <wk@g10code.com>
* misc.c (setup_pinentry_env): Try hard to set a default for GPG_TTY.
2004-09-30 Werner Koch <wk@g10code.com>
* gpgsm.c (i18n_init): Always use LC_ALL.
* certdump.c (gpgsm_format_name): Factored code out to ..
(gpgsm_format_name2): .. new.
(gpgsm_print_name): Factored code out to ..
(gpgsm_print_name2): .. new.
(print_dn_part): New arg TRANSLATE. Changed all callers.
(print_dn_parts): Ditto.
(gpgsm_format_keydesc): Do not translate the SUBJECT; we require
it to stay UTF-8 but we still want to filter out bad control
characters.
* Makefile.am: Adjusted for gettext 0.14.
* keylist.c (list_cert_colon): Make sure that the expired flag has
a higher precedence than the invalid flag.
2004-09-29 Werner Koch <wk@g10code.com>
* import.c (parse_p12): Write an error status line for bad
passphrases. Add new arg CTRL and changed caller.
* export.c (export_p12): Likewise.
2004-09-14 Werner Koch <wk@g10code.com>
* certchain.c (gpgsm_validate_chain): Give expired certificates a
higher error precedence and don't bother to check any CRL in that
case.
2004-08-24 Werner Koch <wk@g10code.de>
* certlist.c: Fixed typo in ocsp OID.
2004-08-18 Werner Koch <wk@g10code.de>
* certlist.c (gpgsm_cert_use_ocsp_p): New.
(cert_usage_p): Support it here.
* call-dirmngr.c (gpgsm_dirmngr_isvalid): Use it here.
2004-08-17 Marcus Brinkmann <marcus@g10code.de>
* import.c: Fix typo in last change.
2004-08-17 Werner Koch <wk@g10code.de>
* import.c (check_and_store): Do a full validation if
--with-validation is set.
* certchain.c (gpgsm_basic_cert_check): Print more detailed error
messages.
* certcheck.c (do_encode_md): Partly support DSA. Add new arg
PKALGO. Changed all callers to pass it.
(pk_algo_from_sexp): New.
2004-08-16 Werner Koch <wk@g10code.de>
* gpgsm.c: New option --fixed-passphrase.
* import.c (popen_protect_tool): Pass it to the protect-tool.
* server.c (cmd_encrypt): Use DEFAULT_RECPLIST and not recplist
for encrypt-to keys.
2004-08-06 Werner Koch <wk@g10code.com>
* gpgsm.c: New option --with-ephemeral-keys.
* keylist.c (list_internal_keys): Set it here.
(list_cert_raw): And indicate those keys. Changed all our callers
to pass the new arg HD through.
2004-07-23 Werner Koch <wk@g10code.de>
* certreqgen.c (proc_parameters): Do not allow key length below
1024.
2004-07-22 Werner Koch <wk@g10code.de>
* keylist.c (list_cert_raw): Print the keygrip.
2004-07-20 Werner Koch <wk@gnupg.org>
* certchain.c (gpgsm_validate_chain): The trust check didn't
worked anymore, probably due to the changes at 2003-03-04. Fixed.
2004-06-06 Werner Koch <wk@gnupg.org>
* certreqgen.c (get_parameter_uint, create_request): Create
an extension for key usage when requested.
2004-05-12 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Install emergency_cleanup also as an atexit
handler.
* verify.c (gpgsm_verify): Removed the separate error code
handling for KSBA. We use shared error codes anyway.
* export.c (export_p12): Removed debugging code.
* encrypt.c (gpgsm_encrypt): Put the session key in to secure memory.
2004-05-11 Werner Koch <wk@gnupg.org>
* sign.c (gpgsm_sign): Include the error source in the final error
message.
* decrypt.c (gpgsm_decrypt): Ditto.
* fingerprint.c (gpgsm_get_key_algo_info): New.
* sign.c (gpgsm_sign): Don't assume RSA in the status line.
* keylist.c (list_cert_colon): Really print the algorithm and key
length.
(list_cert_raw, list_cert_std): Ditto.
(list_cert_colon): Reorganized to be able to tell whether a root
certificate is trusted.
* gpgsm.c: New option --debug-allow-core-dump.
* gpgsm.h (opt): Add member CONFIG_FILENAME.
* gpgsm.c (main): Use it here instead of the local var.
* server.c (gpgsm_server): Print some additional information with
the hello in verbose mode.
2004-04-30 Werner Koch <wk@gnupg.org>
* import.c (check_and_store): Do not update the stats for hidden
imports of issuer certs.
(popen_protect_tool): Request statusmessages from the protect-tool.
(parse_p12): Detect status messages. Add new arg STATS and update them.
(print_imported_summary): Include secret key stats.
2004-04-28 Werner Koch <wk@gnupg.org>
* gpgsm.c: New command --keydb-clear-some-cert-flags.
* keydb.c (keydb_clear_some_cert_flags): New.
(keydb_update_keyblock, keydb_set_flags): Change error code
CONFLICT to NOT_LOCKED.
2004-04-26 Werner Koch <wk@gnupg.org>
* gpgsm.c (main) <gpgconf>: Do not use /dev/null as default config
filename.
* call-agent.c (gpgsm_agent_pksign, gpgsm_agent_pkdecrypt)
(gpgsm_agent_genkey, gpgsm_agent_istrusted)
(gpgsm_agent_marktrusted, gpgsm_agent_havekey)
(gpgsm_agent_passwd): Add new arg CTRL and changed all callers.
(start_agent): New arg CTRL. Send progress item when starting a
new agent.
* sign.c (gpgsm_get_default_cert, get_default_signer): New arg
CTRL to be passed down to the agent function.
* decrypt.c (prepare_decryption): Ditto.
* certreqgen.c (proc_parameters, read_parameters): Ditto.
* certcheck.c (gpgsm_create_cms_signature): Ditto.
2004-04-23 Werner Koch <wk@gnupg.org>
* keydb.c (keydb_add_resource): Try to compress the file on init.
* keylist.c (oidtranstbl): New. OIDs collected from several sources.
(print_name_raw, print_names_raw, list_cert_raw): New.
(gpgsm_list_keys): Check the dump mode and pass it down as
necessary.
2004-04-22 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): New commands --dump-keys, --dump-external-keys,
--dump-secret-keys.
2004-04-13 Werner Koch <wk@gnupg.org>
* misc.c (setup_pinentry_env): New.
* import.c (popen_protect_tool): Call it.
* export.c (popen_protect_tool): Call it.
2004-04-08 Werner Koch <wk@gnupg.org>
* decrypt.c (gpgsm_decrypt): Return GPG_ERR_NO_DATA if it is not a
encrypted message.
2004-04-07 Werner Koch <wk@gnupg.org>
* gpgsm.c: New option --force-crl-refresh.
* call-dirmngr.c (gpgsm_dirmngr_isvalid): Pass option to dirmngr.
2004-04-05 Werner Koch <wk@gnupg.org>
* server.c (get_status_string): Add STATUS_NEWSIG.
* verify.c (gpgsm_verify): Print STATUS_NEWSIG for each signature.
* certchain.c (gpgsm_validate_chain) <gpgsm_cert_use_cer_p>: Do
not just warn if a cert is not suitable; bail out immediately.
2004-04-01 Werner Koch <wk@gnupg.org>
* call-dirmngr.c (isvalid_status_cb): New.
(unhexify_fpr): New. Taken from ../g10/call-agent.c
(gpgsm_dirmngr_isvalid): Add new arg CTRL, changed caller to pass
it thru. Detect need to check the respondert cert and do that.
* certchain.c (gpgsm_validate_chain): Add new arg FLAGS. Changed
all callers.
2004-03-24 Werner Koch <wk@gnupg.org>
* sign.c (gpgsm_sign): Include a short list of capabilities.
2004-03-17 Werner Koch <wk@gnupg.org>
* gpgsm.c (main) <gpgconf>: Fixed default value quoting.
2004-03-16 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Implemented --gpgconf-list.
2004-03-15 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Hack to set the expired flag.
2004-03-09 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Correctly intitialze USE_OCSP flag.
* keydb.c (keydb_delete): s/GPG_ERR_CONFLICT/GPG_ERR_NOT_LOCKED/
2004-03-04 Werner Koch <wk@gnupg.org>
* call-dirmngr.c (gpgsm_dirmngr_isvalid): New arg ISSUER_CERT.
* certchain.c (is_cert_still_valid): New. Code moved from ...
(gpgsm_validate_chain): ... here because we now need to check at
two places and at a later stage, so that we can pass the issuer
cert down to the dirmngr.
2004-03-03 Werner Koch <wk@gnupg.org>
* call-agent.c (start_agent): Replaced pinentry setup code by a
call to a new common function.
* certdump.c (gpgsm_format_keydesc): Make sure the string is
returned as utf-8.
* export.c (gpgsm_export): Make sure that we don't export more
than one certificate.
2004-03-02 Werner Koch <wk@gnupg.org>
* export.c (create_duptable, destroy_duptable)
(insert_duptable): New.
(gpgsm_export): Avoid duplicates.
2004-02-26 Werner Koch <wk@gnupg.org>
* certchain.c (compare_certs): New.
(gpgsm_validate_chain): Fixed infinite certificate checks after
bad signatures.
2004-02-24 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Print the fingerprint as the
cert-id for root certificates.
2004-02-21 Werner Koch <wk@gnupg.org>
* keylist.c (list_internal_keys): Return error codes.
(list_external_keys, gpgsm_list_keys): Ditto.
* server.c (do_listkeys): Ditto.
* gpgsm.c (main): Display a key description for --passwd.
* call-agent.c (gpgsm_agent_passwd): New arg DESC.
2004-02-20 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): New option --debug-ignore-expiration.
* certchain.c (gpgsm_validate_chain): Use it here.
* certlist.c (cert_usage_p): Apply extKeyUsage.
2004-02-19 Werner Koch <wk@gnupg.org>
* export.c (export_p12, popen_protect_tool)
(gpgsm_p12_export): New.
* gpgsm.c (main): New command --export-secret-key-p12.
2004-02-18 Werner Koch <wk@gnupg.org>
* gpgsm.c (set_debug): Set the new --debug-level flags.
(main): New option --gpgconf-list.
(main): Do not setup -u and -r keys when not required.
(main): Setup the used character set.
* keydb.c (keydb_add_resource): Print a hint to start the
gpg-agent.
2004-02-17 Werner Koch <wk@gnupg.org>
* gpgsm.c: Fixed value parsing for --with-validation.
* call-agent.c (start_agent): Ignore an empty GPG_AGENT_INFO.
* call-dirmngr.c (start_dirmngr): Likewise for DIRMNGR_INFO.
* gpgsm.c: New option --with-md5-fingerprint.
* keylist.c (list_cert_std): Print MD5 fpr.
* gpgsm.c: New options --with-validation.
* server.c (option_handler): New option "with-validation".
* keylist.c (list_cert_std, list_internal_keys): New args CTRL and
WITH_VALIDATION. Changed callers to set it.
(list_external_cb, list_external_keys): Pass CTRL to the callback.
(list_cert_colon): Add arg CTRL. Check validation if requested.
* certchain.c (unknown_criticals, allowed_ca, check_cert_policy)
(gpgsm_validate_chain): New args LISTMODE and FP.
(do_list): New helper for info output.
(find_up): New arg FIND_NEXT.
(gpgsm_validate_chain): After a bad signature try again with other
CA certificates.
* import.c (print_imported_status): New arg NEW_CERT. Print
additional STATUS_IMPORT_OK becuase that is what gpgme expects.
(check_and_store): Always call above function after import.
* server.c (get_status_string): Added STATUS_IMPORT_OK.
2004-02-13 Werner Koch <wk@gnupg.org>
* certcheck.c (gpgsm_create_cms_signature): Format a description
for use by the pinentry.
* decrypt.c (gpgsm_decrypt): Ditto. Free HEXKEYGRIP.
* certdump.c (format_name_cookie, format_name_writer)
(gpgsm_format_name): New.
(gpgsm_format_serial): New.
(gpgsm_format_keydesc): New.
* call-agent.c (gpgsm_agent_pksign): New arg DESC.
(gpgsm_agent_pkdecrypt): Ditto.
* encrypt.c (init_dek): Check for too weak algorithms.
* import.c (parse_p12, popen_protect_tool): New.
* base64.c (gpgsm_create_reader): New arg ALLOW_MULTI_PEM.
Changed all callers.
(base64_reader_cb): Handle it here.
(gpgsm_reader_eof_seen): New.
(base64_reader_cb): Set a flag for EOF.
(simple_reader_cb): Ditto.
2004-02-12 Werner Koch <wk@gnupg.org>
* gpgsm.h, gpgsm.c: New option --protect-tool-program.
* gpgsm.c (run_protect_tool): Use it.
2004-02-11 Werner Koch <wk@gnupg.org>
* Makefile.am (AM_CPPFLAGS): Pass directory constants via -D; this
will allow to override directory names at make time.
2004-02-02 Werner Koch <wk@gnupg.org>
* import.c (check_and_store): Import certificates even with
missing issuer's cert. Fixed an "depending on the verbose
setting" bug.
* certchain.c (gpgsm_validate_chain): Mark revoked certs in the
keybox.
* keylist.c (list_cert_colon): New arg VALIDITY; use it to print a
revoked flag.
(list_internal_keys): Retrieve validity flag.
(list_external_cb): Pass 0 as validity flag.
* keydb.c (keydb_get_flags, keydb_set_flags): New.
(keydb_set_cert_flags): New.
(lock_all): Return a proper error code.
(keydb_lock): New.
(keydb_delete): Don't lock but check that it has been locked.
(keydb_update_keyblock): Ditto.
* delete.c (delete_one): Take a lock.
2004-01-30 Werner Koch <wk@gnupg.org>
* certchain.c (check_cert_policy): Fixed read error checking.
(check_cert_policy): With no critical policies issue only a
warning if the policy file does not exists.
* sign.c (add_certificate_list): Decrement N for the first cert.
2004-01-29 Werner Koch <wk@gnupg.org>
* certdump.c (parse_dn_part): Map common OIDs to human readable
labels. Make sure that a value won't get truncated if it includes
a Nul.
2004-01-28 Werner Koch <wk@gnupg.org>
* certchain.c (gpgsm_validate_chain): Changed the message printed
for an untrusted root certificate.
2004-01-27 Werner Koch <wk@gnupg.org>
* certdump.c (parse_dn_part): Pretty print the nameDistinguisher OID.
(print_dn_part): Do not delimit multiple RDN by " + ". Handle
multi-valued RDNs in a special way, i.e. in the order specified by
the certificate.
(print_dn_parts): Simplified.
2004-01-16 Werner Koch <wk@gnupg.org>
* sign.c (gpgsm_sign): Print an error message on all failures.
* decrypt.c (gpgsm_decrypt): Ditto.
2003-12-17 Werner Koch <wk@gnupg.org>
* server.c (gpgsm_server): Add arg DEFAULT_RECPLIST.
(cmd_encrypt): Add all enrypt-to marked certs to the list.
* encrypt.c (gpgsm_encrypt): Check that real recipients are
available.
* gpgsm.c (main): Make the --encrypt-to and --no-encrypt-to
options work. Pass the list of recients to gpgsm_server.
* gpgsm.h (certlist_s): Add field IS_ENCRYPT_TO.
(opt): Add NO_ENCRYPT_TO.
* certlist.c (gpgsm_add_to_certlist): New arg IS_ENCRYPT_TO.
Changed all callers and ignore duplicate entries.
(is_cert_in_certlist): New.
(gpgsm_add_cert_to_certlist): New.
* certdump.c (gpgsm_print_serial): Cleaned up cast use in strtoul.
(gpgsm_dump_serial): Ditto.
* decrypt.c (gpgsm_decrypt): Replaced ERR by RC.
2003-12-16 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Set the prefixes for assuan logging.
* sign.c (gpgsm_sign): Add validation checks for the default
certificate.
* gpgsm.c: Add -k as alias for --list-keys and -K for
--list-secret-keys.
2003-12-15 Werner Koch <wk@gnupg.org>
* encrypt.c (init_dek): Use gry_create_nonce for the IV; there is
not need for real strong random here and it even better protect
the random bits used for the key.
2003-12-01 Werner Koch <wk@gnupg.org>
* gpgsm.c, gpgsm.h: New options --{enable,disable}-ocsp.
(gpgsm_init_default_ctrl): Set USE_OCSP to the default value.
* certchain.c (gpgsm_validate_chain): Handle USE_OCSP.
* call-dirmngr.c (gpgsm_dirmngr_isvalid): Add arg USE_OCSP and
proceed accordingly.
2003-11-19 Werner Koch <wk@gnupg.org>
* verify.c (gpgsm_verify): Use "0" instead of an empty string for
the VALIDSIG status.
2003-11-18 Werner Koch <wk@gnupg.org>
* verify.c (gpgsm_verify): Fixed for changes API of gcry_md_info.
* certchain.c (unknown_criticals): Fixed an error code test.
2003-11-12 Werner Koch <wk@gnupg.org>
Adjusted for API changes in Libksba.
2003-10-31 Werner Koch <wk@gnupg.org>
* certchain.c (gpgsm_validate_chain): Changed to use ksba_isotime_t.
* verify.c (strtimestamp_r, gpgsm_verify): Ditto.
* sign.c (gpgsm_sign): Ditto.
* keylist.c (print_time, list_cert_std, list_cert_colon): Ditto.
* certdump.c (gpgsm_print_time, gpgsm_dump_time, gpgsm_dump_cert):
Ditto.
2003-10-25 Werner Koch <wk@gnupg.org>
* certreqgen.c (read_parameters): Fixed faulty of !spacep().
2003-08-20 Marcus Brinkmann <marcus@g10code.de>
* encrypt.c (encode_session_key): Allocate enough space. Cast key
byte to unsigned char to prevent sign extension.
(encrypt_dek): Check return value before error.
2003-08-14 Timo Schulz <twoaday@freakmail.de>
* encrypt.c (encode_session_key): Use new Libgcrypt interface.
2003-07-31 Werner Koch <wk@gnupg.org>
* Makefile.am (gpgsm_LDADD): Added INTLLIBS.
2003-07-29 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Add secmem features and set the random seed file.
(gpgsm_exit): Update the random seed file and enable debug output.
2003-07-27 Werner Koch <wk@gnupg.org>
Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2003-06-24 Werner Koch <wk@gnupg.org>
* server.c (gpgsm_status_with_err_code): New.
* verify.c (gpgsm_verify): Use it here instead of the old
tokenizing version.
* verify.c (strtimestamp): Renamed to strtimestamp_r
Adjusted for changes in the libgcrypt API. Some more fixes for the
libgpg-error stuff.
2003-06-04 Werner Koch <wk@gnupg.org>
* call-agent.c (init_membuf,put_membuf,get_membuf): Removed.
Include new membuf header and changed used type.
Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2003-06-03 Werner Koch <wk@gnupg.org>
Changed all error codes in all files to the new libgpg-error scheme.
* gpgsm.h: Include gpg-error.h .
* Makefile.am: Link with libgpg-error.
2003-04-29 Werner Koch <wk@gnupg.org>
* Makefile.am: Use libassuan. Don't override LDFLAGS anymore.
* server.c (register_commands): Adjust for new Assuan semantics.
2002-12-03 Werner Koch <wk@gnupg.org>
* call-agent.c (gpgsm_agent_passwd): New.
* gpgsm.c (main): New command --passwd and --call-protect-tool
(run_protect_tool): New.
2002-11-25 Werner Koch <wk@gnupg.org>
* verify.c (gpgsm_verify): Handle content-type attribute.
2002-11-13 Werner Koch <wk@gnupg.org>
* call-agent.c (start_agent): Try to use $GPG_TTY instead of
ttyname. Changed ttyname to test stdin becuase it can be assumed
that output redirection is more common that input redirection.
2002-11-12 Werner Koch <wk@gnupg.org>
* gpgsm.c: New command --call-dirmngr.
* call-dirmngr.c (gpgsm_dirmngr_run_command)
(run_command_inq_cb,run_command_cb)
(run_command_status_cb): New.
2002-11-11 Werner Koch <wk@gnupg.org>
* certcheck.c (gpgsm_check_cms_signature): Don't double free
s_sig but free s_pkey at leave.
2002-11-10 Werner Koch <wk@gnupg.org>
* gpgsm.c: Removed duplicate --list-secret-key entry.
2002-09-19 Werner Koch <wk@gnupg.org>
* certcheck.c (gpgsm_check_cert_sig): Add cert hash debugging.
* certchain.c (find_up): Print info when the cert was not found
by the autorithyKeyIdentifier.
2002-09-03 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Disable the internal libgcrypt locking.
2002-08-21 Werner Koch <wk@gnupg.org>
* import.c (print_imported_summary): Cleaned up. Print new
not_imported value.
(check_and_store): Update non_imported counter.
(print_import_problem): New.
(check_and_store): Print error status message.
* server.c (get_status_string): Added STATUS_IMPORT_PROBLEM.
2002-08-20 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Use the log file only in server mode.
* import.c (print_imported_summary): New.
(check_and_store): Update the counters, take new argument.
(import_one): Factored out core of gpgsm_import.
(gpgsm_import): Print counters.
(gpgsm_import_files): New.
* gpgsm.c (main): Use the new function for import.
2002-08-19 Werner Koch <wk@gnupg.org>
* decrypt.c (gpgsm_decrypt): Return a better error status token.
* verify.c (gpgsm_verify): Don't error on messages with no signing
time or no message digest. This is only the case for messages
without any signed attributes.
2002-08-16 Werner Koch <wk@gnupg.org>
* certpath.c: Renamed to ..
* certchain.c: this. Renamed all all other usages of "path" in the
context of certificates to "chain".
* call-agent.c (learn_cb): Special treatment when the issuer
certificate is missing.
2002-08-10 Werner Koch <wk@gnupg.org>
* Makefile.am (INCLUDES): Add definition for localedir.
* keylist.c (list_cert_colon): Print the short fingerprint in the
key ID field.
* fingerprint.c (gpgsm_get_short_fingerprint): New.
* verify.c (gpgsm_verify): Print more verbose info for a good
signature.
2002-08-09 Werner Koch <wk@gnupg.org>
* decrypt.c (prepare_decryption): Hack to detected already
unpkcsedone keys.
* gpgsm.c (emergency_cleanup): New.
(main): Initialize the signal handler.
* sign.c (gpgsm_sign): Reset the hash context for subsequent
signers and release it at the end.
2002-08-05 Werner Koch <wk@gnupg.org>
* server.c (cmd_signer): New command "SIGNER"
(register_commands): Register it.
(cmd_sign): Pass the signer list to gpgsm_sign.
* certlist.c (gpgsm_add_to_certlist): Add SECRET argument, check
for secret key if set and changed all callers.
* sign.c (gpgsm_sign): New argument SIGNERLIST and implemt
multiple signers.
* gpgsm.c (main): Support more than one -u.
* server.c (cmd_recipient): Return reason code 1 for No_Public_Key
which is actually what gets returned from add_to_certlist.
2002-07-26 Werner Koch <wk@gnupg.org>
* certcheck.c (gpgsm_check_cert_sig): Implement proper cleanup.
(gpgsm_check_cms_signature): Ditto.
2002-07-22 Werner Koch <wk@gnupg.org>
* keydb.c (keydb_add_resource): Register a lock file.
(lock_all, unlock_all): Implemented.
* delete.c: New.
* gpgsm.c: Made --delete-key work.
* server.c (cmd_delkeys): New.
(register_commands): New command DELKEYS.
* decrypt.c (gpgsm_decrypt): Print a convenience note when RC2 is
used and a STATUS_ERROR with the algorithm oid.
2002-07-03 Werner Koch <wk@gnupg.org>
* server.c (gpgsm_status2): Insert a blank between all optional
arguments when using assuan.
* server.c (cmd_recipient): No more need for extra blank in constants.
* import.c (print_imported_status): Ditto.
* gpgsm.c (main): Ditto.
2002-07-02 Werner Koch <wk@gnupg.org>
* verify.c (gpgsm_verify): Extend the STATUS_BADSIG line with
the fingerprint.
* certpath.c (check_cert_policy): Don't use log_error to print a
warning.
* keydb.c (keydb_store_cert): Add optional ar EXISTED and changed
all callers.
* call-agent.c (learn_cb): Print info message only for real imports.
* import.c (gpgsm_import): Moved duplicated code to ...
(check_and_store): new function. Added magic to import the entire
chain. Print status only for real imports and moved printing code
to ..
(print_imported_status): New.
* call-dirmngr.c (gpgsm_dirmngr_isvalid): print status of dirmngr
call in very verbose mode.
* gpgsm.c (main): Use the same error codes for STATUS_INV_RECP as
with the server mode.
2002-06-29 Werner Koch <wk@gnupg.org>
* gpgsm.c: New option --auto-issuer-key-retrieve.
* certpath.c (find_up): Try to retrieve an issuer key from an
external source and from the ephemeral key DB.
(find_up_store_certs_cb): New.
* keydb.c (keydb_set_ephemeral): Does now return the old
state. Call the backend only when required.
* call-dirmngr.c (start_dirmngr): Use GNUPG_DEFAULT_DIRMNGR.
(lookup_status_cb): Issue status only when CTRL is not NULL.
(gpgsm_dirmngr_lookup): Document that CTRL is optional.
* call-agent.c (start_agent): Use GNUPG_DEFAULT_AGENT.
2002-06-28 Werner Koch <wk@gnupg.org>
* server.c (cmd_recipient): Add more reason codes.
2002-06-27 Werner Koch <wk@gnupg.org>
* certpath.c (gpgsm_basic_cert_check): Use
--debug-no-path-validation to also bypass this basic check.
* gpgsm.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
* call-agent.c (start_agent): Create and pass the list of FD to
keep in the child to assuan.
* call-dirmngr.c (start_dirmngr): Ditto.
2002-06-26 Werner Koch <wk@gnupg.org>
* import.c (gpgsm_import): Print an STATUS_IMPORTED.
* gpgsm.c: --debug-no-path-validation does not take an argument.
2002-06-25 Werner Koch <wk@gnupg.org>
* certdump.c (print_dn_part): Always print a leading slash,
removed NEED_DELIM arg and changed caller.
* export.c (gpgsm_export): Print LFs to FP and not stdout.
(print_short_info): Ditto. Make use of gpgsm_print_name.
* server.c (cmd_export): Use output-fd instead of data lines; this
was actually the specified way.
2002-06-24 Werner Koch <wk@gnupg.org>
* gpgsm.c: Removed duped help entry for --list-keys.
* gpgsm.c, gpgsm.h: New option --debug-no-path-validation.
* certpath.c (gpgsm_validate_path): Use it here instead of the
debug flag hack.
* certpath.c (check_cert_policy): Return No_Policy_Match if the
policy file could not be opened.
2002-06-20 Werner Koch <wk@gnupg.org>
* certlist.c (gpgsm_add_to_certlist): Fixed locating of a
certificate with the required key usage.
* gpgsm.c (main): Fixed a segv when using --outfile without an
argument.
* keylist.c (print_capabilities): Also check for non-repudiation
and data encipherment.
* certlist.c (cert_usage_p): Test for signing and encryption was
swapped. Add a case for certification usage, handle
non-repudiation and data encipherment.
(gpgsm_cert_use_cert_p): New.
(gpgsm_add_to_certlist): Added a CTRL argument and changed all
callers to pass it.
* certpath.c (gpgsm_validate_path): Use it here to print a status
message. Added a CTRL argument and changed all callers to pass it.
* decrypt.c (gpgsm_decrypt): Print a status message for wrong key
usage.
* verify.c (gpgsm_verify): Ditto.
* keydb.c (classify_user_id): Allow a colon delimited fingerprint.
2002-06-19 Werner Koch <wk@gnupg.org>
* call-agent.c (learn_cb): Use log_info instead of log_error on
successful import.
* keydb.c (keydb_set_ephemeral): New.
(keydb_store_cert): New are ephemeral, changed all callers.
* keylist.c (list_external_cb): Store cert as ephemeral.
* export.c (gpgsm_export): Kludge to export epehmeral certificates.
* gpgsm.c (main): New command --list-external-keys.
2002-06-17 Werner Koch <wk@gnupg.org>
* certreqgen.c (read_parameters): Improved error handling.
(gpgsm_genkey): Print error message.
2002-06-13 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): New option --log-file.
2002-06-12 Werner Koch <wk@gnupg.org>
* call-dirmngr.c (lookup_status_cb): New.
(gpgsm_dirmngr_lookup): Use the status CB. Add new arg CTRL and
changed caller to pass it.
* gpgsm.c (open_fwrite): New.
(main): Allow --output for --verify.
* sign.c (hash_and_copy_data): New.
(gpgsm_sign): Implemented normal (non-detached) signatures.
* gpgsm.c (main): Ditto.
* certpath.c (gpgsm_validate_path): Special error handling for
no policy match.
2002-06-10 Werner Koch <wk@gnupg.org>
* server.c (get_status_string): Add STATUS_ERROR.
* certpath.c (gpgsm_validate_path): Tweaked the error checking to
return error codes in a more sensitive way.
* verify.c (gpgsm_verify): Send status TRUST_NEVER also for a bad
CA certificate and when the certificate has been revoked. Issue
TRUST_FULLY even when the cert has expired. Append an error token
to these status lines. Issue the new generic error status when a
cert was not found and when leaving the function.
2002-06-04 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): New command --list-sigs
* keylist.c (list_cert_std): New. Use it whenever colon mode is
not used.
(list_cert_chain): New.
2002-05-31 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Don't print the "go ahead" message for an
invalid command.
2002-05-23 Werner Koch <wk@gnupg.org>
* import.c (gpgsm_import): Add error messages.
2002-05-21 Werner Koch <wk@gnupg.org>
* keylist.c (list_internal_keys): Renamed from gpgsm_list_keys.
(list_external_keys): New.
(gpgsm_list_keys): Dispatcher for above.
* call-dirmngr.c (lookup_cb,pattern_from_strlist)
(gpgsm_dirmngr_lookup): New.
* server.c (option_handler): Handle new option --list-mode.
(do_listkeys): Handle options and actually use the mode argument.
(get_status_string): New code TRUNCATED.
* import.c (gpgsm_import): Try to identify the type of input and
handle certs-only messages.
2002-05-14 Werner Koch <wk@gnupg.org>
* gpgsm.c: New option --faked-system-time
* sign.c (gpgsm_sign): And use it here.
* certpath.c (gpgsm_validate_path): Ditto.
2002-05-03 Werner Koch <wk@gnupg.org>
* certpath.c (gpgsm_validate_path): Added EXPTIME arg and changed
all callers.
* verify.c (gpgsm_verify): Tweaked usage of log_debug and
log_error. Return EXPSIG status and add expiretime to VALIDSIG.
2002-04-26 Werner Koch <wk@gnupg.org>
* gpgsm.h (DBG_AGENT,DBG_AGENT_VALUE): Replaced by DBG_ASSUAN_*.
Changed all users.
* call-agent.c (start_agent): Be more silent without -v.
* call-dirmngr.c (start_dirmngr): Ditto.
2002-04-25 Werner Koch <wk@gnupg.org>
* call-agent.c (start_agent): Make copies of old locales and check
for setlocale.
2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* call-agent.c (start_agent): Fix error handling logic so the
locale is always correctly reset.
2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* server.c (option_handler): Accept display, ttyname, ttytype,
lc_ctype and lc_messages options.
* gpgsm.c (main): Allocate memory for these options.
* gpgsm.h (struct opt): Make corresponding members non-const.
2002-04-24 Marcus Brinkmann <marcus@g10code.de>
* gpgsm.h (struct opt): New members display, ttyname, ttytype,
lc_ctype, lc_messages.
* gpgsm.c (enum cmd_and_opt_values): New members oDisplay,
oTTYname, oTTYtype, oLCctype, oLCmessages.
(opts): New entries for these options.
(main): Handle these new options.
* call-agent.c (start_agent): Set the various display and tty
parameter after resetting.
2002-04-18 Werner Koch <wk@gnupg.org>
* certreqgen.c (gpgsm_genkey): Write status output on success.
2002-04-15 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Check ksba version.
* certpath.c (find_up): New to use the authorithKeyIdentifier.
Use it in all other functions to locate the signing cert..
2002-04-11 Werner Koch <wk@gnupg.org>
* certlist.c (cert_usable_p): New.
(gpgsm_cert_use_sign_p,gpgsm_cert_use_encrypt_p): New.
(gpgsm_cert_use_verify_p,gpgsm_cert_use_decrypt_p): New.
(gpgsm_add_to_certlist): Check the key usage.
* sign.c (gpgsm_sign): Ditto.
* verify.c (gpgsm_verify): Print a message wehn an unsuitable
certificate was used.
* decrypt.c (gpgsm_decrypt): Ditto
* keylist.c (print_capabilities): Determine values from the cert.
2002-03-28 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Fixed listing of crt record; the
issuer is not at the right place. Print a chainingID.
* certpath.c (gpgsm_walk_cert_chain): Be a bit more silent on
common errors.
2002-03-21 Werner Koch <wk@gnupg.org>
* export.c: New.
* gpgsm.c: Add command --export.
* server.c (cmd_export): New.
2002-03-13 Werner Koch <wk@gnupg.org>
* decrypt.c (gpgsm_decrypt): Allow multiple recipients.
2002-03-12 Werner Koch <wk@gnupg.org>
* certpath.c (check_cert_policy): Print the policy list.
* verify.c (gpgsm_verify): Detect certs-only message.
2002-03-11 Werner Koch <wk@gnupg.org>
* import.c (gpgsm_import): Print a notice about imported certificates
when in verbose mode.
* gpgsm.c (main): Print INV_RECP status.
* server.c (cmd_recipient): Ditto.
* server.c (gpgsm_status2): New. Allows for a list of strings.
(gpgsm_status): Divert to gpgsm_status2.
* encrypt.c (gpgsm_encrypt): Don't use a default key when no
recipients are given. Print a NO_RECP status.
2002-03-06 Werner Koch <wk@gnupg.org>
* server.c (cmd_listkeys, cmd_listsecretkeys): Divert to
(do_listkeys): new. Add pattern parsing.
* keylist.c (gpgsm_list_keys): Handle selection pattern.
* gpgsm.c: New command --learn-card
* call-agent.c (learn_cb,gpgsm_agent_learn): New.
* gpgsm.c (main): Print error messages for non-implemented commands.
* base64.c (base64_reader_cb): Use case insensitive compare of the
Content-Type string to detect plain base-64.
2002-03-05 Werner Koch <wk@gnupg.org>
* gpgsm.c, gpgsm.h: Add local_user.
* sign.c (gpgsm_get_default_cert): New.
(get_default_signer): Use the new function if local_user is not
set otherwise used that value.
* encrypt.c (get_default_recipient): Removed.
(gpgsm_encrypt): Use gpgsm_get_default_cert.
* verify.c (gpgsm_verify): Better error text for a bad signature
found by comparing the hashs.
2002-02-27 Werner Koch <wk@gnupg.org>
* call-dirmngr.c, call-agent.c: Add 2 more arguments to all uses
of assuan_transact.
2002-02-25 Werner Koch <wk@gnupg.org>
* server.c (option_handler): Allow to use -2 for "send all certs
except the root cert".
* sign.c (add_certificate_list): Implement it here.
* certpath.c (gpgsm_is_root_cert): New.
2002-02-19 Werner Koch <wk@gnupg.org>
* certpath.c (check_cert_policy): New.
(gpgsm_validate_path): And call it from here.
* gpgsm.c (main): New options --policy-file,
--disable-policy-checks and --enable-policy-checks.
* gpgsm.h (opt): Added policy_file, no_policy_checks.
2002-02-18 Werner Koch <wk@gnupg.org>
* certpath.c (gpgsm_validate_path): Ask the agent to add the
certificate into the trusted list.
* call-agent.c (gpgsm_agent_marktrusted): New.
2002-02-07 Werner Koch <wk@gnupg.org>
* certlist.c (gpgsm_add_to_certlist): Check that the specified
name identifies a certificate unambiguously.
(gpgsm_find_cert): Ditto.
* server.c (cmd_listkeys): Check that the data stream is available.
(cmd_listsecretkeys): Ditto.
(has_option): New.
(cmd_sign): Fix ambiguousity in option recognition.
* gpgsm.c (main): Enable --logger-fd.
* encrypt.c (gpgsm_encrypt): Increased buffer size for better
performance.
* call-agent.c (gpgsm_agent_pksign): Check the S-Exp received from
the agent.
* keylist.c (list_cert_colon): Filter out control characters.
2002-02-06 Werner Koch <wk@gnupg.org>
* decrypt.c (gpgsm_decrypt): Bail out after an decryption error.
* server.c (reset_notify): Close input and output FDs.
(cmd_encrypt,cmd_decrypt,cmd_verify,cmd_sign.cmd_import)
(cmd_genkey): Close the FDs and release the recipient list even in
the error case.
2002-02-01 Marcus Brinkmann <marcus@g10code.de>
* sign.c (gpgsm_sign): Do not release certificate twice.
2002-01-29 Werner Koch <wk@gnupg.org>
* call-agent.c (gpgsm_agent_havekey): New.
* keylist.c (list_cert_colon): New arg HAVE_SECRET, print "crs"
when we know that the secret key is available.
(gpgsm_list_keys): New arg MODE, check whether a secret key is
available. Changed all callers.
* gpgsm.c (main): New command --list-secret-keys.
* server.c (cmd_listsecretkeys): New.
(cmd_listkeys): Return secret keys with "crs" record.
2002-01-28 Werner Koch <wk@gnupg.org>
* certreqgen.c (create_request): Store the email address in the req.
2002-01-25 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Disable core dumps.
* sign.c (add_certificate_list): New.
(gpgsm_sign): Add the certificates to the CMS object.
* certpath.c (gpgsm_walk_cert_chain): New.
* gpgsm.h (server_control_s): Add included_certs.
* gpgsm.c: Add option --include-certs.
(gpgsm_init_default_ctrl): New.
(main): Call it.
* server.c (gpgsm_server): Ditto.
(option_handler): Support --include-certs.
2002-01-23 Werner Koch <wk@gnupg.org>
* certpath.c (gpgsm_validate_path): Print the DN of a missing issuer.
* certdump.c (gpgsm_dump_string): New.
(print_dn): Replaced by above.
2002-01-22 Werner Koch <wk@gnupg.org>
* certpath.c (unknown_criticals): New.
(allowed_ca): New.
(gpgsm_validate_path): Check validity, CA attribute, path length
and unknown critical extensions.
2002-01-21 Werner Koch <wk@gnupg.org>
* gpgsm.c: Add option --enable-crl-checks.
* call-agent.c (start_agent): Implemented socket based access.
* call-dirmngr.c (start_dirmngr): Ditto.
2002-01-20 Werner Koch <wk@gnupg.org>
* server.c (option_handler): New.
(gpgsm_server): Register it with assuan.
2002-01-19 Werner Koch <wk@gnupg.org>
* server.c (gpgsm_server): Use assuan_deinit_server and setup
assuan logging if enabled.
* call-agent.c (inq_ciphertext_cb): Don't show the session key in
an Assuan log file.
* gpgsm.c (my_strusage): Take bugreport address from configure.ac
2002-01-15 Werner Koch <wk@gnupg.org>
* import.c (gpgsm_import): Just do a basic cert check before
storing it.
* certpath.c (gpgsm_basic_cert_check): New.
* keydb.c (keydb_store_cert): New.
* import.c (store_cert): Removed and change all caller to use
the new function.
* verify.c (store_cert): Ditto.
* certlist.c (gpgsm_add_to_certlist): Validate the path
* certpath.c (gpgsm_validate_path): Check the trust list.
* call-agent.c (gpgsm_agent_istrusted): New.
2002-01-14 Werner Koch <wk@gnupg.org>
* call-dirmngr.c (inq_certificate): Changed for new interface semantic.
* certlist.c (gpgsm_find_cert): New.
2002-01-13 Werner Koch <wk@gnupg.org>
* fingerprint.c (gpgsm_get_certid): Print the serial and not the
hash after the dot.
2002-01-11 Werner Koch <wk@gnupg.org>
* call-dirmngr.c: New.
* certpath.c (gpgsm_validate_path): Check the CRL here.
* fingerprint.c (gpgsm_get_certid): New.
* gpgsm.c: New options --dirmngr-program and --disable-crl-checks.
2002-01-10 Werner Koch <wk@gnupg.org>
* base64.c (gpgsm_create_writer): Allow to set the object name
2002-01-08 Werner Koch <wk@gnupg.org>
* keydb.c (spacep): Removed because it is now in util.c
* server.c (cmd_genkey): New.
* certreqgen.c: New. The parameter handling code has been taken
from gnupg/g10/keygen.c version 1.0.6.
* call-agent.c (gpgsm_agent_genkey): New.
2002-01-02 Werner Koch <wk@gnupg.org>
* server.c (rc_to_assuan_status): Removed and changed all callers
to use map_to_assuan_status.
2001-12-20 Werner Koch <wk@gnupg.org>
* verify.c (gpgsm_verify): Implemented non-detached signature
verification. Add OUT_FP arg, initialize a writer and changed all
callers.
* server.c (cmd_verify): Pass an out_fp if one has been set.
* base64.c (base64_reader_cb): Try to detect an S/MIME body part.
* certdump.c (print_sexp): Renamed to gpgsm_dump_serial, made
global.
(print_time): Renamed to gpgsm_dump_time, made global.
(gpgsm_dump_serial): Take a real S-Expression as argument and
print the first item.
* keylist.c (list_cert_colon): Ditto.
* keydb.c (keydb_search_issuer_sn): Ditto.
* decrypt.c (print_integer_sexp): Removed and made callers
use gpgsm_dump_serial.
* verify.c (print_time): Removed, made callers use gpgsm_dump_time.
2001-12-19 Marcus Brinkmann <marcus@g10code.de>
* call-agent.c (start_agent): Add new argument to assuan_pipe_connect.
2001-12-18 Werner Koch <wk@gnupg.org>
* verify.c (print_integer_sexp): Renamed from print_integer and
print the serial number according to the S-Exp rules.
* decrypt.c (print_integer_sexp): Ditto.
2001-12-17 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Changed for new return value of
get_serial.
* keydb.c (keydb_search_issuer_sn): Ditto.
* certcheck.c (gpgsm_check_cert_sig): Likewise for other S-Exp
returingin functions.
* fingerprint.c (gpgsm_get_keygrip): Ditto.
* encrypt.c (encrypt_dek): Ditto
* certcheck.c (gpgsm_check_cms_signature): Ditto
* decrypt.c (prepare_decryption): Ditto.
* call-agent.c (gpgsm_agent_pkdecrypt): Removed arg ciphertextlen,
use KsbaSexp type and calculate the length.
* certdump.c (print_sexp): Remaned from print_integer, changed caller.
* Makefile.am: Use the LIBGCRYPT and LIBKSBA variables.
* fingerprint.c (gpgsm_get_keygrip): Use the new
gcry_pk_get_keygrip to calculate the grip - note the algorithm and
therefore the grip values changed.
2001-12-15 Werner Koch <wk@gnupg.org>
* certcheck.c (gpgsm_check_cms_signature): Removed the faked-key
kludge.
(gpgsm_create_cms_signature): Removed the commented fake key
code. This makes the function pretty simple.
* gpgsm.c (main): Renamed the default key database to "keyring.kbx".
* decrypt.c (gpgsm_decrypt): Write STATUS_DECRYPTION_*.
* sign.c (gpgsm_sign): Write a STATUS_SIG_CREATED.
2001-12-14 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Kludge to show an email address
encoded in the subject's DN.
* verify.c (gpgsm_verify): Add hash debug helpers
* sign.c (gpgsm_sign): Ditto.
* base64.c (base64_reader_cb): Reset the linelen when we need to
skip the line and adjusted test; I somehow forgot about DeMorgan.
* server.c (cmd_encrypt,cmd_decrypt,cmd_sign,cmd_verify)
(cmd_import): Close the FDs on success.
(close_message_fd): New.
(input_notify): Setting autodetect_encoding to 0 after initializing
it to 0 is pretty pointless. Easy to fix.
* gpgsm.c (main): New option --debug-wait n, so that it is
possible to attach gdb when used in server mode.
* sign.c (get_default_signer): Use keydb_classify_name here.
2001-12-14 Marcus Brinkmann <marcus@g10code.de>
* call-agent.c (LINELENGTH): Removed.
(gpgsm_agent_pksign): Use ASSUAN_LINELENGTH, not LINELENGTH.
(gpgsm_agent_pkdecrypt): Likewise.
2001-12-13 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Print alternative names of subject
and a few other values.
2001-12-12 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): New options --assume-{armor,base64,binary}.
* base64.c (base64_reader_cb): Fixed non-autodetection mode.
2001-12-04 Werner Koch <wk@gnupg.org>
* call-agent.c (read_from_agent): Check for inquire responses.
(request_reply): Handle them using a new callback arg, changed all
callers.
(gpgsm_agent_pkdecrypt): New.
2001-11-27 Werner Koch <wk@gnupg.org>
* base64.c: New. Changed all other functions to use this instead
of direct creation of ksba_reader/writer.
* gpgsm.c (main): Set ctrl.auto_encoding unless --no-armor is used.
2001-11-26 Werner Koch <wk@gnupg.org>
* gpgsm.c: New option --agent-program
* call-agent.c (start_agent): Allow to override the default path
to the agent.
* keydb.c (keydb_add_resource): Create keybox
* keylist.c (gpgsm_list_keys): Fixed non-server keylisting.
* server.c (rc_to_assuan_status): New. Use it for all commands.
Copyright 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without
modifications, as long as this notice is preserved.
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/sm/encrypt.c b/sm/encrypt.c
index 016e98fd5..a526a649e 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -1,525 +1,513 @@
/* encrypt.c - Encrypt a message
* Copyright (C) 2001, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GnuPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <time.h>
#include <assert.h>
#include "gpgsm.h"
#include <gcrypt.h>
#include <ksba.h>
#include "keydb.h"
#include "i18n.h"
struct dek_s {
const char *algoid;
int algo;
gcry_cipher_hd_t chd;
char key[32];
int keylen;
char iv[32];
int ivlen;
};
typedef struct dek_s *DEK;
struct encrypt_cb_parm_s {
FILE *fp;
DEK dek;
int eof_seen;
int ready;
int readerror;
int bufsize;
unsigned char *buffer;
int buflen;
};
/* Initialize the data encryption key (session key). */
static int
init_dek (DEK dek)
{
int rc=0, mode, i;
dek->algo = gcry_cipher_map_name (dek->algoid);
mode = gcry_cipher_mode_from_oid (dek->algoid);
if (!dek->algo || !mode)
{
log_error ("unsupported algorithm `%s'\n", dek->algoid);
return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
}
/* Extra check for algorithms we consider to be too weak for
encryption, although we support them for decryption. Note that
there is another check below discriminating on the key length. */
switch (dek->algo)
{
case GCRY_CIPHER_DES:
case GCRY_CIPHER_RFC2268_40:
log_error ("cipher algorithm `%s' not allowed: too weak\n",
gcry_cipher_algo_name (dek->algo));
return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
default:
break;
}
dek->keylen = gcry_cipher_get_algo_keylen (dek->algo);
if (!dek->keylen || dek->keylen > sizeof (dek->key))
return gpg_error (GPG_ERR_BUG);
dek->ivlen = gcry_cipher_get_algo_blklen (dek->algo);
if (!dek->ivlen || dek->ivlen > sizeof (dek->iv))
return gpg_error (GPG_ERR_BUG);
/* Make sure we don't use weak keys. */
if (dek->keylen < 100/8)
{
log_error ("key length of `%s' too small\n", dek->algoid);
return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
}
rc = gcry_cipher_open (&dek->chd, dek->algo, mode, GCRY_CIPHER_SECURE);
if (rc)
{
log_error ("failed to create cipher context: %s\n", gpg_strerror (rc));
return rc;
}
for (i=0; i < 8; i++)
{
gcry_randomize (dek->key, dek->keylen, GCRY_STRONG_RANDOM );
rc = gcry_cipher_setkey (dek->chd, dek->key, dek->keylen);
if (gpg_err_code (rc) != GPG_ERR_WEAK_KEY)
break;
log_info(_("weak key created - retrying\n") );
}
if (rc)
{
log_error ("failed to set the key: %s\n", gpg_strerror (rc));
gcry_cipher_close (dek->chd);
dek->chd = NULL;
return rc;
}
gcry_create_nonce (dek->iv, dek->ivlen);
rc = gcry_cipher_setiv (dek->chd, dek->iv, dek->ivlen);
if (rc)
{
log_error ("failed to set the IV: %s\n", gpg_strerror (rc));
gcry_cipher_close (dek->chd);
dek->chd = NULL;
return rc;
}
return 0;
}
static int
encode_session_key (DEK dek, gcry_sexp_t * r_data)
{
gcry_sexp_t data;
char *p;
int rc;
p = xtrymalloc (64 + 2 * dek->keylen);
if (!p)
return gpg_error_from_syserror ();
strcpy (p, "(data\n (flags pkcs1)\n (value #");
bin2hex (dek->key, dek->keylen, p + strlen (p));
strcat (p, "#))\n");
rc = gcry_sexp_sscan (&data, NULL, p, strlen (p));
xfree (p);
*r_data = data;
return rc;
}
/* Encrypt the DEK under the key contained in CERT and return it as a
canonical S-Exp in encval. */
static int
encrypt_dek (const DEK dek, ksba_cert_t cert, unsigned char **encval)
{
gcry_sexp_t s_ciph, s_data, s_pkey;
int rc;
ksba_sexp_t buf;
size_t len;
*encval = NULL;
/* get the key from the cert */
buf = ksba_cert_get_public_key (cert);
if (!buf)
{
log_error ("no public key for recipient\n");
return gpg_error (GPG_ERR_NO_PUBKEY);
}
len = gcry_sexp_canon_len (buf, 0, NULL, NULL);
if (!len)
{
log_error ("libksba did not return a proper S-Exp\n");
return gpg_error (GPG_ERR_BUG);
}
rc = gcry_sexp_sscan (&s_pkey, NULL, (char*)buf, len);
xfree (buf); buf = NULL;
if (rc)
{
log_error ("gcry_sexp_scan failed: %s\n", gpg_strerror (rc));
return rc;
}
/* Put the encoded cleartext into a simple list. */
s_data = NULL; /* (avoid compiler warning) */
rc = encode_session_key (dek, &s_data);
if (rc)
{
log_error ("encode_session_key failed: %s\n", gpg_strerror (rc));
return rc;
}
/* pass it to libgcrypt */
rc = gcry_pk_encrypt (&s_ciph, s_data, s_pkey);
gcry_sexp_release (s_data);
gcry_sexp_release (s_pkey);
- /* reformat it */
- len = gcry_sexp_sprint (s_ciph, GCRYSEXP_FMT_CANON, NULL, 0);
- assert (len);
- buf = xtrymalloc (len);
- if (!buf)
- {
- gpg_error_t tmperr = out_of_core ();
- gcry_sexp_release (s_ciph);
- return tmperr;
- }
- len = gcry_sexp_sprint (s_ciph, GCRYSEXP_FMT_CANON, (char*)buf, len);
- assert (len);
+ /* Reformat it. */
+ rc = make_canon_sexp (s_ciph, encval, NULL);
gcry_sexp_release (s_ciph);
-
- *encval = buf;
- return 0;
+ return rc;
}
/* do the actual encryption */
static int
encrypt_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
{
struct encrypt_cb_parm_s *parm = cb_value;
int blklen = parm->dek->ivlen;
unsigned char *p;
size_t n;
*nread = 0;
if (!buffer)
return -1; /* not supported */
if (parm->ready)
return -1;
if (count < blklen)
BUG ();
if (!parm->eof_seen)
{ /* fillup the buffer */
p = parm->buffer;
for (n=parm->buflen; n < parm->bufsize; n++)
{
int c = getc (parm->fp);
if (c == EOF)
{
if (ferror (parm->fp))
{
parm->readerror = errno;
return -1;
}
parm->eof_seen = 1;
break;
}
p[n] = c;
}
parm->buflen = n;
}
n = parm->buflen < count? parm->buflen : count;
n = n/blklen * blklen;
if (n)
{ /* encrypt the stuff */
gcry_cipher_encrypt (parm->dek->chd, buffer, n, parm->buffer, n);
*nread = n;
/* Who cares about cycles, take the easy way and shift the buffer */
parm->buflen -= n;
memmove (parm->buffer, parm->buffer+n, parm->buflen);
}
else if (parm->eof_seen)
{ /* no complete block but eof: add padding */
/* fixme: we should try to do this also in the above code path */
int i, npad = blklen - (parm->buflen % blklen);
p = parm->buffer;
for (n=parm->buflen, i=0; n < parm->bufsize && i < npad; n++, i++)
p[n] = npad;
gcry_cipher_encrypt (parm->dek->chd, buffer, n, parm->buffer, n);
*nread = n;
parm->ready = 1;
}
return 0;
}
/* Perform an encrypt operation.
Encrypt the data received on DATA-FD and write it to OUT_FP. The
recipients are take from the certificate given in recplist; if this
is NULL it will be encrypted for a default recipient */
int
gpgsm_encrypt (ctrl_t ctrl, certlist_t recplist, int data_fd, FILE *out_fp)
{
int rc = 0;
Base64Context b64writer = NULL;
gpg_error_t err;
ksba_writer_t writer;
ksba_reader_t reader = NULL;
ksba_cms_t cms = NULL;
ksba_stop_reason_t stopreason;
KEYDB_HANDLE kh = NULL;
struct encrypt_cb_parm_s encparm;
DEK dek = NULL;
int recpno;
FILE *data_fp = NULL;
certlist_t cl;
int count;
memset (&encparm, 0, sizeof encparm);
audit_set_type (ctrl->audit, AUDIT_TYPE_ENCRYPT);
/* Check that the certificate list is not empty and that at least
one certificate is not flagged as encrypt_to; i.e. is a real
recipient. */
for (cl = recplist; cl; cl = cl->next)
if (!cl->is_encrypt_to)
break;
if (!cl)
{
log_error(_("no valid recipients given\n"));
gpgsm_status (ctrl, STATUS_NO_RECP, "0");
audit_log_i (ctrl->audit, AUDIT_GOT_RECIPIENTS, 0);
rc = gpg_error (GPG_ERR_NO_PUBKEY);
goto leave;
}
for (count = 0, cl = recplist; cl; cl = cl->next)
count++;
audit_log_i (ctrl->audit, AUDIT_GOT_RECIPIENTS, count);
kh = keydb_new (0);
if (!kh)
{
log_error (_("failed to allocated keyDB handle\n"));
rc = gpg_error (GPG_ERR_GENERAL);
goto leave;
}
data_fp = fdopen ( dup (data_fd), "rb");
if (!data_fp)
{
rc = gpg_error (gpg_err_code_from_errno (errno));
log_error ("fdopen() failed: %s\n", strerror (errno));
goto leave;
}
err = ksba_reader_new (&reader);
if (err)
rc = err;
if (!rc)
rc = ksba_reader_set_cb (reader, encrypt_cb, &encparm);
if (rc)
goto leave;
encparm.fp = data_fp;
ctrl->pem_name = "ENCRYPTED MESSAGE";
rc = gpgsm_create_writer (&b64writer, ctrl, out_fp, NULL, &writer);
if (rc)
{
log_error ("can't create writer: %s\n", gpg_strerror (rc));
goto leave;
}
err = ksba_cms_new (&cms);
if (err)
{
rc = err;
goto leave;
}
err = ksba_cms_set_reader_writer (cms, reader, writer);
if (err)
{
log_debug ("ksba_cms_set_reader_writer failed: %s\n",
gpg_strerror (err));
rc = err;
goto leave;
}
audit_log (ctrl->audit, AUDIT_GOT_DATA);
/* We are going to create enveloped data with uninterpreted data as
inner content */
err = ksba_cms_set_content_type (cms, 0, KSBA_CT_ENVELOPED_DATA);
if (!err)
err = ksba_cms_set_content_type (cms, 1, KSBA_CT_DATA);
if (err)
{
log_debug ("ksba_cms_set_content_type failed: %s\n",
gpg_strerror (err));
rc = err;
goto leave;
}
/* Create a session key */
dek = xtrycalloc_secure (1, sizeof *dek);
if (!dek)
rc = out_of_core ();
else
{
dek->algoid = opt.def_cipher_algoid;
rc = init_dek (dek);
}
if (rc)
{
log_error ("failed to create the session key: %s\n",
gpg_strerror (rc));
goto leave;
}
err = ksba_cms_set_content_enc_algo (cms, dek->algoid, dek->iv, dek->ivlen);
if (err)
{
log_error ("ksba_cms_set_content_enc_algo failed: %s\n",
gpg_strerror (err));
rc = err;
goto leave;
}
encparm.dek = dek;
/* Use a ~8k (AES) or ~4k (3DES) buffer */
encparm.bufsize = 500 * dek->ivlen;
encparm.buffer = xtrymalloc (encparm.bufsize);
if (!encparm.buffer)
{
rc = out_of_core ();
goto leave;
}
audit_log_s (ctrl->audit, AUDIT_SESSION_KEY, dek->algoid);
/* Gather certificates of recipients, encrypt the session key for
each and store them in the CMS object */
for (recpno = 0, cl = recplist; cl; recpno++, cl = cl->next)
{
unsigned char *encval;
rc = encrypt_dek (dek, cl->cert, &encval);
if (rc)
{
audit_log_cert (ctrl->audit, AUDIT_ENCRYPTED_TO, cl->cert, rc);
log_error ("encryption failed for recipient no. %d: %s\n",
recpno, gpg_strerror (rc));
goto leave;
}
err = ksba_cms_add_recipient (cms, cl->cert);
if (err)
{
audit_log_cert (ctrl->audit, AUDIT_ENCRYPTED_TO, cl->cert, err);
log_error ("ksba_cms_add_recipient failed: %s\n",
gpg_strerror (err));
rc = err;
xfree (encval);
goto leave;
}
err = ksba_cms_set_enc_val (cms, recpno, encval);
xfree (encval);
audit_log_cert (ctrl->audit, AUDIT_ENCRYPTED_TO, cl->cert, err);
if (err)
{
log_error ("ksba_cms_set_enc_val failed: %s\n",
gpg_strerror (err));
rc = err;
goto leave;
}
}
/* Main control loop for encryption. */
recpno = 0;
do
{
err = ksba_cms_build (cms, &stopreason);
if (err)
{
log_debug ("ksba_cms_build failed: %s\n", gpg_strerror (err));
rc = err;
goto leave;
}
}
while (stopreason != KSBA_SR_READY);
if (encparm.readerror)
{
log_error ("error reading input: %s\n", strerror (encparm.readerror));
rc = gpg_error (gpg_err_code_from_errno (encparm.readerror));
goto leave;
}
rc = gpgsm_finish_writer (b64writer);
if (rc)
{
log_error ("write failed: %s\n", gpg_strerror (rc));
goto leave;
}
audit_log (ctrl->audit, AUDIT_ENCRYPTION_DONE);
log_info ("encrypted data created\n");
leave:
ksba_cms_release (cms);
gpgsm_destroy_writer (b64writer);
ksba_reader_release (reader);
keydb_release (kh);
xfree (dek);
if (data_fp)
fclose (data_fp);
xfree (encparm.buffer);
return rc;
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Dec 23, 3:31 PM (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
34/28/18e388031a2452bae39a3974f4b9

Event Timeline