summaryrefslogtreecommitdiffstats
path: root/g10/sig-check.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* gpg: Fix printing of pubkey algo in --verbose signature verify.Werner Koch2016-09-011-27/+31
| | | | | | | | | | | | | | | | | | | * g10/sig-check.c (check_signature2): Replace arg PK by R_PK and change the semantics. Also clear the other R_ args on function entry, use gpg_error() and change retturn type to gpg_error_t. * g10/mainproc.c (do_check_sig): Add arg R_PK. (list_node): Pass NULL for new arg. (check_sig_and_print): Rework to make use of the returned PK. -- The output gpg: textmode signature, digest algorithm SHA256, key algorithm rsa2048 showed the pubkey algo of the primary key which was surprising. Changed to print the algo of the subkey used for verification. Signed-off-by: Werner Koch <wk@gnupg.org>
* g10: Fix checking key for signature validation.NIIBE Yutaka2016-08-041-2/+2
| | | | | | | | | | | | * g10/sig-check.c (check_signature2): Not only subkey, but also primary key should have flags.valid=1. -- The tweak of gpgv in e32c575e0f3704e7563048eea6d26844bdfc494b only makes sense with this change. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* g10: Fix signature checking.NIIBE Yutaka2016-05-111-4/+9
| | | | | | | | | | | | * g10/sig-check.c (check_signature_over_key_or_uid): Fix call to walk_kbnode. -- Thanks to Vincent Brillault (Feandil). GnuPG-bug-id: 2351 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-291-9/+8
| | | | Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Prettify a 2 octet hex output.Werner Koch2016-02-261-1/+2
| | | | | | * g10/sig-check.c (check_key_signature2): Wrap line and use %02x. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Show debugging info if a sig with an unsupported sig class is used.Neal H. Walfield2016-02-251-1/+6
| | | | | | | | | * g10/sig-check.c (check_key_signature2): If SIG->CLASS is unsupported, show some debugging information. Don't use BUG to fail. Just return GPG_ERR_BAD_SIGNATURE. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
* gpg: Split check_key_signature2.Neal H. Walfield2016-02-191-92/+273
| | | | | | | | | | | | * g10/sig-check.c (hash_uid_node): Rename from this... (hash_uid_packet): ... to this. Take a PKT_user_id instead of a KBNODE. (check_key_signature2): Split the basic signature checking functionality into... (check_signature_over_key_or_uid): ... this new function. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
* gpg: Split the function check_signature_end.Neal H. Walfield2016-02-191-5/+23
| | | | | | | | | * g10/sig-check.c (check_signature_end): Break the basic signature check into... (check_signature_end_simple): ... this new function. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
* gpg: Use "days" in "...newer than..." diagnostics.Werner Koch2016-01-181-10/+35
| | | | | | | | | | | * g10/sig-check.c (check_signature_metadata_validity): Use days if useful. -- Using days instead of a high number of seconds is for the majority of users a better measurement. Signed-off-by: Werner Koch <wk@gnupg.org>
* Use ngettext for some strings.Werner Koch2016-01-181-11/+10
| | | | | | | | | | | | | | | | | * scd/app-openpgp.c (build_enter_admin_pin_prompt): Use ngettext for some diagnostics. (do_genkey): Ditto. * g10/keyedit.c (check_all_keysigs, menu_delsig, menu_clean): Ditto. * g10/keylist.c (print_signature_stats): Ditto. * g10/keyserver.c (keyserver_refresh): Ditto. * g10/sig-check.c (check_signature_metadata_validity): Ditto. * g10/sign.c (do_sign): Ditto. * g10/trustdb.c (reset_trust_records): Ditto. (validate_keys): Use a table like diagnostic output. -- Suggested-by: Ineiev <ineiev@gnu.org> Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Re-indent check_key_signature2.Werner Koch2016-01-121-284/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | -- I am considering some changes and thus better start off by switching to standard GNU indentation. This patch also changes comment lines like if (foo) /* Comment on foo. */ { to if (foo) { /* Comment on foo. */ or if (foo) /* Comment on foo. */ { to make the brace of the opening block stand out immediately. Further stars on the left are added to longer comments because that makes the code easier to read by disabled hackers, when reading without font locking, and for reading black-white printouts.
* Fix typos found using codespell.Justus Winter2015-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/cache.c: Fix typos. * agent/call-pinentry.c: Likewise. * agent/call-scd.c: Likewise. * agent/command-ssh.c: Likewise. * agent/command.c: Likewise. * agent/divert-scd.c: Likewise. * agent/findkey.c: Likewise. * agent/gpg-agent.c: Likewise. * agent/w32main.c: Likewise. * common/argparse.c: Likewise. * common/audit.c: Likewise. * common/audit.h: Likewise. * common/convert.c: Likewise. * common/dotlock.c: Likewise. * common/exechelp-posix.c: Likewise. * common/exechelp-w32.c: Likewise. * common/exechelp-w32ce.c: Likewise. * common/exechelp.h: Likewise. * common/helpfile.c: Likewise. * common/i18n.h: Likewise. * common/iobuf.c: Likewise. * common/iobuf.h: Likewise. * common/localename.c: Likewise. * common/logging.c: Likewise. * common/openpgp-oid.c: Likewise. * common/session-env.c: Likewise. * common/sexputil.c: Likewise. * common/sysutils.c: Likewise. * common/t-sexputil.c: Likewise. * common/ttyio.c: Likewise. * common/util.h: Likewise. * dirmngr/cdblib.c: Likewise. * dirmngr/certcache.c: Likewise. * dirmngr/crlcache.c: Likewise. * dirmngr/dirmngr-client.c: Likewise. * dirmngr/dirmngr.c: Likewise. * dirmngr/dirmngr_ldap.c: Likewise. * dirmngr/dns-stuff.c: Likewise. * dirmngr/http.c: Likewise. * dirmngr/ks-engine-hkp.c: Likewise. * dirmngr/ks-engine-ldap.c: Likewise. * dirmngr/ldap-wrapper.c: Likewise. * dirmngr/ldap.c: Likewise. * dirmngr/misc.c: Likewise. * dirmngr/ocsp.c: Likewise. * dirmngr/validate.c: Likewise. * g10/encrypt.c: Likewise. * g10/getkey.c: Likewise. * g10/gpg.c: Likewise. * g10/gpgv.c: Likewise. * g10/import.c: Likewise. * g10/keydb.c: Likewise. * g10/keydb.h: Likewise. * g10/keygen.c: Likewise. * g10/keyid.c: Likewise. * g10/keylist.c: Likewise. * g10/keyring.c: Likewise. * g10/mainproc.c: Likewise. * g10/misc.c: Likewise. * g10/options.h: Likewise. * g10/packet.h: Likewise. * g10/parse-packet.c: Likewise. * g10/pkclist.c: Likewise. * g10/pkglue.c: Likewise. * g10/plaintext.c: Likewise. * g10/server.c: Likewise. * g10/sig-check.c: Likewise. * g10/sqlite.c: Likewise. * g10/tdbio.c: Likewise. * g10/test-stubs.c: Likewise. * g10/tofu.c: Likewise. * g10/trust.c: Likewise. * g10/trustdb.c: Likewise. * g13/create.c: Likewise. * g13/mountinfo.c: Likewise. * kbx/keybox-blob.c: Likewise. * kbx/keybox-file.c: Likewise. * kbx/keybox-init.c: Likewise. * kbx/keybox-search-desc.h: Likewise. * kbx/keybox-search.c: Likewise. * kbx/keybox-update.c: Likewise. * scd/apdu.c: Likewise. * scd/app-openpgp.c: Likewise. * scd/app-p15.c: Likewise. * scd/app.c: Likewise. * scd/ccid-driver.c: Likewise. * scd/command.c: Likewise. * scd/iso7816.c: Likewise. * sm/base64.c: Likewise. * sm/call-agent.c: Likewise. * sm/call-dirmngr.c: Likewise. * sm/certchain.c: Likewise. * sm/gpgsm.c: Likewise. * sm/import.c: Likewise. * sm/keydb.c: Likewise. * sm/minip12.c: Likewise. * sm/qualified.c: Likewise. * sm/server.c: Likewise. * tools/gpg-check-pattern.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgkey2ssh.c: Likewise. * tools/gpgparsemail.c: Likewise. * tools/gpgtar.c: Likewise. * tools/rfc822parse.c: Likewise. * tools/symcryptrun.c: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
* gpg: Ensure all weak digest rejection notices are shownDaniel Kahn Gillmor2015-10-261-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/main.h: Add rejection_shown flag to each weakhash struct * g10/misc.c (print_digest_algo_note, additional_weak_digest): Do not treat MD5 separately; (print_digest_rejected_note): Use weakhash.rejection_shown instead of static shown. * g10/options.h (opt): Change from additional_weak_digests to weak_digests. * g10/sig-check.c: Do not treat MD5 separately. * g10/gpg.c (main): Explicitly set MD5 as weak. * g10/gpgv.c (main): Explicitly set MD5 as weak. -- Previously, only one weak digest rejection message was shown, of whichever was the first type encountered. This meant that if "gpg --weak-digest SHA224" encountered both an MD5 digest and a SHA224 digest, it would only show the user that the MD5 digest was rejected. In order to let the user know which algorithms were rejected, we needed to move the "shown" flag into a per-weak-algorithm location. Given this additional complication, it made no sense to continue to treat MD5 specially, so it is added as a default weak algorithm in the same opt.weak_digests data structure as any other. Signed-Off-By: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* gpg: Improve function documentation and some comments.Neal H. Walfield2015-10-191-43/+197
| | | | | | | | | * g10/main.h: Improve function documentation. * g10/packet.h.h: Improve function documentation. * g10/sig-check.c: Improve function documentation and some comments. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
* gpg: Improve and regularize naming of signature checking functions.Neal H. Walfield2015-10-191-25/+33
| | | | | | | | | | | | | | * g10/packet.h (signature_check): Rename from this... (check_signature): ... to this. Update users. (signature_check2): Rename from this... (check_signature2): ... to this. Update users. * g10/sig-check.c (do_check): Rename from this... (check_signature_end): ... to this. Update users. (do_check_messages): Rename from this... (check_signature_metadata_validity): ... to this. Update users. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
* gpg: Print warning when rejecting weak digestsDaniel Kahn Gillmor2015-10-191-2/+8
| | | | | | | | | | | | | | | | * g10/misc.c (print_md5_rejected_note): Rename to .. (print_digest_rejected_note): this. Parameterize function to take an enum gcry_md_algos. * g10/sig-check.c: Use print_digest_rejected_note() when rejecting signatures. -- 76afaed65e3b0ddfa4923cb577ada43217dd4b18 allowed extra --weak-digests, but removed the one call to print_md5_rejected_note(). This replaces and generalizes that warning. Signed-Off-By: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* gpg: Add option --weak-digest to gpg and gpgv.Daniel Kahn Gillmor2015-10-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/options.h: Add additional_weak_digests linked list to opts. * g10/main.h: Declare weakhash linked list struct and additional_weak_digest() function to insert newly-declared weak digests into opts. * g10/misc.c: (additional_weak_digest): New function. (print_digest_algo_note): Check for deprecated digests; use proper gcry_md_algos type. * g10/sig-check.c: (do_check): Reject weak digests in addition to MD5. * g10/gpg.c: Add --weak-digest option to gpg. * doc/gpg.texi: Document gpg --weak-digest option. * g10/gpgv.c: Add --weak-digest option to gpgv. * doc/gpgv.texi: Document gpgv --weak-digest option. -- gpg and gpgv treat signatures made over MD5 as unreliable, unless the user supplies --allow-weak-digests to gpg. Signatures over any other digest are considered acceptable. Despite SHA-1 being a mandatory-to-implement digest algorithm in RFC 4880, the collision-resistance of SHA-1 is weaker than anyone would like it to be. Some operators of high-value targets that depend on OpenPGP signatures may wish to require their signers to use a stronger digest algorithm than SHA1, even if the OpenPGP ecosystem at large cannot deprecate SHA1 entirely today. This changeset adds a new "--weak-digest DIGEST" option for both gpg and gpgv, which makes it straightforward for anyone to treat any signature or certification made over the specified digest as unreliable. This option can be supplied multiple times if the operator wishes to deprecate multiple digest algorithms, and will be ignored completely if the operator supplies --allow-weak-digests (as before). MD5 is still always considered weak, regardless of any further --weak-digest options supplied. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Capitialized some comments, shorted a line in do_check, and changed subject to name the option. -wk
* g10: Remove unused struct cmp_help_context_s.Neal H. Walfield2015-09-291-6/+0
| | | | | | | * g10/sig-check.c (struct cmp_help_context_s) Remove unused struct. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>.
* g10: Avoid an unnecessary copy.Neal H. Walfield2015-09-291-4/+20
| | | | | | | | | * g10/sig-check.c (signature_check2): Avoid copying PK to RET_PK. Instead, directly use the provided storage. If none is provided allocate some. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>.
* gpg: Replace remaining uses of stdio by estream.Werner Koch2015-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * g10/sign.c (sign_file): Use log_printf instead of stderr. * g10/tdbdump.c (export_ownertrust): Use estream fucntions. (import_ownertrust): Ditto. * g10/tdbio.c (tdbio_dump_record): Ditto. Change arg to estream_t. -- Reported-by: Guilhem Moulin <guilhem@fripost.org> Needed for unattended key edits with --status-fd, because since 2.1 status prompts are preceded by es_fflush (in cpr.c:do_get_from_fd) not fflush(3), so the standard output may not be flushed before each prompt. (Which breaks scripts using select(2) to multiplex between the standard and status outputs.) His patch only affected print_and_check_one_sig_colon() but there are many more places where stdio and estream are mixed. This patch now replaces most of them in g10/. At some places stdio is still used, but that is local to a function and should not have side effects. Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: Change remaining http links to gnupg.org to httpsWerner Koch2015-02-111-1/+1
| | | | | -- GnuPG-bug-id: 1830
* gpg: Replace remaining old error code macros by GPG_ERR_.Werner Koch2015-01-221-15/+18
| | | | | | | | | * g10/gpg.h (g10_errstr): Remove macro and change all occurrences by gpg_strerror. (G10ERR_): Remove all macros and change all occurrences by their GPG_ERR_ counterparts. Signed-off-by: Werner Koch <wk@gnupg.org>
* Use a unique capitalization for "Note:".Werner Koch2014-10-101-2/+2
| | | | --
* gpg: Disable an MD5 workaround for pgp2 by default.Werner Koch2014-08-141-10/+1
| | | | | | | * g10/sig-check.c (do_check): Move some code to ... * g10/misc.c (print_md5_rejected_note): new function. * g10/mainproc.c (proc_tree, proc_plaintext): Enable MD5 workaround only if option --allow-weak-digest-algos is used.
* gpg: Reject signatures made with MD5.Werner Koch2014-03-171-0/+16
| | | | | | | | * g10/gpg.c: Add option --allow-weak-digest-algos. (main): Set option also in PGP2 mode. * g10/options.h (struct opt): Add flags.allow_weak_digest_algos. * g10/sig-check.c (do_check): Reject MD5 signatures. * tests/openpgp/defs.inc: Add allow_weak_digest_algos to gpg.conf.
* gpg: Remove cipher.h and put algo ids into a common file.Werner Koch2014-01-291-1/+0
| | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t) (compress_algo_t): New. * agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h. * g10/cipher.h (DEK): Move to ... * g10/dek.h: new file. * g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA) (PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC) (PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT) (PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to * g10/packet.h: here. * g10/cipher.h: Remove. Remove from all files. * g10/filter.h, g10/packet.h: Include dek.h. * g10/Makefile.am (common_source): Remove cipher.h. Add dek.h. Signed-off-by: Werner Koch <wk@gnupg.org>
* Fixed set but unused variable bugsWerner Koch2011-08-101-3/+0
|
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-10/+10
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* Removed deprecated SIGEXPIRED status line.Werner Koch2011-02-041-2/+0
|
* Make public key data structure easier to read.Werner Koch2010-10-201-10/+9
| | | | | Check vor v1 card while signing.
* Generating an OpenPGP key cia gpg-agent basically works.Werner Koch2010-04-201-1/+1
|
* Fix bug#1059 (missing status line signature verification done with aWerner Koch2009-12-171-1/+5
| | | | | subkey while on the main key has expired).
* Make gpg not depend on the RIPE-MD160 implementaion in Libgcrypt.Werner Koch2008-12-111-33/+56
| | | | | Fix SIG_ID computation.
* Print a note for revoked signing keys.Werner Koch2008-05-081-2/+8
|
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Fix for bug 797.Werner Koch2007-05-161-12/+15
|
* Continued with merging.Werner Koch2006-04-191-1/+1
| | | | | Still does not build.
* Merged with gpg 1.4.3 code. Werner Koch2006-04-191-147/+207
| | | | | The gpg part does not yet build.
* Merged most of David Shaw's changes in 1.3 since 2003-06-03.Werner Koch2003-09-231-32/+49
|
* Adjusted for use with current libgcrypt (1.1.42).Werner Koch2003-07-281-1/+1
|
* Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch2003-06-181-158/+91
| | | | | | | | | | | to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
* This commit was manufactured by cvs2svn to create branchRepo Admin2003-06-051-0/+625
| | | | 'GNUPG-1-9-BRANCH'.
* This commit was manufactured by cvs2svn to create branchRepo Admin2002-10-191-619/+0
| | | | 'GNUPG-1-9-BRANCH'.
* * getkey.c (get_pubkey_direct): Don't cache keys retrieved via thisDavid Shaw2002-10-051-3/+1
| | | | | | | | | function as they may not have all their fields filled in. * sig-check.c (signature_check2): Use new is_primary flag to check rather than comparing main_keyid with keyid as this still works in the case of a not fully filled in pk.
* 2002-09-28 David Shaw <dshaw@jabberwocky.com>David Shaw2002-09-281-2/+5
| | | | | | | | | | | | | | * export.c (do_export_stream): Comment. * sig-check.c (check_key_signature2): Properly handle a non-designated revocation import. 2002-09-26 Werner Koch <wk@gnupg.org> * g10.c (set_homedir): New. Changed all direct assignments to use this. * gpgv.c (set_homedir): Ditto.
* * import.c (import_keys_stream): Fix compiler type warning.David Shaw2002-09-241-3/+3
| | | | | | * keyring.c (keyring_rebuild_cache), sig-check.c (check_key_signature2), import.c (import, chk_self_sigs): Minor language cleanups.
* From stable branchDavid Shaw2002-09-171-1/+2
| | | | | | | | | | | | | | * keyedit.c (menu_addrevoker): The direct key signature for revocation keys must be at least v4 to carry the revocation key subpacket. Add a PGP 2.x warning for revocation keys. * g10.c (check_permissions): Rearrange strings to make translating easier (don't incorporate string parts). * keyedit.c (sign_uids): Make strings translatable. * sig-check.c (check_key_signature2): Make string translatable.
* Import from stable branch.David Shaw2002-09-131-5/+76
| | | | | | | | | | | | | | | | | | | | 2002-09-13 David Shaw <dshaw@jabberwocky.com> * getkey.c (check_revocation_keys): Move.... * main.h, sig-check.c (check_revocation_keys): to here. Also return the signature_check error code rather than 0/1 and cache the sig result. * sig-check.c (check_key_signature2): Divert to check_revocation_keys if a revocation sig is made by someone other than the pk owner. * getkey.c (merge_selfsigs_main): Tidy. 2002-09-13 Werner Koch <wk@gnupg.org> * g10.c (main) [__MINGW32__]: Activate oLoadExtension.
* * sig-check.c (do_check_messages, do_check): Show keyid in error messages.David Shaw2002-08-281-9/+11
| | | | | | * keyserver.c (print_keyinfo): More readable key listings for --search-keys responses.