aboutsummaryrefslogtreecommitdiffstats
path: root/g10/encode.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-09-28Rename encode.c to encrypt.c.Werner Koch1-912/+0
Rename function in a simlar way. Re-indent encrypt.c
2009-06-05Add full Camellia support.David Shaw1-5/+5
* 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.
2009-05-18New gpgsm server option no-encrypt-to.Werner Koch1-2/+2
Add caching for symkey encryption. Minor cleanups.
2009-05-11Print 'empty file' warning only with --verbose.Werner Koch1-2/+2
2007-12-12Support DSA2.Werner Koch1-4/+4
Support Camellia for testing. More audit stuff.
2007-11-19Started to implement the audit log feature.Werner Koch1-1/+1
Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
2007-10-25Ported changes from 1.4.Werner Koch1-16/+2
Add copyright notices.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-12-06Fixes for CVE-2006-6235Werner Koch1-17/+40
2006-11-05Collected fixes.Werner Koch1-1/+20
2006-10-02Fix for bug 537Werner Koch1-2/+2
2006-09-14Take advantage of newer gpg-error features.Werner Koch1-2/+2
2006-07-31Fixed bug 479. Not a real good fix but a reliable one which limits possibleWerner Koch1-0/+2
breakage of other partys of the code.
2006-04-28Merged recent changes from 1.4Werner Koch1-18/+4
2006-04-20* gpg.c (print_mds), armor.c (armor_filter, parse_hash_header): AddDavid Shaw1-18/+4
SHA-224. * sign.c (write_plaintext_packet), encode.c (encode_simple): Factor common literal packet setup code from here, to... * main.h, plaintext.c (setup_plaintext_name): Here. New. Make sure the literal packet filename field is UTF-8 encoded. * options.h, gpg.c (main): Make sure --set-filename is UTF-8 encoded and note when filenames are already UTF-8.
2006-04-19Continued with merging.Werner Koch1-12/+11
Still does not build.
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-192/+272
The gpg part does not yet build.
2005-10-05Renamed g10.c to gpg.cWerner Koch1-3/+7
Filelength fixes for W32.
2005-07-27Converted all m_free to xfree etc.Werner Koch1-31/+31
2005-07-22* gpg.sgml (http):Werner Koch1-1/+4
* g10.c, options.h: New option --exit-on-status-write-error. * status.c (write_status_text): Make use of this option.
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2005-05-05* keygen.c (start_tree): New function to "prime" a KBNODE list.David Shaw1-18/+4
(do_generate_keypair): Use it here rather than creating and deleting a comment packet. * keygen.c (gen_elg, gen_dsa): Do not put public factors in secret key as a comment. * options.h, encode.c (encode_simple, encode_crypt), keygen.c (do_create): Remove disabled comment packet code.
2004-11-04* plaintext.c (handle_plaintext): Don't try and create a zero-lengthDavid Shaw1-8/+8
filename when using --use-embedded-filename with input that has no filename (clearsigned or message generated from a pipe). * encode.c (encode_simple, encode_crypt), progress.c (handle_progress), sign.c (write_plaintext_packet): Fix a few inconsistent calls (NULL filename means a pipe here, so don't bother to check it twice).
2004-10-13Added SELInux hacks and did some cleanups.Werner Koch1-9/+23
2004-10-13* configure.ac: Actually name the option --disable-finger and notWerner Koch1-3/+3
http. * openfile.c (overwrite_filep, make_outfile_name, open_outfile) (open_sigfile): Use iobuf_is_pipe_filename to check for pipes so that special filesnames are taken into account. This is bug 327. * tdbdump.c (import_ownertrust): Ditto. * sign.c (write_plaintext_packet): Ditto. * progress.c (handle_progress): Ditto. * plaintext.c (handle_plaintext): Ditto. * encode.c (encode_simple, encode_crypt): Ditto. * iobuf.c (iobuf_is_pipe_filename): New. * fileutil.c (is_file_compressed): Use it here.
2004-09-24* main.h: Create S2K_DIGEST_ALGO macro so we do not need to always setDavid Shaw1-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.
2004-08-27* encode.c, exec.c, g10.c, sign.c: Some translatable string cleanup.David Shaw1-4/+4
Change some "this" to `this'.
2004-08-23* keydb.h, getkey.c (get_user_id_printable): Rename to get_user_id_nativeDavid Shaw1-1/+1
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.
2004-02-26* delkey.c (do_delete_key): Allow deleting a public key with a secretDavid Shaw1-1/+1
present if --expert is set. * plaintext.c (handle_plaintext): Make bytecount static so it works with multiple literal packets inside a message. * encode.c, helptext.c (keygen.algo, keygen.algo.elg_se), keygen.c (ask_algo), sig-check.c (do_check_messages), skclist.c (build_sk_list): Rename "ElGamal" to "Elgamal" as that is the proper spelling nowadays. Suggested by Jon Callas.
2004-02-24* plaintext.c: Copyright.David Shaw1-2/+6
* encode.c (encode_simple): Show cipher with --verbose. * options.h, g10.c (main), keyedit.c (sign_keys): Add --ask-cert-level option to enable cert level prompts during sigs. Defaults to on. Simplify --default-cert-check-level to --default-cert-level. If ask-cert-level is off, or batch is on, use the default-cert-level as the cert level. * options.h, g10.c (main), trustdb.c (mark_usable_uid_certs): Simplify --min-cert-check-level to --min-cert-level.
2003-11-15* options.h, g10.c (main), compress.c (init_compress), compress-bz2.cDavid Shaw1-6/+5
(init_compress): Add --compress-level and --bzip2-compress-level. -z sets them both. Change various callers.
2003-11-15* encode.c (encode_simple), sign.c (sign_symencrypt_file): Properly useDavid Shaw1-2/+2
default_compress_algo (--compress-algo, followed by the highest --personal-compress-preference, followed by ZIP) to get the algorithm.
2003-11-13* g10.c (main): Add --symmetric --sign --encrypt.David Shaw1-44/+66
* 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-10-31* misc.c (compress_algo_to_string, string_to_compress_algo,David Shaw1-4/+2
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-26* g10.c (main): Add --symmetric --encrypt command. This generates aDavid Shaw1-25/+74
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-01* g10.c (main): Add --no-groups to zero --group list.David Shaw1-22/+16
* encode.c (encode_simple): Allow for 32 bytes (256 bits) of symmetrically encrypted session key. Use --s2k-cipher-algo to choose cipher, rather than the default cipher. * parse-packet.c (parse_subkeyenc): Give a warning if an symmetrically encrypted session key is seen without salt. Show in --list-packets if a symetrically encrypted session key is present. * pubkey-enc.c (get_it): Always show cipher-not-in-prefs warning unless --quiet is set. Use text name of cipher in warning.
2003-09-23Merged most of David Shaw's changes in 1.3 since 2003-06-03.Werner Koch1-0/+4
2003-09-09* g10.c (main): Error out if --multifile is used with the commands thatDavid Shaw1-0/+4
don't support it yet (--sign, --clearsign, --detach-sign, --symmetric, and --store). * g10.c (main): Add --multifile as an alias to turn --encrypt into --encrypt-files (plus --verify-files, --decrypt-files). * encode.c (use_mdc), g10.c (main): Use RFC1991 and RFC2440 directly to check for MDC usability. Do not set the force_mdc or disable_mdc flags since there is no point any longer.
2003-08-18 * mdc.c (use_mdc): Simplified.Timo Schulz1-22/+19
2003-08-182003-08-18 Timo Schulz <[email protected]>Timo Schulz1-24/+27
* encode.c (encode_sesskey): Checked the code and removed the warning since all compatibility checks with PGP succeeded. * mainproc.c (symkey_decrypt_sesskey): Better check for the algorithm and check the return values of some functions.
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-66/+72
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.
2003-06-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+811
'GNUPG-1-9-BRANCH'.
2003-05-24* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,David Shaw1-4/+4
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.
2003-05-21* progress.c (handle_progress)Werner Koch1-3/+6
* sign.c (write_plaintext_packet) * encode.c (encode_simple,encode_crypt): Make sure that a filename of "-" is considered to be stdin so that iobuf_get_filelength won't get called. This fixes bug 156 reported by Gregery Barton.
2003-05-03* packet.h, build-packet.c (build_sig_subpkt), export.cDavid Shaw1-21/+14
(do_export_stream), import.c (remove_bad_stuff, import), parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt): Remove vestigal code for the old sig cache subpacket. This wasn't completely harmless as it caused subpacket 101 to disappear on import and export. * options.h, armor.c, cipher.c, g10.c, keyedit.c, pkclist.c, sign.c, encode.c, getkey.c, revoke.c: The current flags for different levels of PGP-ness are massively complex. This is step one in simplifying them. No functional change yet, just use a macro to check for compliance level. * sign.c (sign_file): Fix bug that causes spurious compression preference warning. * sign.c (clearsign_file): Fix bug that prevents proper warning message from appearing when clearsigning in --pgp2 mode with a non-v3 RSA key. * main.h, misc.c (compliance_option_string, compliance_string, compliance_failure), pkclist.c (build_pk_list), sign.c (sign_file, clearsign_file), encode.c (encode_crypt, write_pubkey_enc_from_list): New functions to put the "this message may not be usable...." warning in one place. * options.h, g10.c (main): Part two of the simplification. Use a single enum to indicate what we are compliant to (1991, 2440, PGPx, etc.) * g10.c (main): Show errors for failure in export, send-keys, recv-keys, and refresh-keys. * options.h, g10.c (main): Give algorithm warnings for algorithms chosen against the --pgpX and --openpgp rules. * keydb.h, pkclist.c (algo_available): Make TIGER192 invalid in --openpgp mode. * sign.c (sign_file), pkclist.c (algo_available): Allow passing a hint of 0.
2003-04-15* Makefile.am (AM_CFLAGS): Make use of AM_CFLAGS and AM_LDFLAGS.Werner Koch1-0/+6
* g10.c, options.h: New option --enable-progress-filter. * progress.c (handle_progress): Make use of it.
2003-04-10* passphrase.c (read_passphrase_from_fd): Do a dummy read if theWerner Koch1-1/+2
agent is to be used. Noted by Ingo Kl�cker. (agent_get_passphrase): Inhibit caching when we have no fingerprint. This is required for key generation as well as for symmetric only encryption. * passphrase .c (agent_get_passphrase): New arg CANCELED. (passphrase_to_dek): Ditto. Passed to above. Changed all callers to pass NULL. * seckey-cert.c (do_check): New arg CANCELED. (check_secret_key): Terminate loop when canceled. * keyedit.c (change_passphrase): Pass ERRTEXT untranslated to passphrase_to_dek and translate where appropriate. * seckey-cert.c (check_secret_key): Ditto. * keygen.c (ask_passphrase): Ditto. * passphrase.c (agent_get_passphrase): Translate the TRYAGAIN_TEXT. Switch the codeset to utf-8.
2002-12-03* options.h, g10.c (main), encode.c (write_pubkey_enc_from_list),David Shaw1-4/+4
pkclist.c (algo_available), revoke.c (gen_revoke): Add --pgp8 mode. This is basically identical to --pgp7 in all ways except that signing subkeys, v4 data sigs (including expiration), and SK comments are allowed. * getkey.c (finish_lookup): Comment. * main.h, keylist.c (reorder_keyblock), keyedit.c (keyedit_menu): Reorder user ID display in the --edit-key menu to match that of the --list-keys display. * g10.c (add_notation_data): Fix initialization.
2002-11-25* main.h, misc.c (default_cipher_algo, default_compress_algo): New.David Shaw1-8/+5
Return the default algorithm by trying --cipher-algo/--compress-algo, then the first item in the pref list, then s2k-cipher-algo or ZIP. * sign.c (sign_file, sign_symencrypt_file), encode.c (encode_simple, encode_crypt): Call default_cipher_algo and default_compress_algo to get algorithms. * g10.c (main): Allow pref selection for compress algo with --openpgp.
2002-11-24* encode.c (encode_simple), passphrase.c (passphrase_to_dek), sign.cDavid Shaw1-2/+1
(sign_symencrypt_file): Use --s2k-digest-algo for passphrase mangling rather than --digest-algo.