summaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Replace remaining old error code macros by GPG_ERR_.Werner Koch2015-01-221-26/+26
| | | | | | | | | * 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>
* gpg: Remove unused args from a function.Werner Koch2015-01-051-1/+1
| | | | | | | * g10/keyserver.c (parse_keyserver_uri): Remove args configname and configlineno. Change all callers. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Change another BUG() call to a regular error message.Werner Koch2014-11-281-6/+11
| | | | | | * g10/mainproc.c (proc_tree): Replace BUG by a proper error messages. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Fix a NULL-deref for invalid input data.Werner Koch2014-11-171-3/+8
| | | | | | | | | * g10/mainproc.c (proc_encrypted): Take care of canceled passpharse entry. -- GnuPG-bug-id: 1761 Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Make the use of "--verify FILE" for detached sigs harder.Werner Koch2014-11-131-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/openfile.c (open_sigfile): Factor some code out to ... (get_matching_datafile): new function. * g10/plaintext.c (hash_datafiles): Do not try to find matching file in batch mode. * g10/mainproc.c (check_sig_and_print): Print a warning if a possibly matching data file is not used by a standard signatures. -- Allowing to use the abbreviated form for detached signatures is a long standing bug which has only been noticed by the public with the release of 2.1.0. :-( What we do is to remove the ability to check detached signature in --batch using the one file abbreviated mode. This should exhibit problems in scripts which use this insecure practice. We also print a warning if a matching data file exists but was not considered because the detached signature was actually a standard signature: gpgv: Good signature from "Werner Koch (dist sig)" gpgv: WARNING: not a detached signature; \ file 'gnupg-2.1.0.tar.bz2' was NOT verified! We can only print a warning because it is possible that a standard signature is indeed to be verified but by coincidence a file with a matching name is stored alongside the standard signature. Reported-by: Simon Nicolussi (to gnupg-users on Nov 7) Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Re-indent two files.Werner Koch2014-11-131-939/+1024
| | | | --
* gpg: Remove PGP-2 related cruft.Werner Koch2014-11-131-33/+8
| | | | | | | | | | | | | | | | | | | | * g10/armor.c (parse_hash_header,carmor_filter): Ignore MD5 in hash header. (fake_packet): Remove pgp-2 workaround for white space stripping. * g10/filter.h (armor_filter_context_t): Remove field pgp2mode. * g10/options.h (opt): Remove field pgp2_workarounds. * g10/gpg.c (main): Do not set this field. * g10/gpgv.c (main): Ditto. * g10/mainproc.c (proc_encrypted): Use SHA-1 as fallback s2k hash algo. Using MD5 here is useless. (proc_plaintext): Remove PGP-2 related woraround (proc_tree): Remove another workaround but keep the one for PGP-5. -- The removed code was either not anymore used or its use would have caused an error message later anyway. Signed-off-by: Werner Koch <wk@gnupg.org>
* Use a unique capitalization for "Note:".Werner Koch2014-10-101-1/+1
| | | | --
* gpg: Disable an MD5 workaround for pgp2 by default.Werner Koch2014-08-141-12/+15
| | | | | | | * 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.
* po: Update the German (de) translationWerner Koch2014-06-271-1/+1
|
* gpg: Simplify default key listing.Werner Koch2014-06-021-242/+178
| | | | | | | * g10/mainproc.c (list_node): Rework. -- GnuPG-bug-id: 1640
* gpg: Print the key algorithm/curve with signature info.Werner Koch2014-05-071-2/+9
| | | | * g10/mainproc.c (check_sig_and_print): Print the name and curve.
* gpg: Fix memleak in signature verification of bogus keys.Werner Koch2014-05-071-37/+35
| | | | | | | | * g10/mainproc.c (check_sig_and_print): Factor common code out to ... (print_good_bad_signature): here. -- P was not released if the key had no user id.
* gpg: Fix indendation of check_sig_and_print.Werner Koch2014-05-071-332/+347
| | | | --
* Change some keyedit functions to allow printing to arbitrary streams.Werner Koch2014-03-271-3/+3
| | | | | | | | | | | * common/ttyio.c (tty_print_string): Add optional arg FP. Change all callers. (tty_print_utf8_string2): Ditto. * g10/keyedit.c (show_prefs): Ditto. (show_key_with_all_names_colon): Ditto. (show_names): Ditto. * g10/keylist.c (print_revokers): Ditto. (print_fingerprint): Ditto.
* gpg: Change format for the key size in --list-key and --edit-key.Werner Koch2014-02-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oLegacyListMode, opts, main): Add --legacy-list-mode. * g10/options.h (struct opt): Add field legacy_list_mode. * g10/keydb.h (PUBKEY_STRING_SIZE): New. * g10/keyid.c (pubkey_string): New. * g10/import.c (import_one, import_secret_one): Use pubkey_string. * g10/keylist.c (print_seckey_info): Ditto. (print_pubkey_info, print_card_key_info): Ditto. (list_keyblock_print): Ditto. * g10/mainproc.c (list_node): Ditto. * g10/pkclist.c (do_edit_ownertrust, build_pk_list): Ditto. * g10/keyedit.c (show_key_with_all_names): Ditto. Also change the format. (show_basic_key_info): Ditto. * common/openpgp-oid.c (openpgp_curve_to_oid): Also allow "ed25519". (openpgp_oid_to_curve): Downcase "ed25519" -- For ECC it seems to be better to show the name of the curve and not just the size of the prime field. The curve name does not anymore fit into the "<size><letter>" descriptor (e.g. "2048R") and a fixed length format does not work either. Thus the new format uses "rsa2048" - RSA with 2048 bit "elg1024" - Elgamal with 1024 bit "ed25519" - ECC using the curve Ed25519. "E_1.2.3.4" - ECC using the unsupported curve with OID "1.2.3.4". unless --legacy-list-mode is given. In does not anymore line up nicely in columns thus I expect further changes to this new format. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch2014-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/sexputil.c (get_pk_algo_from_canon_sexp): Change to return a string. * g10/keygen.c (check_keygrip): Adjust for change. * sm/certreqgen-ui.c (check_keygrip): Likewise. * agent/pksign.c (do_encode_dsa): Remove bogus map_pk_openpgp_to_gcry. * g10/misc.c (map_pk_openpgp_to_gcry): Remove. (openpgp_pk_test_algo): Change to a wrapper for openpgp_pk_test_algo2. (openpgp_pk_test_algo2): Rewrite. (openpgp_pk_algo_usage, pubkey_nbits): Add support for EdDSA. (openpgp_pk_algo_name): Rewrite to remove need for gcry calls. (pubkey_get_npkey, pubkey_get_nskey): Ditto. (pubkey_get_nsig, pubkey_get_nenc): Ditto. * g10/keygen.c(do_create_from_keygrip): Support EdDSA. (common_gen, gen_ecc, ask_keysize, generate_keypair): Ditto. * g10/build-packet.c (do_key): Ditto. * g10/export.c (transfer_format_to_openpgp): Ditto. * g10/getkey.c (cache_public_key): Ditto. * g10/import.c (transfer_secret_keys): Ditto. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto. * g10/mainproc.c (proc_pubkey_enc): Ditto. * g10/parse-packet.c (parse_key): Ditto, * g10/sign.c (hash_for, sign_file, make_keysig_packet): Ditto. * g10/keyserver.c (print_keyrec): Use openpgp_pk_algo_name. * g10/pkglue.c (pk_verify, pk_encrypt, pk_check_secret_key): Use only OpenPGP algo ids and support EdDSA. * g10/pubkey-enc.c (get_it): Use only OpenPGP algo ids. * g10/seskey.c (encode_md_value): Ditto. -- This patch separates Libgcrypt and OpenPGP public key algorithms ids and in most cases completely removes the Libgcrypt ones. This is useful because for Libgcrypt we specify the algorithm in the S-expressions and the public key ids are not anymore needed. This patch also adds some support for PUBKEY_ALGO_EDDSA which will eventually be used instead of merging EdDSA with ECDSA. As of now an experimental algorithm id is used but the plan is to write an I-D so that we can get a new id from the IETF. Note that EdDSA (Ed25519) does not yet work and that more changes are required. The ECC support is still broken right now. Needs to be fixed. Signed-off-by: Werner Koch <wk@gnupg.org>
* 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>
* gpg: Change --show-session-key to print the session key earlier.Werner Koch2013-12-111-10/+1
| | | | | | | | | | | | | | | | | | * g10/cpr.c (write_status_strings): New. (write_status_text): Replace code by a call to write_status_strings. * g10/mainproc.c (proc_encrypted): Remove show_session_key code. * g10/decrypt-data.c (decrypt_data): Add new show_session_key code. -- This feature can be used to return the session key for just a part of a file. For example to downloading just the first 32k of a huge file, decrypting that incomplete part and while ignoring all the errors break out the session key. The session key may then be used on the server to decrypt the entire file without the need to have the private key on the server. GnuPG-bug-id: 1389 Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Limit the nesting level of I/O filters.Werner Koch2013-10-041-30/+48
| | | | | | | | | | | | | | | | | | | | | | | | * common/iobuf.c (MAX_NESTING_FILTER): New. (iobuf_push_filter2): Limit the nesting level. * g10/mainproc.c (mainproc_context): New field ANY. Change HAVE_DATA and ANY_SIG_SIGN to bit fields of ANY. Add bit field UNCOMPRESS_FAILED. (proc_compressed): Avoid printing multiple Bad Data messages. (check_nesting): Return GPG_ERR_BAD_DATA instead of UNEXPECTED_DATA. -- This is a more general fix for the nested compression packet bug. In particular this helps g10/import.c:read_block to stop pushing compression filters onto an iobuf stream. This patch also reduces the number of error messages for the non-import case. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 35e40e2d514223c950c2f6d1214e02e92d87e997) Resolved conflicts: common/iobuf.c g10/mainproc.c
* gpg: Fix bug with deeply nested compressed packets.Werner Koch2013-10-021-9/+43
| | | | | | | | | | * g10/mainproc.c (MAX_NESTING_DEPTH): New. (proc_compressed): Return an error code. (check_nesting): New. (do_proc_packets): Check packet nesting depth. Handle errors from check_compressed. Signed-off-by: Werner Koch <wk@gnupg.org>
* Change all quotes in strings and comments to the new GNU standard.Werner Koch2012-06-051-1/+1
| | | | | | | | | | | | | | | | | | | The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
* Add tweaks for the not anymore patented IDEA algorithm.Werner Koch2012-05-081-7/+0
| | | | | | | | | | | | | | | * g10/keygen.c (keygen_set_std_prefs): Include IDEA only in PGP2 compatibility mode. * g10/misc.c (idea_cipher_warn): Remove. Also remove all callers. * common/status.h (STATUS_RSA_OR_IDEA): Remove. Do not emit this status anymore. -- To keep the number of actually used algorithms low, we want to support IDEA only in a basically read-only way (unless --pgp2 is used during key generation). It does not make sense to suggest the use of this old 64 bit blocksize algorithm. However, there is old data available where it might be helpful to have IDEA available.
* Allow compress algorithm 0.Werner Koch2012-03-261-3/+1
| | | | | * g10/mainproc.c (proc_compressed): Remove superfluous check for compress algorithm 0. Reported by pfandrade. This is bug#1326.
* Replace gcry_md_start_debug by gcry_md_debug.Werner Koch2011-09-201-4/+4
| | | | | This is to allow building with Libgcrypt master (1.6) which has some cleanups in the API/ABI.
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-34/+34
| | | | | | | | 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.
* Integrating http://code.google.com/p/gnupg-ecc/source/detail?r=15 .Andrey Jivsov2011-01-061-2/+4
| | | | | | | | | | The following works: gpg2 --gen-key (ECC) gpg2 --list-keys gpg2 --list-packets ~/.gnupg/pubring.gpg gpg2 --list-packets <private key from http://sites.google.com/site/brainhub/pgpecckeys> ECDH doesn't work yet as the code must be re-written to adjust for gpg-agent refactoring.
* Make public key data structure easier to read.Werner Koch2010-10-201-2/+2
| | | | | Check vor v1 card while signing.
* Exporting secret keys via gpg-agent is now basically supported.Werner Koch2010-10-011-17/+24
| | | | | | A couple of forward ported changes. Doc updates.
* Removed more secret key related code.Werner Koch2010-09-061-10/+7
| | | | | | It builds fine and passes some of the tests but there are quite some features which don't work yet.
* Some work on the dirmngrWerner Koch2010-07-231-0/+3
|
* Decryption and signi via agent is now implemented.Werner Koch2010-04-231-64/+68
|
* More changes on the way to remove secring.gpg.Werner Koch2010-04-211-1/+1
|
* Finished the bulk of changes to use estream in most places instead ofWerner Koch2010-03-151-8/+9
| | | | | stdio.
* Removed almost al dup calls.Werner Koch2010-03-081-2/+7
|
* Various changes to eventually support openpgp keys in pgp-agent.Werner Koch2010-02-021-1/+1
| | | | | | Comment fixes. Minor chnages in preparation of a W32CE port.
* Add dummu option --passwd for gpg.Werner Koch2010-01-081-1/+7
| | | | | Collected changes.
* [g13] Add RECIPEINT and CREATE command.Werner Koch2009-10-191-0/+2
| | | | | [sm] Chnage --include-certs default
* 2009-08-20 Daiki Ueno <ueno@unixuser.org>Werner Koch2009-08-201-0/+7
| | | | | | | | | * mainproc.c (proc_encrypted): Clear passphrase cached with S2K cache ID if decryption failed. * passphrase.c (passphrase_to_dek_ext): Set dek->s2k_cacheid. * gpgv.c (passphrase_clear_cache): New stub.
* Add full Camellia support.David Shaw2009-06-051-2/+2
| | | | | | | | | | | | | | | | | | * configure.ac: Remove Camellia restriction. * gpg.c (main), misc.c (openpgp_cipher_test_algo): Remove Camellia restriction. * misc.c (map_cipher_openpgp_to_gcry), main.h: Add macros for openpgp_cipher_open, openpgp_cipher_get_algo_keylen, and openpgp_cipher_get_algo_blklen to wrap around the corresponding gcry_* functions, but pass the algorithm number through map_cipher_openpgp_to_gcry. This is needed in case the gcry algorithm number doesn't match the OpenPGP number (c.f. Camellia). * encr-data.c, pubkey-enc.c, mainproc.c, cipher.c, encode.c, seskey.c, passphrase.c, seckey-cert.c: Use new openpgp_cipher_* macros here.
* New gpgsm server option no-encrypt-to.Werner Koch2009-05-181-2/+2
| | | | | | Add caching for symkey encryption. Minor cleanups.
* Print NO_SECKEY status line in gpgsm.Werner Koch2009-03-251-2/+2
| | | | | This fixes bug#1020.
* * main.h, mainproc.c (check_sig_and_print), keylist.cDavid Shaw2008-10-031-3/+4
| | | | | | | | | (list_keyblock_print), pkclist.c (do_edit_ownertrust), keyedit.c (menu_showphoto), photoid.c (generate_photo_id, show_photos), misc.c (pct_expando): Add %v and %V expandos so that displaying photo IDs can show the attribute validity tag (%v) and string (%V). Originally by Daniel Gillmor.
* Support DSA2.Werner Koch2007-12-121-5/+5
| | | | | | Support Camellia for testing. More audit stuff.
* Allow decryption using type 20 Elgamal keys.Werner Koch2007-12-111-4/+10
|
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* * packet.h, mainproc.c (reset_literals_seen): New function to resetDavid Shaw2007-05-031-2/+8
| | | | | | | | | the literals count. * verify.c (verify_one_file), decrypt.c (decrypt_messages): Call it here so we allow multiple literals in --multifile mode (in different files - not concatenated together).
* Ported multiple-messages protection.Werner Koch2007-03-051-9/+36
|
* Add new SVN only file README.maintWerner Koch2007-02-261-2/+3
| | | | | | | | | | | | | | | | doc/ * gpg.texi (GPG Configuration): Document envvar LANGUAGE. (GPG Configuration Options): Document show-primary-uid-only. g10/ * gpg.c (main): Add verify option show-primary-uid-only. * options.h (VERIFY_SHOW_PRIMARY_UID_ONLY): New. * mainproc.c (check_sig_and_print): Implement it. * encr-data.c (decrypt_data): Correctly test for unknown algorithm. * import.c (check_prefs): Ditto. * keyedit.c (show_prefs): Ditto. * mainproc.c (proc_symkey_enc): Ditto.
* Started to code a --server mode. Werner Koch2006-12-211-16/+99
| | | | | It is far from being ready!