1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-27 02:02:45 +02:00
Commit Graph

471 Commits

Author SHA1 Message Date
David Shaw
9842d84da0 * keygen.c (keygen_set_std_prefs): Build the default preferences list at
runtime as it properly handles algorithms disabled at build or run time.

* getkey.c (merge_selfsigs_main): Properly handle expired user IDs when
the expired self-sig is not the only self-sig.

* misc.c (compress_algo_to_string): Return NULL on failure like all of the
other xxxx_algo_to_string() functions.

* mainproc.c (list_node): Minor spacing tweak to match --list-keys output.

* keylist.c (list_keyblock_print), mainproc.c (list_node): Mark revoked
subkeys as revoked.  Requested by Matthew Wilcox.  Revoked overrides
expiration when both apply.

* keyedit.c (show_prefs): Use compress algo constants.
(show_basic_key_info): Make revoked and expired tags translatable.

* g10.c (rm_group): Properly ungroup from a list of groups.
2004-02-10 22:42:34 +00:00
David Shaw
0030198cad * g10.c (main, rm_group): Add --ungroup command to remove a particular
group. (add_group): When adding a group with the same name as an already
existing group, merge the two groups. (list_config): Show an error message
when listing a config item that doesn't exist. (main): Replace -z0 trick
for no compression.

* packet.h, keyedit.c (show_key_with_all_names_colon), keylist.c
(list_keyblock_colon), mainproc.c (list_node, proc_tree): Minor cleanup to
remove local_id, which is no longer used.
2004-01-30 16:49:28 +00:00
David Shaw
654ba16db5 * getkey.c: Set MAX_PK_CACHE_ENTRIES and MAX_UID_CACHE_ENTRIES to
PK_UID_CACHE_SIZE (set in ./configure).

* getkey.c (get_pubkey): When reading key data into the cache, properly
handle keys that are partially (pk, no UIDs) cached already.  This is
Debian bug #176425 and #229549.

* compress.c (init_compress, push_compress_filter2): Do the right thing
(i.e. nothing) with compress algo 0.

* main.h, decrypt.c (decrypt_messages): Accept filenames to decrypt on
stdin.  This is bug #253.
2004-01-28 01:04:30 +00:00
David Shaw
385a19bd7b * mainproc.c (list_node): Show sigs with --verbose.
* options.h, g10.c (set_screen_dimensions): New function to look at
COLUMNS and LINES.

* keyserver.c (parse_keyrec, keyserver_search_prompt), keyedit.c
(print_and_check_one_sig): Use new screen dimension variables.
2004-01-24 00:47:45 +00:00
David Shaw
f7447eabea * g10.c (list_config): New function to dump config options to stdout.
Currently requires --with-colons. (collapse_args): New function to turn
argc/argv into a single string. (main): Use it here to pass list_config()
more than one argument as a single string. (print_algo_numbers): Helper to
print algorithm number for --list-config "pubkey", "cipher",
"hash"/"digest", and "compress" config options.
2004-01-22 03:47:05 +00:00
David Shaw
cceda5c9d2 * packet.h, getkey.c (merge_selfsigs, merge_selfsigs_main), pkclist.c
(check_signatures_trust): Indicate who has revoked a key (the owner or a
designated revoker).  If a key was revoked by both, prefer the owner.
2004-01-22 01:08:58 +00:00
David Shaw
01d0c54f05 * keyedit.c (print_and_check_one_sig, keyedit_menu): Use the COLUMNS
environment variable (if any) to hint how wide the terminal is.  Disabled
on _WIN32.  Suggested by Janusz A. Urbanowicz.
2004-01-21 21:25:43 +00:00
David Shaw
97efb85f51 * keylist.c (set_attrib_fd): Open attribute fd in binary mode. This isn't
meaningful on POSIX systems, but the Mingw builds aren't exactly POSIX.
2004-01-21 04:35:32 +00:00
David Shaw
c8ab1bd127 * trustdb.c (reset_trust_records): New, faster, implementation that
doesn't involve a keyring scan. (clear_validity): Removed.
2004-01-21 03:19:13 +00:00
David Shaw
0fb284ac24 * g10.c (main), keydb.h, keydb.c (keydb_rebuild_caches), keyring.h,
keyring.c (keyring_rebuild_cache): Add "noisy" flag so cache rebuilds can
remain noisy when called for itself, and quiet when called as part of the
trustdb rebuild.

* trustdb.c (validate_keys): Rebuild the sig caches before building the
trustdb.  Note that this is going to require some architectual
re-thinking, as it is agonizingly slow.
2004-01-20 16:09:38 +00:00
David Shaw
9915f6ed78 * sig-check.c (check_key_signature2): Comments.
* keyring.c (keyring_rebuild_cache): Clear sig cache for any signatures
that we can no longer process (say, if the user removed support for a
necessary pubkey or digest algorithm).
2004-01-19 22:46:55 +00:00
David Shaw
1d12c12142 * misc.c (print_cipher_algo_note): May as well call Rijndael AES
at this point.

* keygen.c (do_create), misc.c (openpgp_pk_algo_usage): Remove the
last bits of Elgamal type 20 support.
2004-01-17 03:14:14 +00:00
Stefan Bellon
ed3f4dad7a Only use ZLib module on RISC OS when configured 2004-01-03 17:13:59 +00:00
David Shaw
2a785147be * options.h, g10.c (main), import.c (parse_import_options, import_one,
import_secret_one), keyserver.c (keyserver_refresh): Change --merge-only
to --import-option merge-only.  Deprecate --merge-only.
2003-12-31 04:58:52 +00:00
David Shaw
d537d547ce * misc.c (pull_in_libs): Dead code. Removed.
* sig-check.c (check_revocation_keys): Comments.

* getkey.c (merge_selfsigs_main): Don't bother to check designated revoker
sigs if the key is already revoked.

* packet.h, getkey.c (merge_selfsigs_main): New "maybe_revoked" flag on
PKs.  It is set when there is a revocation signature from a valid
revocation key, but the revocation key is not present to verify the
signature.

* pkclist.c (check_signatures_trust): Use it here to give a warning when
showing key trust.

* compress-bz2.c: Include stdio.h.  Solaris 9 has a very old bzip2 library
and we can at least guarantee that it won't fail because of the lack of
stdio.h.

* tdbio.c: Fixed format string bugs related to the use of DB_NAME.
Reported by Florian Weimer.
2003-12-30 00:46:42 +00:00
David Shaw
48238805b9 * options.h, g10.c (main), keyserver.c (keyserver_opts,
parse_keyserver_uri): honor-http-proxy is no longer an option since we can
do the same thing with http-proxy with no arguments. Also remove
broken-http-proxy since it can be better handled in the HTTP helper.
2003-12-28 16:08:04 +00:00
David Shaw
4cf0123a68 * keyserver.c (argsep): New variation on strsep that knows about optional
arguments. (parse_keyserver_options): Use it here for optional arguments.
2003-12-28 15:46:49 +00:00
Stefan Bellon
02ae08d6ef cleaned up RISC OS code and removed lots of unnecessary stuff 2003-12-28 14:12:16 +00:00
David Shaw
0f346cf8c1 * keyserver.c (strip_leading_space, get_arg): New.
(parse_keyserver_options): Use them here to allow arguments to
keyserver-options.  Since none of our options need arguments yet, just
pass them through whole to the keyserver helper.
2003-12-28 04:38:00 +00:00
David Shaw
392e6da660 * main.h, misc.c (parse_options): Add a "noisy" flag to enable and disable
the messages about which option didn't match or matched ambiguously.
Change all callers (g10.c, keyserver.c).

* main.h, import.c (import_options), export.c (export_options): Pass the
noisy flag through.
2003-12-28 03:46:43 +00:00
David Shaw
7847eae02c * build-packet.c (write_fake_data, do_secret_key), seckey-cert.c
(do_check): Use an unsigned length for mpi_get_opaque.

* options.h: It's impolite to assign -1 to an unsigned
opt.force_ownertrust.
2003-12-17 23:04:53 +00:00
David Shaw
84401d1523 * sig-check.c (cmp_help, do_check), sign.c (do_sign): Remove old unused
code.

* keyid.c (keyid_from_sk): Make sure lowbits is initialized.
2003-12-17 19:21:41 +00:00
David Shaw
f5d4b8dc06 * sig-check.c (do_check): Move the signing algo and hash checks from
here... (signature_check2): ... to here. (check_key_signature2): ... and
here.  This is a minor optimization to avoid fetching a key (which can be
expensive, especially if it is not self-signed, and there are many key
signatures on it which need to be checked for ultimate trust) if the
signature would have failed anyway because of algorithm or hash problems.
2003-12-13 03:53:27 +00:00
David Shaw
db5ab5e730 * packet.h, build-packet.c (hash_public_key): Remove function ...
* keydb.h, keyid.c (hash_public_key, do_fingerprint_md): ... and make a
new one here that shares code with the fingerprint calculations.  This
removes some duplicated functionality, and is also around 14% faster.
(Every bit helps).

* import.c (import_one): No longer need the Elgamal import warning.

* getkey.c (get_pubkey_fast): This one is sort of obscure. get_pubkey_fast
returns the primary key when requesting a subkey, so if a user has a key
signed by a subkey (we don't do this, but used to), AND that key is not
self-signed, AND the algorithm of the subkey in question is not present in
GnuPG, AND the algorithm of the primary key that owns the subkey in
question is present in GnuPG, then we will try and verify the subkey
signature using the primary key algorithm and hit a BUG().  The fix is to
not return a hit if the keyid is not the primary.  All other users of
get_pubkey_fast already expect a primary only.
2003-12-11 01:07:42 +00:00
David Shaw
888a6c2980 * keyid.c (do_fingerprint_md): Remove the rules to hash the old v3 Elgamal
keys.  They are no longer needed.
2003-12-10 01:59:45 +00:00
David Shaw
08967eb985 * keyid.c (keyid_from_sk, keyid_from_pk, fingerprint_from_pk,
fingerprint_from_sk): Enforce the v3-is-only-RSA rule.  Anything that
isn't RSA gets a zero keyid and fingerprint.
2003-12-10 01:52:33 +00:00
David Shaw
4830eb7cae * keyid.c (do_fingerprint_md): Properly handle hashing of keys that we
don't know the structure of by using the opaque MPI.
(do_fingerprint_md_sk): We cannot calculate the fingerprint from a secret
key unless we know the structure (since we can't leave off the secret key
parts), so fail early..... (keyid_from_sk, fingerprint_from_sk): .... and
return all zeroes.
2003-12-10 01:27:55 +00:00
David Shaw
189dea77ea * g10.c (strusage, main): Show development version warning in --version
output. (main): Set --bzip2-compress-level to the default value at
startup.  Remove --emulate-checksum-bug noop.
2003-12-04 04:58:12 +00:00
David Shaw
3c40fd65d6 * options.h, g10.c (main), main.h, seskey.c (do_encode_md,
encode_md_value), sig-check.c (do_check), sign.c (do_sign): Remove
--emulate-md-encode-bug as it only applied to Elgamal signatures, which
are going away.
2003-12-04 04:34:08 +00:00
David Shaw
03b04db3cf * mainproc.c (proc_symkey_enc, proc_encrypted): Add ability to use
--override-session-key on --symmetric messages (new-style or old-style).
(proc_pubkey_enc): Move code to show session key from here to
proc_encrypted() so it can work with any type of message. Suggested by
Michael Young.
2003-11-30 15:33:04 +00:00
David Shaw
3c0eb7790b * trustdb.c (validate_keys): Reset the trustdb before checking if we have
any ultimately trusted keys.  This ensures that if we lose all our
ultimately trusted keys, we don't leave behind the old validity
calculations.  Noted by Peter Palfrader.

* revoke.c (gen_desig_revoke): Specify in the comment when a designated
revocation is generated.

* getkey.c (merge_selfsigs_main, merge_selfsigs_subkey,
get_seckey_byname2): Remove Elgamal check since we are removing type 20
keys altogether.
2003-11-30 00:33:27 +00:00
David Shaw
5473ac9deb * pkclist.c (build_pk_list): Do not allow an empty PK list in interactive
mode.

* getkey.c (get_seckey_byname2): Disallow use of sign+encrypt Elgamal
keys.
2003-11-27 14:47:00 +00:00
David Shaw
973c868961 * keygen.c (ask_algo): Remove ability to generate Elgamal sign+encrypt
keys.

* getkey.c (merge_selfsigs_main, merge_selfsigs_subkey): Disallow use of
sign+encrypt Elgamal keys.
2003-11-27 13:53:34 +00:00
David Shaw
85a80265c7 * seskey.c (do_encode_md): Comment about earlier (pre-PGP 2.3) encodings.
* misc.c (compress_algo_to_string): Translate "Uncompressed". Requested by
Tommi Vainikainen. (string_to_compress_algo): Include multi-string for
"uncompressed|none".
2003-11-21 01:11:25 +00:00
David Shaw
dcf747d620 * options.h, g10.c (main), compress-bz2.c (init_uncompress): Add
--bz2-compress-lowmem to set bzlib "small" flag for low memory (but slow)
decompression.
2003-11-18 02:52:35 +00:00
David Shaw
2e4ab6c669 * compress.c (init_compress): Remove compress level 10 trick, since it is
no longer needed.

* g10.c: Fix typoed option name.

* compress-bz2.c (init_compress): Compression level 0 is not meaningful
for bzip2.
2003-11-15 23:54:14 +00:00
David Shaw
995d712589 * options.h, g10.c (main), compress.c (init_compress), compress-bz2.c
(init_compress): Add --compress-level and --bzip2-compress-level.  -z sets
them both.  Change various callers.
2003-11-15 22:31:58 +00:00
David Shaw
3257edd4e4 * encode.c (encode_simple), sign.c (sign_symencrypt_file): Properly use
default_compress_algo (--compress-algo, followed by the highest
--personal-compress-preference, followed by ZIP) to get the algorithm.
2003-11-15 15:38:43 +00:00
David Shaw
c47ec46526 * options.h, trustdb.c (trust_model_string, init_trustdb): Add support for
"external" trust model, where the user can provide a pregenerated trustdb.

* keyedit.c (keyedit_menu): Do not allow editing ownertrust with an
external trust model trustdb.
2003-11-15 00:19:49 +00:00
David Shaw
80caf9957f * options.h, g10.c, keyedit.c, keylist.c, mainproc.c: Clarify the
plurarility (or not) of various list and verify options.
2003-11-14 05:06:19 +00:00
David Shaw
bc1e4357a9 * g10.c (main): Add --symmetric --sign --encrypt.
* main.h, encode.c (setup_symkey): New.  Prompt for a passphrase and
create a DEK for symmetric encryption. (write_symkey_enc): New.  Write out
symmetrically encrypted session keys. (encode_crypt, encrypt_filter): Use
them here here when creating a message that can be decrypted with a
passphrase or a pk.

* sign.c (sign_file): Call setup_symkey if we are doing a --symmetric
--sign --encrypt.
2003-11-13 02:54:12 +00:00
David Shaw
5028edd538 * mainproc.c (proc_symkey_enc): Don't show algorithm information when
--quiet is set.  Suggested by Duncan Harris.  Also don't fail with BUG()
when processing a --symmetric message with a cipher we don't have.

* g10.c: Alias --personal-xxx-prefs to --personal-xxx-preferences.
2003-11-10 04:33:13 +00:00
David Shaw
ebe6f4999f * pkclist.c (build_pk_list): When adding recipients interactively, allow
the user to stop at any point.
2003-11-10 01:30:12 +00:00
David Shaw
5c37fd90bf * trustdb.h, trustdb.c (register_trusted_keyid): New. Adds a keyid to the
list of ultimately trusted keys.

* keygen.c (do_generate_keypair): Use it here so that the ultimate
ownertrust happens before the trustdb (might be) rebuilt.  Also fix an
error where the newly generated pk is thought to be a subkey by the
trustdb.

* g10.c (main): Fix --export-all do actually do something different than
--export.

* pkclist.c (build_pk_list): Show all recipients rather than showing each
recipient as they are added.

* mainproc.c (proc_symkey_enc, proc_encrypted): Keep a count of the number
of passphrases that can decrypt a symmetric or mixed symmetric/pk message
and include it in the list of keys shown to the user.
2003-11-01 01:13:16 +00:00
David Shaw
869c6bb7e4 * misc.c (compress_algo_to_string, string_to_compress_algo,
check_compress_algo): Add bzip2.

* compress.c (compress_filter): Make static to help force the use of
push_compress_filter.  Remove default algorithm setting since that is done
in push_compress_filter now.

* main.h: Use named algorithm.

* filter.h, compress.c (push_compress_filter, push_compress_filter2): New.
Figure out which is the appropriate compression filter to use, and push it
into place.

* compress.c (handle_compressed), encode.c (encode_simple, encode_crypt),
sign.c (sign_file, sign_symencrypt_file), import.c (read_block), export.c
(do_export): Use push_compress_filter instead of pushing the compression
filter ourselves.

* compress-bz2.c: New.  Bzlib versions of the compression filter routines.

* Makefile.am: Include compress-bz2.c if bz2lib is available.
2003-10-31 05:39:02 +00:00
Werner Koch
06865e7164 (close_ct_reader, close_pcsc_reader): Implemented.
(get_ccid_error_string): New.  Not very useful messages, though.
2003-10-30 09:30:20 +00:00
Werner Koch
fcc72f915b * cardglue.c (open_card): Ask for card insertion.
(check_card_serialno): New.
(agent_scd_pksign, agent_scd_pkdecrypt): Use it here.
* cardglue.c (open_card): Issue insertion status message.
* status.h, status.c (STATUS_CARDCTRL): New.

* status.c (cpr_get_answer_okay_cancel): New.

* miscutil.c (answer_is_okay_cancel): New.
2003-10-29 10:07:44 +00:00
Werner Koch
be239a058a * DETAILS: Add the 'a' value for field 12 and the new field 15.
* keylist.c (list_keyblock_print): Denote secrets keys stored on a
card with an '>'. Print the '#' also for subkeys.
(list_keyblock_colon): Introduce new field 15 for sec/ssb to print
the serial number.
2003-10-28 09:25:06 +00:00
David Shaw
ce4c9b6b5f * g10.c (main): Enhance the version-specific config file code to try for
more specific matches before giving up (e.g. 1.3.3-cvs, 1.3.3, 1.3, 1).
2003-10-26 15:49:44 +00:00
David Shaw
bb7986e9a6 * g10.c (main): Add --symmetric --encrypt command. This generates a
message that can be decrypted via a passphrase or public key system.

* main.h, encode.c (encode_seskey): Allow passing in an already-created
session key dek. (encode_simple): Use the actual symmetric cipher when
encrypting a session key for a symmetric message. (encode_crypt): Add a
flag to trigger a hybrid mode that can be decrypted via a passphrase or a
pk.  Change all callers.

* mainproc.c (symkey_decrypt_sesskey): There is no way to tell the
difference here between a bad passphrase and a cipher algorithm that we
don't have, so use a error message that makes that clear. Use the actual
list of ciphers when checking whether a cipher is invalid.  Return error
if the decrypted cipher algorithm is invalid. (proc_symkey_enc): In a
mixed passphrase/pk message, if a valid dek already exists from decrypting
via pk, do not try to process the passphrase. (proc_symkey_enc): Indicate
when we're decrypting a session key as opposed to decrypting data.  If a
passphrase is invalid, discard the dek so we'll keep trying.
2003-10-26 03:26:14 +00:00