Commit Graph

60 Commits

Author SHA1 Message Date
Werner Koch 9577dd45ab Various fixes and new features.
Enhanced gpg-connect-agent.
2006-09-13 15:57:30 +00:00
Werner Koch eef036df23 The big Assuan error code removal. 2006-09-06 16:35:52 +00:00
Werner Koch f98537733a Updated FSF's address. 2006-06-20 17:21:37 +00:00
Werner Koch 68191d0c93 * 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-20 15:05:05 +00:00
Werner Koch deeba405a9 gcc-4 defaults forced me to edit many many files to get rid of the
char * vs. unsigned char * warnings.  The GNU coding standards used to
say that these mismatches are okay and better than a bunch of casts.
Obviously this has changed now.
2005-06-16 08:12:03 +00:00
Werner Koch 0ccb120f68 * 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-17 14:36:16 +00:00
Werner Koch f5799d0170 (cmd_encrypt): Use DEFAULT_RECPLIST and not recplist
for encrypt-to keys.
2004-08-16 11:15:55 +00:00
Werner Koch ac791c0a9a * sysutils.c (disable_core_dumps): Only set the current limit.
(enable_core_dumps): New.

* gpgsm.texi (Esoteric Options): Add --debug-allow-core-dump.

* 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-05-11 09:54:52 +00:00
Werner Koch 13b6205066 Also print agent and dirmngr info. 2004-05-11 09:24:09 +00:00
Werner Koch d3184ce584 * 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-05-11 09:15:56 +00:00
Werner Koch c58c97e61f Add STATUS_NEWSIG 2004-04-06 07:37:52 +00:00
Werner Koch 0c224cadf3 * 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-21 13:05:52 +00:00
Werner Koch 81edc1e40e * 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.
2004-02-17 17:21:07 +00:00
Werner Koch 45a817bf4a * 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-17 15:05:04 +00:00
Werner Koch 711c4853d6 * 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.
2003-12-17 17:12:14 +00:00
Werner Koch d0fbe288b2 * 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-16 11:31:46 +00:00
Repo Admin 9ca4830a5b This commit was manufactured by cvs2svn to create branch
'GNUPG-1-9-BRANCH'.
2003-08-05 17:11:04 +00:00
Repo Admin 82a17c9fb3 This commit was manufactured by cvs2svn to create branch
'GNUPG-1-9-BRANCH'.
2002-10-19 07:55:27 +00:00
Werner Koch b8a7c191de * 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-21 15:41:21 +00:00
Werner Koch a8e9b350c0 * call-agent.c (learn_cb): Special treatment when the issuer
certificate is missing.
2002-08-16 13:55:03 +00:00
Werner Koch 850a4d5214 * 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-09 18:12:22 +00:00
Werner Koch 9f8fef65ca * 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-22 10:23:10 +00:00
Werner Koch f48b2851f6 * 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-03 16:03:22 +00:00
Werner Koch 9c70a2ed20 * server.c (cmd_recipient): Add more reason codes. 2002-06-28 14:04:46 +00:00
Werner Koch 5c5a3f689a * 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-25 09:34:10 +00:00
Werner Koch 42cf865350 * 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-20 10:43:02 +00:00
Werner Koch 0dec11fbe7 * 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.

* configure.ac (NEED_LIBKSBA_VERSION): We need 0.4.3 now.
2002-06-12 09:54:57 +00:00
Werner Koch ad6abe7913 * 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.
2002-05-21 19:20:40 +00:00
Werner Koch a64b3686b4 * 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-05-03 20:18:54 +00:00
Werner Koch 0ec648b71f Debug message cleanups. 2002-04-27 13:50:16 +00:00
Marcus Brinkmann 898dda02e4 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 22:08:35 +00:00
Werner Koch 208b08af79 * export.c: New.
* gpgsm.c: Add command --export.
* server.c (cmd_export): New.
2002-03-21 14:42:14 +00:00
Werner Koch 8337455483 * verify.c (gpgsm_verify): Detect certs-only message. 2002-03-12 13:36:29 +00:00
Werner Koch c1791a8d15 * server.c (cmd_listkeys, cmd_listsecretkeys): Divert to
(do_listkeys): new.  Add pattern parsing.
* keylist.c (gpgsm_list_keys): Handle selection pattern.
2002-03-06 16:13:47 +00:00
Werner Koch 56341c289c Changes needed to support smartcards. Well, only _support_. There is
no real code yet.
2002-02-28 11:07:59 +00:00
Werner Koch 04f49d973b * 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-25 18:18:40 +00:00
Werner Koch 2a28f5d0ae * 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-07 18:43:22 +00:00
Werner Koch 6aa7267865 * 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-06 14:52:03 +00:00
Werner Koch cd30feaa8e * 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-29 10:05:24 +00:00
Werner Koch 151deac0df * 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-25 16:41:13 +00:00
Werner Koch c3885e0995 * server.c (option_handler): New.
(gpgsm_server): Register it with assuan.
2002-01-20 16:49:46 +00:00
Werner Koch 88bacd26a2 * 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-19 18:21:14 +00:00
Werner Koch dc37fe1849 * base64.c (gpgsm_create_writer): Allow to set the object name
* 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-10 19:47:20 +00:00
Werner Koch 3b8cf6e497 * 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.
2001-12-20 16:51:06 +00:00
Werner Koch 6d27c940b2 * 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.
2001-12-14 19:36:33 +00:00
Werner Koch 7606e3b33a * util.h (digitp, hexdigitp): New ctype like macros.
(atoi_1,atoi_2,atoi_4,xtoi_1,xtoi_2): New.

* command.c: Removed the conversion macros as they are now in
../common/util.h.
2001-12-14 13:43:42 +00:00
Werner Koch b020999687 * sign.c (get_default_signer): Use keydb_classify_name here. 2001-12-14 13:35:34 +00:00
Werner Koch 595c2cbd87 * keylist.c (list_cert_colon): Print alternative names of subject
and a few other values.
2001-12-14 09:20:42 +00:00
Werner Koch 9e241878a6 Made decryption work in --server mode, allow output of plain base64,
allow --armor and --base64 arguments for INPUT and OUTPUT, new global
option --base64, cleaned up the help page.
2001-12-13 09:09:11 +00:00
Werner Koch 6a8c47bd29 Implemented encryption in server mode.
Allow to specify a recipient on the commandline
There is still a default hardwired recipient if none has been set.
2001-12-11 12:31:04 +00:00