aboutsummaryrefslogtreecommitdiffstats
path: root/g10/filter.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: New commands --add-recipients and --change-recipients.Werner Koch2024-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (aAddRecipients, aChangeRecipients): New consts. (opts): Add --add-recipients and --change-recipients. (main): Handle them. * g10/gpg.h (struct server_control_s): Add fields modify_recipients, clear_recipients, and last_read_ctb. * g10/armor.c (was_armored): New. * g10/decrypt.c (decrypt_message): Add optional arg 'remusr'. Handle re-encryption if desired. * g10/encrypt.c (write_pubkey_enc): Factor info printing out to ... (show_encrypted_for_user_info): new. (reencrypt_to_new_recipients): New. * g10/packet.h (struct parse_packet_ctx_s): Add fields only_fookey_enc and last_ctb. (init_parse_packet): Clear them. * g10/parse-packet.c (parse): Store CTB in the context. Early return on pubkey_enc and symkey_enc packets if requested. * g10/mainproc.c (proc_encrypted): Allow for PKT being NULL. Return early in modify-recipients mode. (proc_encryption_packets): Add two optional args 'r_dek' and 'r_list'. Adjust callers. Call do_proc_packets in modify-recipients mode depending on the optional args. (do_proc_packets): Add arg 'keep_dek_and_list'. Adjust callers. Save the last read CTB in CTRL and return after the last fooenc_enc packets. -- This basically works but does not yet handle symmetric encrypted packets (symkey_enc). GnuPG-bug-id: 1825 (Yes, this is an at least 9 year old feature request)
* gpg: Add parallelized filter for hashing.NIIBE Yutaka2023-07-251-0/+4
| | | | | | | | | | | | | | | | | | | * g10/options.h (COMPAT_PARALLELIZED): New. * g10/filter.h (md_thd_filter_context_t): New type. (md_thd_filter_set_md, md_thd_filter): New. * g10/gpg.c (compatibility_flags): Update to support COMPAT_PARALLELIZED. * g10/mdfilter.c (struct md_thd_filter_context): New. (lock_md, unlock_md, get_buffer_to_hash, put_buffer_to_recv): New. (get_buffer_to_fill, put_buffer_to_send, md_thread): New. (md_thd_filter, md_thd_filter_set_md): New. * g10/sign.c (sign_file): Add support for md_thd_filter. (sign_symencrypt_file): Likewise. -- GnuPG-bug-id: 6570 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Make progress work for large files on Windows.Werner Koch2023-06-131-3/+3
| | | | | | | | | | | | | | | | | | * common/iobuf.c (iobuf_get_filelength): Change return type to uint64_t and remove the overflow args. For Windows always use GetFileSizeEx which is available since the long EOL-ed Windows XP. * g10/sign.c (write_plaintext_packet): Adjust for changed iobuf_get_filelength. * g10/encrypt.c (encrypt_simple, encrypt_crypt): Ditto. * g10/photoid.c (generate_photo_id): Ditto. Also add an upper limit. * g10/filter.h (progress_filter_context_t): Change amount values to use uint64_t. * g10/progress.c (write_status_progress): Change accordingly. -- GnuPG-bug-id: 6534
* gpg: Allow --dearmor to decode all kinds of armor files.Werner Koch2022-01-281-0/+2
| | | | | | | | | | | * g10/filter.h (armor_filter_context_t): New fields dearmor_mode and dearmor_state. * g10/dearmor.c (dearmor_file): Set dearmor_mode. * g10/armor.c (is_armor_header): Magic to switch to generic dearmor mode. (parse_header_line): Treat non OpenPGP armor in a special way. (check_input): Ditto. (radix64_read): Detect non OpenPGP armor END lines.
* g10/armor: use libgcrypt's CRC24 implementationJussi Kivilinna2018-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/armor.c (CRCINIT, CRCPOLY, CRCUPDATE, crc_table): Remove. (new_armor_context): Open libgcrypt CRC24 context. (release_armor_context): Close CRC24 context. (initialize): Remove CRC table generation. (get_afx_crc): New. (check_input, fake_packet, radix64_read, armor_filter): Update to use CRC24 context. * g10/filter.h (armor_filter_context_t): Replace crc intermediate value with libgcrypt md context pointer. -- This patch changes armor filter to use optimized CRC24 implementation from libgcrypt to speed up encryption and decryption. Benchmark results below, tested on Intel Core i7-4790K (turbo off). Encrypted 2 GiB through pipe to ramfs file using AES128. Decrypt ramfs file out through pipe to /dev/null. before patch-set ---------------- gpg process armor: user time pipe transfer rate encrypt-aead: 13.8 140 MB/s decrypt-aead: 30.6 68 MB/s encrypt-cfb: 17.4 114 MB/s decrypt-cfb: 32.6 64 MB/s after (decrypt+iobuf+crc opt) ----------------------------- gpg process armor: user time pipe transfer rate encrypt-aead: 8.7 211 MB/s decrypt-aead: 17.6 116 MB/s encrypt-cfb: 12.6 153 MB/s decrypt-cfb: 19.6 105 MB/s Signed-off-by: Jussi Kivilinna <[email protected]>
* g10/armor: remove unused unarmor_pump codeJussi Kivilinna2018-11-081-5/+0
| | | | | | | | | | * g10/armor.c (unarmor_state_e, unarmor_pump_s, unarmor_pump_new) (unarmor_pump_release, unarmor_pump): Remove. * g10/filter.h (UnarmorPump, unarmor_pump_new, unarmor_pump_release) (unarmor_pump): Remove. -- Signed-off-by: Jussi Kivilinna <[email protected]>
* Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-05-131-3/+4
|\ | | | | | | | | | | | | | | | | | | -- Resolved Conflicts: NEWS - removed configure.ac - removed Signed-off-by: Werner Koch <[email protected]>
| * gpg: Fix minor memory leak in the compress filter.Werner Koch2018-05-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | * g10/compress.c (push_compress_filter2): Return an error if no filter was pushed. (push_compress_filter): Ditto. (handle_compressed): Free CFX if no filter was pushed. * g10/import.c (read_block): Ditto. -- GnuPG-bug-id: 3898, 3930 Signed-off-by: Werner Koch <[email protected]>
* | gpg: First take on PKT_ENCRYPTED_AEAD.Werner Koch2018-01-211-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (PKT_ENCRYPTED_AEAD): New const. * g10/dek.h (DEK): Increase size of use_aead to 4 bits. * g10/filter.h (cipher_filter_context_t): Add new fields for AEAD. * g10/packet.h (PKT_encrypted): Add fields aead_algo, cipher_algo, and chunkbyte. * g10/build-packet.c (do_encrypted_aead): New. (build_packet): Call it. * g10/parse-packet.c (dump_sig_subpkt): Handle SIGSUBPKT_PREF_AEAD. (parse_one_sig_subpkt, can_handle_critical): Ditto. (parse_encrypted): Clear new PKT_ENCRYPTED fields. (parse_encrypted_aead): New. (parse): Call it. * g10/gpg.c (main): Take care of --rfc4880bis option when checking compliance. * g10/cipher-aead.c: Replace the stub by real code. * g10/decrypt-data.c (decode_filter_ctx_t): Add fields for use with AEAD. (aead_set_nonce): New. (aead_set_ad): New. (decrypt_data): Support AEAD. (aead_underflow): New. (aead_decode_filter): New. * g10/encrypt.c (use_aead): Make that new fucntion work. (encrypt_simple): Use default_aead_algo() instead of EAX. * g10/mainproc.c (proc_encrypted): Support AEAD. (do_proc_packets): Support PKT_ENCRYPTED_AEAD. -- This code has seen only a very few manual tests. Encrypting always uses a 64k chunks and decryption has not been tested with larger chunks. Those small chunks make debugging much faster. Tests can be done using: gpg --rfc4880bis --pinentry-mode=loopback --passphrase abc \ --force-aead --aead-algo ocb --s2k-mode 0 --cipher AES \ -v -z 0 --status-fd 2 -c <INFILE >OUTFILE and gpg --rfc4880bis --pinentry-mode=loopback --passphrase=abc \ --status-fd 2 -v -d <INFILE >OUTFILE Signed-off-by: Werner Koch <[email protected]>
* | gpg: Add stub function for encrypting AEAD.Werner Koch2018-01-101-2/+6
|/ | | | | | | | | | | | | * g10/cipher.c (cipher_filter): Rename to cipher_filter_cfb. * g10/cipher-aead.c: New. Right now only with a stub function. * g10/Makefile.am (gpg_sources): Add file. * g10/encrypt.c (encrypt_simple): Push either cipher_filter_cfb or cipher_filter_aead. (encrypt_crypt): Ditto. (encrypt_filter): Ditto. * g10/sign.c (sign_symencrypt_file): Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpg: Print a warning for too much data encrypted with 3DES et al.Werner Koch2017-12-131-2/+3
| | | | | | | | | | | | | | | * g10/filter.h (cipher_filter_context_t): Remove unused filed 'create_mdc'. Turn field 'header' into a bit field. Add new fields 'short_blklen_warn' and 'short_blklen_count'. * g10/cipher.c (write_header): Print a warning if MDC is not used. (cipher_filter): Print a warning for long messages encrypted with a short block length algorithm. -- Note that to test this warning in a reliable way compression needs to be disabled. Signed-off-by: Werner Koch <[email protected]>
* Remove -I option to common.NIIBE Yutaka2017-03-071-1/+1
| | | | | | | | | | | | | * dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* gpg: Remove PGP-2 related cruft.Werner Koch2014-11-131-1/+0
| | | | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* gpg: Remove all support for v3 keys and always create v4-signatures.Werner Koch2014-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/build-packet.c (do_key): Remove support for building v3 keys. * g10/parse-packet.c (read_protected_v3_mpi): Remove. (parse_key): Remove support for v3-keys. Add dedicated warnings for v3-key packets. * g10/keyid.c (hash_public_key): Remove v3-key support. (keyid_from_pk): Ditto. (fingerprint_from_pk): Ditto. * g10/options.h (opt): Remove fields force_v3_sigs and force_v4_certs. * g10/gpg.c (cmd_and_opt_values): Remove oForceV3Sigs, oNoForceV3Sigs, oForceV4Certs, oNoForceV4Certs. (opts): Turn --force-v3-sigs, --no-force-v3-sigs, --force-v4-certs, --no-force-v4-certs int dummy options. (main): Remove setting of the force_v3_sigs force_v4_certs flags. * g10/revoke.c (gen_revoke, create_revocation): Always create v4 certs. * g10/sign.c (hash_uid): Remove support for v3-signatures (hash_sigversion_to_magic): Ditto. (only_old_style): Remove this v3-key function. (write_signature_packets): Remove support for creating v3-signatures. (sign_file): Ditto. (sign_symencrypt_file): Ditto. (clearsign_file): Ditto. Remove code to emit no Hash armor line if only v3-keys are used. (make_keysig_packet): Remove arg SIGVERSION and force using v4-signatures. Change all callers to not pass a value for this arg. Remove all v3-key related code. (update_keysig_packet): Remove v3-signature support. * g10/keyedit.c (sign_uids): Always create v4-signatures. * g10/textfilter.c (copy_clearsig_text): Remove arg pgp2mode and change caller. -- v3 keys are deprecated for about 15 years and due the severe weaknesses of MD5 it does not make any sense to keep code around to use these old and broken keys. Users who need to decrypt old messages should use gpg 1.4 and best re-encrypt them to modern standards. verification of old (i.e. PGP2) created signatures is thus also not anymore possible but such signatures have no values anyway - MD5 is just too broken. We have also kept support for v3 signatures until now. With the removal of support for v3 keys it is questionable whether it makes any sense to keep support for v3-signatures. What we do now is to keep support for verification of v3-signatures but we force the use of v4-signatures. The latter makes the --pgp6 and --pgp7 switch a bit obsolete because those PGP versions require v3-signatures for messages. These versions of PGP are also really old and not anymore maintained so they have not received any bug fixes and should not be used anyway. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove cipher.h and put algo ids into a common file.Werner Koch2014-01-291-1/+1
| | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-1/+1
| | | | | | | | 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.
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Fixes for CVE-2006-6235Werner Koch2006-12-061-5/+9
|
* Continued with merging.Werner Koch2006-04-191-10/+10
| | | | | Still does not build.
* Merged with gpg 1.4.3 code. Werner Koch2006-04-191-19/+25
| | | | | The gpg part does not yet build.
* Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch2003-06-181-9/+10
| | | | | | | | | | | 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/+154
| | | | 'GNUPG-1-9-BRANCH'.
* This commit was manufactured by cvs2svn to create branchRepo Admin2002-10-191-142/+0
| | | | 'GNUPG-1-9-BRANCH'.
* * pkclist.c (do_we_trust_pre): Changed the wording of a warning.Werner Koch2002-08-301-0/+1
| | | | | | | | | | | | | | | | * encode.c (encode_simple,encode_crypt): Use new style CTB for compressssed packets when using MDC. We need to do this so that concatenated messages are properly decrypted. Old style compression assumes that it is the last packet; given that we can't determine the length in advance, the uncompressor does not know where to start. Actually we should use the new CTB always but this would break PGP 2 compatibility. * parse-packet.c (parse): Special treatment for new style CTB compressed packets. * build-packet.c (do_mdc): Removed. Was not used. (do_encrypted_mdc): Count the version number and the MDC packet.
* Update head to match stable 1.0David Shaw2002-06-291-23/+24
|
* See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch2000-07-141-5/+7
|
* See ChangeLog: Thu Jan 27 18:00:44 CET 2000 Werner KochWerner Koch2000-01-271-3/+3
|
* See ChangeLog: Wed Dec 8 21:58:32 CET 1999 Werner KochWerner Koch1999-12-081-0/+1
|
* See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner KochWerner Koch1999-10-261-1/+10
|
* See ChangeLog: Sat Sep 18 12:16:08 CEST 1999 Werner KochWerner Koch1999-09-181-7/+8
|
* See ChangeLog: Thu May 20 14:04:08 CEST 1999 Werner KochWerner Koch1999-05-201-1/+2
|
* See ChangeLog: Wed May 19 16:04:30 CEST 1999 Werner KochWerner Koch1999-05-191-0/+1
|
* See ChangeLog: Mon May 17 21:54:43 CEST 1999 Werner KochWerner Koch1999-05-171-0/+1
|
* See ChangeLog: Tue Mar 2 16:44:57 CET 1999 Werner KochWerner Koch1999-03-021-1/+2
|
* See ChangeLog: Fri Feb 19 15:49:15 CET 1999 Werner KochWerner Koch1999-02-191-1/+1
|
* See ChangeLog: Wed Jan 20 18:59:49 CET 1999 Werner KochWerner Koch1999-01-201-0/+6
|
* See ChangeLog: Tue Jan 19 19:34:58 CET 1999 Werner KochWerner Koch1999-01-191-0/+1
|
* See ChangeLog: Sun Jan 17 11:04:33 CET 1999 Werner KochWerner Koch1999-01-171-4/+5
|
* See ChangeLog: Wed Jan 13 14:10:15 CET 1999 Werner KochWerner Koch1999-01-131-0/+1
|
* See ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner KochWerner Koch1999-01-071-15/+24
|
* See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1998-12-231-3/+3
|
* Expiration time works (I hope so)Werner Koch1998-11-201-0/+1
|
* last local commitWerner Koch1998-10-161-0/+1
|
* *** empty log message ***Werner Koch1998-09-281-1/+1
|
* intermediate releaseWerner Koch1998-07-061-3/+0
|
* partly added creation of OP partial length headersWerner Koch1998-07-021-0/+3
|
* nearly ready for 0.3.0Werner Koch1998-06-251-0/+1
|
* new releaseV0-2-18Werner Koch1998-05-151-1/+1
|
* cipher reorganisiertWerner Koch1998-04-071-2/+1
|