aboutsummaryrefslogtreecommitdiffstats
path: root/g10/getkey.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * getkey.c (get_pubkey_byname): Fix minor security problem with PKA whenDavid Shaw2006-02-211-1/+14
| | | | | | | | | | importing at -r time. The URL in the PKA record may point to a key put in by an attacker. Fix is to use the fingerprint from the PKA record as the recipient. This ensures that the PKA record is followed. * keyserver-internal.h, keyserver.c (keyserver_import_pka): Return the fingerprint we requested.
* * keyserver.c (keyserver_import_pka): New. Moved fromDavid Shaw2005-12-231-21/+40
| | | | | | | | | | | | | getkey.c:get_pubkey_byname which was getting crowded. * keyserver.c (keyserver_import_cert): Import a key found in DNS via CERT records. Can handle both the PGP (actual key) and IPGP (URL) CERT types. * getkey.c (get_pubkey_byname): Call them both here. * options.h, keyserver.c (parse_keyserver_options): Add "auto-cert-retrieve" option with optional max size argument.
* * gpgv.c: Stub.David Shaw2005-12-231-28/+46
| | | | | | | | | | * keyserver-internal.h, keyserver.c (keyserver_spawn, keyserver_work, keygerver_getname): New keyserver_getname function to fetch keys by name. * getkey.c (get_pubkey_byname): Call it here to enable locating keys by full mailbox from a keyserver a la PKA. Try PKA first, though, as it is likely to be faster.
* Finished PKA featureWerner Koch2005-12-201-0/+1
|
* * getkey.c (merge_selfsigs_main): All primary keys can certify.David Shaw2005-12-191-1/+3
|
* * packet.h: Move some flags to a bitfield. Change all callers.David Shaw2005-11-101-5/+5
|
* * keyedit.c (menu_addrevoker), getkey.c (finish_lookup): Fix problem withDavid Shaw2005-10-271-1/+1
| | | | | | adding a cert-only designated revoker. Code was looking for a key with sign ability, and not cert ability. Noted by Timo Schulz.
* * keyedit.c (keyedit_menu, menu_backsign): New "backsign" command toDavid Shaw2005-10-141-1/+4
| | | | | | | | | add 0x19 backsigs to old keys that don't have them. * misc.c (parse_options): Fix build warning. * main.h, keygen.c (make_backsig): Make public.
* * options.h, getkey.c (merge_selfsigs_subkey), gpg.c (main), sig-check.cDavid Shaw2005-10-121-7/+0
| | | | | | (signature_check2): Add --require-backsigs and --no-require-backsigs. Currently defaults to --no-require-backsigs.
* * getkey.c (merge_selfsigs_subkey), sig-check.c (signature_check2),David Shaw2005-10-111-4/+6
| | | | | | | keygen.c (make_backsig): Did some backsig interop testing with the PGP folks. All is well, so I'm turning generation of backsigs on for new keys. Checking for backsigs on verification is still off.
* * misc.c (openpgp_pk_algo_usage): Default to allowing CERT for signingDavid Shaw2005-08-271-4/+12
| | | | | | | | | | | | | | | | | algorithms. * keyedit.c (sign_uids): Don't request a signing key to make a certification. * keygen.c (do_add_key_flags): Force the certify flag on for all primary keys, as the spec requires primary keys must be able to certify (if nothing else, which key is going to issue the user ID signature?) (print_key_flags): Show certify flag. (ask_key_flags, ask_algo): Don't allow setting the C flag for subkeys. * keyid.c (usagestr_from_pk), getkey.c (parse_key_usage): Distinguish between a sign/certify key and a certify-only key.
* * options.skel: Remove the surfnet LDAP keyserver from the list ofDavid Shaw2005-08-191-0/+4
| | | | | | | | samples since it is being shut down. * getkey.c (classify_user_id): Disable the '.' and '+' search modes since they aren't supported yet.
* auto retrieve keys from PKA. Thsi allows to specify an email addressWerner Koch2005-08-051-12/+48
| | | | | | so that gpg can get the key from DNS. This helps with opportunistic encryption. No integration with the trust modell yet.
* Converted all m_free to xfree etc.Werner Koch2005-07-271-33/+33
|
* * getkey.c (merge_selfsigs_main, merge_selfsigs_subkey): Make sureDavid Shaw2005-06-121-7/+12
| | | | | | that even after keys may be merged together, we only have one chosen selfsig.
* * getkey.c (fixup_uidnode, merge_selfsigs_main): Handle both expiredDavid Shaw2005-06-081-12/+9
| | | | | | | and revoked uids in fixup_uidnode(). No need to special case in merge_selfsigs_main(). This also means that an expired uid will have its selfsig tagged with chosen_selfsig.
* Updated FSF street address and preparations for a release candidate.Werner Koch2005-05-311-1/+2
|
* * getkey.c (get_seckey_byname2): If no explicit default key is set, don'tDavid Shaw2005-03-171-4/+10
| | | | | pick a disabled default. Noted by David Crick.
* * getkey.c (merge_selfsigs_subkey): Merged away definition from theDavid Shaw2005-02-051-0/+1
| | | | | backsigs code.
* * gpgv.c (tty_fprintf): New stub.Werner Koch2005-01-201-2/+30
| | | | | | | | | * card-util.c (card_status): Create asecret key stub on the fly and print more information about a card key. * import.c (pub_to_sec_keyblock, auto_create_card_key_stub): New. * getkey.c (get_seckeyblock_byfprint): New. * keylist.c (print_card_key_info): New.
* * packet.h, getkey.c (merge_selfsigs_main, sig_to_revoke_info), keyid.cDavid Shaw2004-12-301-8/+18
| | | | | | (revokestr_from_pk), keyedit.c (show_key_with_all_names): Show who revoked a key (either the same key or a designated revoker) and when.
* * keyedit.c (keyedit_menu): Invisible alias "passwd" as "password".David Shaw2004-12-201-1/+1
| | | | | | | | | | | * passphrase.c: Don't check for __CYGWIN__, so it is treated as a unix-like system. * options.h, g10.c (main), textfilter.c (standard): Use new option --rfc2440-text to determine whether to filter "<space>\t\r\n" or just "\r\n" before canonicalizing text line endings. Default to "<space>\t\r\n".
* * getkey.c (parse_key_usage): New function to parse out key usage flags.David Shaw2004-11-291-48/+68
| | | | | | | Set PUBKEY_USAGE_UNKNOWN to handle flags that we don't understand. (fixup_uidnode, merge_selfsigs_main, merge_selfsigs_subkey): Call it from here to remove duplicate code.
* * main.h: Create S2K_DIGEST_ALGO macro so we do not need to always setDavid Shaw2004-09-241-2/+2
| | | | | | | | | | | opt.s2k_digest_algo. This helps fix a problem with PGP 2.x encrypted symmetric messages. Change all callers (encode.c, g10.c, keyedit.c, keygen.c, passphrase.c, sign.c). * armor.c, cardglue.c, getkey.c, import.c, keygen.c: Be consistent in some more quoted strings. Always use 'user ID', not 'user id', "quotes" for user IDs, etc.
* * getkey.c (premerge_public_with_secret): Fix subkey<->binding sigDavid Shaw2004-09-141-1/+1
| | | | | | mismatch when some secret subkeys are missing. Discovered by Michael Roth.
* * keydb.h, getkey.c (get_user_id_printable): Rename to get_user_id_nativeDavid Shaw2004-08-231-16/+12
| | | | | | | and remove the printable stuff since we're print-ifying valid utf8 characters. Change all callers in import.c, sign.c, keylist.c, and encode.c.
* * getkey.c (get_seckey_byname2): Significantly simplify this function byDavid Shaw2004-04-261-32/+13
| | | | | | | using key_byname to do the heavy lifting. Note that this also fixes an old problem when the first key on the secret keyring has an unusable stub primary, but is still chosen.
* * getkey.c (key_byname): If namelist is NULL, return the first key in theDavid Shaw2004-04-261-29/+41
| | | | | keyring.
* * keygen.c (make_backsig): If DO_BACKSIGS is not defined, do not createDavid Shaw2004-04-231-1/+44
| | | | | | | | | | | | | | | | backsigs. * getkey.c (merge_selfsigs_subkey): Find 0x19 backsigs on subkey selfsigs and verify they are valid. If DO_BACKSIGS is not defined, fake this as always valid. * packet.h, parse-packet.c (parse_signature): Make parse_signature non-static so we can parse 0x19s in self-sigs. * main.h, sig-check.c (check_backsig): Check a 0x19 signature. (signature_check2): Give a backsig warning if there is no or a bad 0x19 with signatures from a subkey.
* * packet.h, getkey.c (fixup_uidnode, merge_selfsigs_subkey): Keep track ofDavid Shaw2004-04-151-0/+2
| | | | | | | | | which self-sig we actually chose. * keyedit.c (menu_expire, menu_set_primary_uid, menu_set_preferences): Use it here to avoid updating non-used self-sigs and possibly promoting an old self-sig into consideration again.
* * getkey.c (skip_unusable, merge_selfsigs_main,David Shaw2004-03-161-36/+40
| | | | | | premerge_public_with_secret, lookup, get_user_id_string): --keyid-format conversion.
* * getkey.c (merge_selfsigs_subkey): Do not mark subkeys valid if we do notDavid Shaw2004-03-051-4/+9
| | | | | | | | | support their pk algorithm. This allows for early (during get_*) rejection of a subkey, and selection of another. * passphrase.c (passphrase_to_dek): Give a little more information when we have room to do so.
* * keyedit.c (keyedit_menu): Prompt for subkey removal for both secret andDavid Shaw2004-02-111-3/+11
| | | | | | | | | | | | | | public subkeys. * keylist.c (list_keyblock_print), keyedit.c (show_key_with_all_names): Show the revocation date of a key/subkey, and general formatting work. * packet.h, getkey.c (merge_selfsigs_main, merge_selfsigs_subkey, merge_selfsigs): Keep track of the revocation date of a key. * keydb.h, keyid.c (revokestr_from_pk): New function to print the revocation date of a key.
* * keygen.c (keygen_set_std_prefs): Build the default preferences list atDavid Shaw2004-02-101-13/+15
| | | | | | | | | | | | | | | | | | | | | | 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.
* * getkey.c: Set MAX_PK_CACHE_ENTRIES and MAX_UID_CACHE_ENTRIES toDavid Shaw2004-01-281-11/+15
| | | | | | | | | | | | | | | 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.
* * packet.h, getkey.c (merge_selfsigs, merge_selfsigs_main), pkclist.cDavid Shaw2004-01-221-5/+5
| | | | | | (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.
* * misc.c (pull_in_libs): Dead code. Removed.David Shaw2003-12-301-9/+19
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* * packet.h, build-packet.c (hash_public_key): Remove function ...David Shaw2003-12-111-5/+12
| | | | | | | | | | | | | | | | | | | | * 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.
* * trustdb.c (validate_keys): Reset the trustdb before checking if we haveDavid Shaw2003-11-301-17/+1
| | | | | | | | | | | | | | 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.
* * pkclist.c (build_pk_list): Do not allow an empty PK list in interactiveDavid Shaw2003-11-271-1/+5
| | | | | | | | mode. * getkey.c (get_seckey_byname2): Disallow use of sign+encrypt Elgamal keys.
* * keygen.c (ask_algo): Remove ability to generate Elgamal sign+encryptDavid Shaw2003-11-271-0/+12
| | | | | | | | keys. * getkey.c (merge_selfsigs_main, merge_selfsigs_subkey): Disallow use of sign+encrypt Elgamal keys.
* * keygen.c (do_add_key_flags, parse_parameter_usage): Add supportWerner Koch2003-09-301-1/+8
| | | | | | | | | | | | | | | | | 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. * parse-packet.c (parse_key): Allow to parse the divert-to-card S2K mode. * build-packet.c (do_secret_key): Handle divert-to-card S2K * seckey-cert.c (is_secret_key_protected): Ditto. (check_secret_key): Ditto. * keygen.c (do_ask_passphrase): Renamed from ask_passphrase. * passphrase.c (ask_passphrase): New.
* * keydb.h, keyring.c (keyring_search), trustdb.c (search_skipfnc): ExpandDavid Shaw2003-09-231-16/+36
| | | | | | | | the skipfnc to include a pointer to the user ID that matched. * getkey.c (skip_disabled): Rename to skip_unusable, and add checks for expired or revoked user IDs.
* * keygen.c (do_add_key_flags): Don't set the certify flag for subkeys.David Shaw2003-07-211-3/+1
| | | | | | | | | | | | | | | | | | (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.
* * packet.h, main.h, sig-check.c (signature_check2, check_key_signature2,David Shaw2003-07-201-1/+1
| | | | | | | | | | | 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 theDavid Shaw2003-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unhashed signature cache any longer. * misc.c (pct_expando): Add two new expandos - signer's fingerprint (%g), and signer's primary fingerprint (%p). * Makefile.am: Include W32LIBS where appropriate. * 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. * options.skel: Use subkeys.pgp.net as the default keyserver. * 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.
* * keylist.c (list_one): Don't show the keyring filename when inDavid Shaw2003-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | --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.
* * getkey.c (premerge_public_with_secret): Made "no secret subkey for"David Shaw2003-05-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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)
* * armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,David Shaw2003-05-241-9/+9
| | | | | | | | | 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.
* * trustdb.h, trustdb.c (is_disabled), gpgv.c (is_disabled): RenameDavid Shaw2003-05-211-19/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.