1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-10-31 20:08:43 +01:00
Commit Graph

810 Commits

Author SHA1 Message Date
Werner Koch
18a212f2c8 (list_cert_colon): Print the fingerprint as the
cert-id for root certificates.
2004-02-24 14:15:43 +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
aa0e38982a * 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-20 13:46:21 +00:00
Werner Koch
a1b487a17a * 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.

* simple-pwquery.c (agent_open): Don't mangle INFOSTR.

* export.c (export_p12, popen_protect_tool)
(gpgsm_p12_export): New.
* gpgsm.c (main): New command --export-secret-key-p12.
2004-02-19 16:26:32 +00:00
Werner Koch
1a709b341c * 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-18 17:00:21 +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
01486117e8 * 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.
2004-02-13 17:06:50 +00:00
Werner Koch
1a159fd8e3 * 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-13 12:40:23 +00:00
Werner Koch
76b1445390 * Makefile.am (AM_CPPFLAGS): Pass directory constants via -D; this
will allow to override directory names at make time.
2004-02-12 09:29:42 +00:00
Werner Koch
cfb33014ae Fixed a build bug (straw letter in sm/import.c) and updated the documentation. 2004-02-04 19:13:16 +00:00
Werner Koch
336e415f5b * import.c (check_and_store): Import certificates even with
missing issuer's cert.  Fixed an "depending on the verbose
setting" bug.
2004-02-03 16:27:51 +00:00
Werner Koch
5bda9a8e74 * keybox.h (keybox_flag_t): New.
* keybox-search.c (get_flag_from_image, keybox_get_flags): New.
(_keybox_get_flag_location): New.

* 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-02-02 17:09:35 +00:00
Werner Koch
6fe6139289 (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.
2004-01-30 09:47:28 +00:00
Werner Koch
fec4dc4c99 * configure.ac: Require libksba 0.9.3 due to another bug fix there.
* sign.c (add_certificate_list): Decrement N for the first cert.

* Makefile.am (sbin_SCRIPTS): New, to install addgnupghome.
(EXTRA_DIST): Added rfc822parse.c rfc822parse.h gpgparsemail.c
which might be useful for debugging.
2004-01-30 09:12:36 +00:00
Werner Koch
b001af10ac (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-29 07:41:55 +00:00
Werner Koch
a0cb56fe7f (gpgsm_validate_chain): Changed the message printed
for an untrusted root certificate.
2004-01-28 16:20:17 +00:00
Werner Koch
4453659c9a (parse_dn_part): Pretty print the nameDistinguisher OID.
(print_dn_part): Do not delimit multiple RDNs by " + ".  Handle
multi-valued RDNs in a special way, i.e. in the order specified by
the certificate.
(print_dn_parts): Simplified.
2004-01-27 19:10:38 +00:00
Werner Koch
4dc78204ae * sign.c (gpgsm_sign): Print an error message on all failures.
* decrypt.c (gpgsm_decrypt): Ditto.
2004-01-16 17:42:36 +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
cbd57643a7 Replaced deprecated type names.
* 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-17 12:28:24 +00:00
Werner Koch
a41d45af62 * 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-16 16:31:16 +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
Werner Koch
c68eaa4b6b * 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-12-01 10:54:30 +00:00
Werner Koch
2f2eb1d202 * verify.c (gpgsm_verify): Fixed for changes API of gcry_md_info.
* certchain.c (unknown_criticals): Fixed an error code test.
2003-11-18 17:29:51 +00:00
Werner Koch
dba40e5e45 Mainly changes to adjust for the changed KSBA API. 2003-11-12 15:17:44 +00:00
Werner Koch
c64d5a769e The Changelog was not yet ready, so again:
* 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-31 12:14:14 +00:00
Werner Koch
dd808fa15b * verify.c (strtimestamp_r, gpgsm_verify):
* sign.c (gpgsm_sign):

* keylist.c (print_time, list_cert_std, list_cert_colon):

* certdump.c (gpgsm_print_time, gpgsm_dump_time, gpgsm_dump_cert):

* certchain.c (gpgsm_validate_chain): Changed to use ksba_isotime_t.
2003-10-31 12:12:47 +00:00
Werner Koch
1ab791ed69 (read_parameters): Fixed faulty of !spacep(). 2003-10-25 14:23:11 +00:00
Marcus Brinkmann
e8cf79c977 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-20 16:53:40 +00:00
Timo Schulz
81a0683e21 2003-08-14 Timo Schulz <twoaday@freakmail.de>
* encrypt.c (encode_session_key): Use new Libgcrypt interface.
2003-08-14 19:39:30 +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
7250331472 This commit was manufactured by cvs2svn to create branch
'GNUPG-1-9-BRANCH'.
2003-06-05 07:14:21 +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
8bd507e5a2 * 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-19 12:59:57 +00:00
Werner Koch
94a917356c * gpgsm.c (main): Disable the internal libgcrypt locking. 2002-09-03 14:53:53 +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
e18e3875b7 * 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-20 13:09:53 +00:00
Werner Koch
47fc9f88a2 Made it compile. 2002-08-16 14:31:49 +00:00
Werner Koch
1299c134fa *** empty log message *** 2002-08-16 14:15:43 +00:00
Werner Koch
5776c03b4c * certpath.c: Renamed to ..
* certchain.c: this. Renamed all all other usages of "path" in the
context of certificates to "chain".
2002-08-16 14:09:23 +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
9c86904866 Minor changes for gettext 2002-08-10 11:25:32 +00:00
Werner Koch
9382b621ad * 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-10 09:14:21 +00:00
Werner Koch
dc8f3ee42c * decrypt.c (prepare_decryption): Hack to detected already
unpkcsedone keys.
2002-08-09 21:01: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
5190d70423 * keydb.c (keydb_add_resource): Register a lock file.
(lock_all, unlock_all): Implemented.
2002-07-22 13:14:48 +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
6aaa48054b * verify.c (gpgsm_verify): Extend the STATUS_BADSIG line with
the fingerprint.
2002-07-02 19:38:14 +00:00
Werner Koch
6041ae63f3 * certpath.c (check_cert_policy): Don't use log_error to print a
warning.
2002-07-02 17:40:26 +00:00
Werner Koch
5795c02b09 * 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.
2002-07-02 10:40:12 +00:00
Werner Koch
5faca753cb * 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-07-02 09:26:05 +00:00
Werner Koch
df58e024e7 * 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-29 14:01:53 +00:00
Werner Koch
9c70a2ed20 * server.c (cmd_recipient): Add more reason codes. 2002-06-28 14:04:46 +00:00
Werner Koch
ad4d81f528 * 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.

* scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.

* assuan-pipe-connect.c (assuan_pipe_connect): No special handling
for the log_fd and stderr.  Connect stderr to /dev/null if it
should not be retained.
2002-06-27 07:29:57 +00:00
Werner Koch
738e6d8212 * import.c (gpgsm_import): Print an STATUS_IMPORTED.
* gpgsm.c: --debug-no-path-validation does not take an argument.
2002-06-26 12:51:34 +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
640688c4e2 * 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-24 14:34:52 +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
52146943d1 * 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-19 08:30:10 +00:00
Werner Koch
dfcdec0db2 * certreqgen.c (read_parameters): Improved error handling.
(gpgsm_genkey): Print error message.
2002-06-17 10:11:50 +00:00
Werner Koch
4e13426c92 * gpgsm.c (main): New option --log-file. 2002-06-13 11:45:36 +00:00
Werner Koch
312ee41ff7 * call-dirmngr.c (lookup_status_cb): New.
(gpgsm_dirmngr_lookup): Use the status CB.  Add new arg CTRL and
changed caller to pass it.
2002-06-12 14:35:41 +00:00
Werner Koch
7ca4df0a9a * gpgsm.c (open_fwrite): New.
(main): Allow --output for --verify.
2002-06-12 10:33:40 +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
c6416080a2 * 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-06-04 09:41:59 +00:00
Werner Koch
a3aa9e386b * gpgsm.c (main): Don't print the "go ahead" message for an
invalid command.
2002-05-31 15:20:22 +00:00
Werner Koch
8bb265d502 * import.c (gpgsm_import): Add error messages. 2002-05-23 13:57:19 +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
4f7330e0bb * import.c (gpgsm_import): Try to identify the type of input and
handle certs-only messages.

* maperror.c (map_gcry_err): Add libgcrypt's new S-expression errors.
(map_ksba_err): Add a few mappings.

* configure.ac: We now require libgcrypt 1.1.7 and libksba 0.4.2.
2002-05-21 08:29:17 +00:00
Werner Koch
c7ceb874c2 sm/
* gpgsm.c: New option --faked-system-time
* sign.c (gpgsm_sign): And use it here.
* certpath.c (gpgsm_validate_path): Ditto.
common/
* gettime.c: New.
agent/
* cache.c (housekeeping, agent_put_cache): Use our time() wrapper.
/
* doc/: New
* configure.ac, Makefile.am:  Added doc/
2002-05-14 16:51:00 +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
Werner Koch
a2176634ae * call-agent.c (start_agent): Make copies of old locales and check
for setlocale.

* configure.ac: Check for setlocale.
2002-04-25 08:31:48 +00:00
Marcus Brinkmann
b107b6d795 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-24 22:23:06 +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
Marcus Brinkmann
ee6bb32a8b 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Check for locale.h.

agent/
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.

sm/
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-24 21:52:47 +00:00
Werner Koch
7cadd7c840 * certreqgen.c (gpgsm_genkey): Write status output on success. 2002-04-18 13:06:18 +00:00
Werner Koch
f2183cf081 released 0.3.5 2002-04-15 17:15:21 +00:00
Werner Koch
8992de3bf6 * gpgsm.c (main): Check ksba version. 2002-04-15 16:57:15 +00:00
Werner Koch
73e738388c * certpath.c (find_up): New to use the authorithKeyIdentifier.
Use it in all other functions to locate the signing cert..
2002-04-15 13:18:44 +00:00
Werner Koch
7e07a397a0 * 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-04-12 18:54:34 +00:00
Werner Koch
d5a95ff130 * certpath.c (gpgsm_walk_cert_chain): Be a bit more silent on
common errors.
2002-03-28 17:21:54 +00:00
Werner Koch
f63676f9ac * keylist.c (list_cert_colon): Fixed listing of crt record; the
issuer is not at the right place.  Print a chainingID.
2002-03-28 16:36:25 +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
c39b866d2a Doc fixes, moved some fizmes to TODO, fixed minor bugs. 2002-03-18 09:30:35 +00:00
Werner Koch
c6736b6435 * decrypt.c (gpgsm_decrypt): Allow multiple recipients. 2002-03-13 10:19:50 +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
4e637f2285 sm/
* 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.
agent/
* 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.
scd/
* pkdecrypt.c (agent_pkdecrypt): Changed the way the diversion is done.
* divert-scd.c (divert_pkdecrypt): Changed interface and
implemented it.
2002-03-06 14:16:37 +00:00
Werner Koch
303b4bd636 Decryption using a Cryptoflex card does now work. 2002-03-06 09:01:12 +00:00
Werner Koch
c8454f792d * 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-03-05 15:56:46 +00:00
Werner Koch
dfda938ee9 Minor fixes; about to release 0.3.1 2002-03-04 10:35:34 +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
488243f56e * 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-19 17:39:05 +00:00
Werner Koch
5dac4711f9 * 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-18 20:47:29 +00:00
Werner Koch
eeb5cdb962 Set version numbers add a comment 2002-02-07 20:41:00 +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
Marcus Brinkmann
a34a03def9 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
* sign.c (gpgsm_sign): Do not release certificate twice.
2002-02-01 18:08:32 +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
fc8d8e9987 * certreqgen.c (create_request): Store the email address in the req.
Note, that I have not yet achieved to generate a cert with the
subjectAltName using OpenSSL.  It seems that openssl requires the
email address to be part of the subject DN (subjectAltName=email:copy)
but this is something we don't want to do.
2002-01-28 14:23:18 +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
d9a4ccf94e * 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-23 13:40:38 +00:00
Werner Koch
4f39f92eff * certpath.c (unknown_criticals): New.
(allowed_ca): New.
(gpgsm_validate_path): Check validity, CA attribute, path length
and unknown critical extensions.
2002-01-22 13:32:48 +00:00
Werner Koch
1146232890 * gpgsm.c: Add option --enable-crl-checks.
* call-agent.c (start_agent): Implemented socket based access.
* call-dirmngr.c (start_dirmngr): Ditto.
2002-01-21 12:03:38 +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
a9979e26a5 * 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-15 13:02:47 +00:00
Werner Koch
438b2bcb8c * call-dirmngr.c (inq_certificate): Changed for new interface semantic.
* certlist.c (gpgsm_find_cert): New.

DirMngr should now work.  Remember that there is a --disable-crl-check
option in gpgsm to be used when there is a problem with the dirmngr
communication or you want to do faster tests.
2002-01-14 12:15:30 +00:00
Werner Koch
ae439af93a * fingerprint.c (gpgsm_get_certid): Print the serialand not the
hash after the dot.
2002-01-13 10:43:21 +00:00
Werner Koch
6af7631e54 * 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-11 17:07:51 +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
5f116e9540 * 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-20 13:25:08 +00:00
Marcus Brinkmann
84b6169de7 assuan/
2001-12-14  Marcus Brinkmann  <marcus@g10code.de>

	* assuan-buffer.c (_assuan_read_line): New variable ATTICLEN, use
	it to save the length of the attic line.
	Rediddle the code a bit to make it more clear what happens.

agent/
2001-12-19  Marcus Brinkmann  <marcus@g10code.de>

	* query.c (start_pinentry): Add new argument to assuan_pipe_connect.

sm/
2001-12-19  Marcus Brinkmann  <marcus@g10code.de>

	* call-agent.c (start_agent): Add new argument to assuan_pipe_connect.
2001-12-19 00:18:11 +00:00
Werner Koch
86521773df * Makefile.am (AM_CPPFLAGS): Add flags for libksba
* Makefile.am (AM_CPPFLAGS): Include flags for gcrypt and ksba
* Makefile.am: Use LIBGCRYPT macros
2001-12-18 19:35:12 +00:00
Werner Koch
56172ce393 Changes to be used with the new libksba interface.
libgcrypt-1.1.5 is required (cvs or tarball)
2001-12-18 17:37:48 +00:00
Werner Koch
73d2214abb * gpgsm.c (main): Renamed the default key database to "keyring.kbx". 2001-12-15 16:19:24 +00:00
Werner Koch
1301c0b5ef * decrypt.c (gpgsm_decrypt): Write STATUS_DECRYPTION_*.
* sign.c (gpgsm_sign): Write a STATUS_SIG_CREATED.
2001-12-15 12:36:39 +00:00
Werner Koch
fb446a5aeb * keylist.c (list_cert_colon): Kludge to show an email address
encoded in the subject's DN.
2001-12-14 20:48:26 +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
b47b62b5f5 * gpgsm.c (main): New option --debug-wait n, so that it is
possible to attach gdb when used in server mode.
2001-12-14 15:40:20 +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
601e41285f Fixed test key 2001-12-14 13:09:51 +00:00
Werner Koch
e8cc8e4064 Fixed test key 2001-12-14 13:09:51 +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
Marcus Brinkmann
e6336cb1ff assuan/
2001-12-14  Marcus Brinkmann  <marcus@g10code.de>

	* assuan-defs.h (LINELENGTH): Define as ASSUAN_LINELENGTH.
	assuan.h: Define ASSUAN_LINELENGTH.

agent/
2001-12-14  Marcus Brinkmann  <marcus@g10code.de>

	* query.c (LINELENGTH): Removed.
	(agent_askpin): Use ASSUAN_LINELENGTH, not LINELENGTH.

sm/
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 23:20:02 +00:00
Werner Koch
dda2440aea * keylist.c (list_cert_colon): Print alternative names of subject
and a few other values.
2001-12-13 13:11:40 +00:00
Werner Koch
c3567c42b7 Now that the DN encoding works more correct, we have to update the
default key.
2001-12-13 09:33:36 +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
bc11060de9 * gpgsm.c (main): New options --assume-{armor,base64,binary}.
* base64.c (base64_reader_cb): Fixed non-autodetection mode.
2001-12-12 11:57:28 +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
Werner Koch
f312047a67 --encrypt does now work for a hardwired key. 2001-12-10 19:18:27 +00:00
Werner Koch
ce32f6b6c8 Decryption does now work 2001-12-06 20:48:10 +00:00
Werner Koch
e8676a0871 Started with decryption stuff 2001-12-05 23:48:01 +00:00
Werner Koch
95e6da1b07 --armor does now produce PEM format. 2001-11-27 18:38:59 +00:00
Werner Koch
944fee70bc * 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.
This way we can feed PEM encoded stuff to --verify.
2001-11-27 17:40:09 +00:00
Werner Koch
d9aecd9eb7 * gpgsm.c: New option --agent-program
* call-agent.c (start_agent): Allow to override the default path
to the agent.
2001-11-26 17:54:49 +00:00
Werner Koch
99829ef5fb * 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.
2001-11-26 13:08:36 +00:00
Werner Koch
0e36c4c6a7 The agent does now work and read the secret keys from the directory
~/.gnupg-test/private-keys-v1.d/<keygrip-as-20-byte-hex-number>. I
will post a sample key to gpa-dev.
2001-11-25 18:23:06 +00:00
Werner Koch
f60dc501d2 Introduced the keygrip 2001-11-24 22:20:38 +00:00
Werner Koch
bab7fa0b29 Added new directory common to enable sharing of some code and error
numbers between gpg, gpgsm and gpg-agent.  Move some files and code to
there.
2001-11-24 17:43:43 +00:00
Werner Koch
8e58435312 Signing does now work. There is no secret key management yet, so you
should set GPGSM_FAKE_KEY=1 before you try to verify a signature
created by gpgsm --sign or the SIGN server command.
2001-11-24 14:26:27 +00:00
Werner Koch
757c13a171 Just a Backup. We can now write out a basic signature which in turn
exhibits a bug in --verify.
2001-11-23 17:12:37 +00:00
Werner Koch
aa4f78a45a Map Libksba's OIDs to Libgcrypt digest algo numbers.
The latest Libgcrypt CVS version is needed.
2001-11-20 18:28:53 +00:00
Werner Koch
d6f1a79f89 Added new file to please Jan 2001-11-19 16:52:10 +00:00
Werner Koch
a413066de1 Added basic code for keylisting.
New Assuan command LISTKEYS.
2001-11-19 16:17:43 +00:00
Werner Koch
0b17666145 Write status output, make verify work in server mode. 2001-11-19 12:42:01 +00:00
Werner Koch
2b99de5a5d gpgsm --verify does now work like gpg including the
--enable-special-filenames option.
2001-11-19 10:25:00 +00:00
Werner Koch
0f26760d9f Base code for gpgsm --verify does work 2001-11-16 17:56:23 +00:00
Werner Koch
90d060c199 We have reached a state where we are able to import certs and
check the certification path.
2001-11-13 12:50:14 +00:00
Werner Koch
82f2ebc259 We now need a way to store keys 2001-11-10 18:10:11 +00:00
Werner Koch
a014d87d1c we are now able to check self-signed certificates 2001-11-10 18:08:10 +00:00
Werner Koch
7c708298d2 Implemented server main loop and started with import command. 2001-11-07 17:44:22 +00:00
Werner Koch
4fcb72b382 gpgsm does now build and a dummy server can be started. 2001-11-06 19:14:14 +00:00
Werner Koch
a1b39ba850 Created configuration files 2001-10-31 11:47:04 +00:00