aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpgcompose.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: Always use EXTERN_UNLESS_MAIN_MODULE pattern.Werner Koch2020-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * common/util.h (EXTERN_UNLESS_MAIN_MODULE): Add the definion only here but now without the Norcroft-C. Change all other places where it gets defined. * common/iobuf.h (iobuf_debug_mode): Declare unconditionally as extern. * common/iobuf.c (iobuf_debug_mode): Define it here. * agent/gpg-agent.c (INCLUDED_BY_MAIN_MODULE): Define here and also in all main modules of all other programs. * g10/main.h: Put util.h before the local header files. -- This change is required for use with gcc/ld's LTO feature which does not allow common blocks. Further gcc 10 will make -fno-common the default and thus this chnage is always needed. What a pitty. Co-authored-by: Tomáš Mráz GnuPG-bug-id: 4831 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 21d9bd8b87a9f793a106095e3838eb71825189d7) - Applied respective chnages also to gpg-card and keyboxd. Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --use-keyboxd.Werner Koch2019-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oUseKeyboxd,oKeyboxdProgram): New consts. (opts): New options --use-keyboxd and --keyboxd-program. (main): Implement them. * g10/keydb.c: Move some defs out to ... * g10/keydb-private.h: new file. * g10/keydb.c: prefix function names with "internal" and move original functions to ... * g10/call-keyboxd.c: new file. Divert to the internal fucntion if --use-keyboxd is used. Add a CTRL arg to most fucntions and change all callers. * g10/Makefile.am (common_source): Add new files. (noinst_PROGRAMS): Do bot build gpgcompose. -- Note that this is just the framework with only a basic implementation of searching via keyboxd. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make the get_pubkey_byname interface easier to understand.Werner Koch2019-07-041-2/+4
| | | | | | | | | | | * g10/keydb.h (enum get_pubkey_modes): New. * g10/getkey.c (get_pubkey_byname): Repalce no_akl by a mode arg and change all callers. -- This change prepares the implementation of GET_PUBKEY_NO_LOCAL. Signed-off-by: Werner Koch <[email protected]>
* gpg: Cleanup use of make_keysig_packet.Werner Koch2019-05-131-1/+8
| | | | | | | | | | * g10/sign.c (make_keysig_packet): Remove obsolete arg diegst_algo which was always passed as 0. Change all callers. * g10/gpgcompose.c (signature): Warn when trying to set a digest algo. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: During secret key import print "sec" instead of "pub".Werner Koch2019-03-151-2/+3
| | | | | | | | | | | * g10/keyedit.c (show_basic_key_info): New arg 'print_sec'. Remove useless code for "sub" and "ssb". * g10/import.c (import_one): Pass FROM_SK to show_basic_key_info. Do not print the first keyinfo in FROM_SK mode. printing. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Move S2K encoding function to a shared file.Werner Koch2019-01-261-3/+7
| | | | | | | | | | | | | | | | * g10/passphrase.c (encode_s2k_iterations): Move function to ... * common/openpgp-s2k.c: new file. Remove default intialization code. * common/openpgpdefs.h (S2K_DECODE_COUNT): New to keep only one copy. * g10/call-agent.c (agent_get_s2k_count): Change to return the count and print an error. * agent/protect.c: Include openpgpdefs.h * g10/card-util.c (gen_kdf_data): Adjust for changes * g10/gpgcompose.c: Include call-agent.h. (sk_esk): Adjust for changes. * g10/passphrase (passphrase_to_dek): Adjust for changes. * g10/main.h (S2K_DECODE_COUNT): Remove macro. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix format string in gpgcompose.cWerner Koch2018-11-111-1/+1
| | | | | | | | | -- For size_t use "%zu" For ssize_t use "%zd" Signed-off-by: Werner Koch <[email protected]>
* gpgcompose: Fix --sk-esk.NIIBE Yutaka2018-11-081-3/+14
| | | | | | | | | | * g10/gpgcompose.c (sk_esk): Copy the result content correctly. Don't forget to free the result. -- Fixes-commit: 0131d4369a81a51bf7bb328cc81a3bb082ed1a94 Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix memory leak for PKT_signature.NIIBE Yutaka2018-07-031-1/+1
| | | | | | | | | | | | * g10/getkey.c (buf_to_sig): Free by free_seckey_enc. * g10/gpgcompose.c (signature): Likewise. * g10/sign.c (write_signature_packets): Likewise. -- Reported-by: Philippe Antoine GnuPG-bug-id: 4047 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Implement AEAD for SKESK packets.Werner Koch2018-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/packet.h (PKT_symkey_enc): Add field aead_algo. * g10/build-packet.c (do_symkey_enc): Support version 5 packets. * g10/parse-packet.c (parse_symkeyenc): Ditto. * g10/encrypt.c (encrypt_symmetric): Force using a random session key in AEAD mode. (encrypt_seskey): Add and support arg aead_algo. (write_symkey_enc): Ditto. (encrypt_simple): Adjust accordingly. (encrypt_filter): Ditto. * g10/gpgcompose.c (sk_esk): For now call encrypt_seskey without AEAD support. * g10/mainproc.c (symkey_decrypt_seskey): Support AEAD. Nver call BUG but return an error. (proc_symkey_enc): Call symkey_decrypt_seskey in a bug compatible way. * g10/import.c (check_prefs): Check AEAD preferences. * g10/keyedit.c (show_prefs): Print AEAD preferences. -- For easier debugging this patch also changes some diagnostics to also print the encryption mode with the cipher algorithm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Refactor function encrypt_seskey.Werner Koch2018-01-221-3/+5
| | | | | | | | | * g10/encrypt.c (encrypt_seskey): Allocate the buffer for the encrypted key and returns that buffer and its length. (encrypt_simple): Adjust for above change. (write_symkey_enc): Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add stub function for encrypting AEAD.Werner Koch2018-01-101-1/+1
| | | | | | | | | | | | | * 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: Fix comparison.Neal H. Walfield2017-10-061-1/+1
| | | | | | | * g10/gpgcompose.c (literal_name): Complain if passed zero arguments, not one or fewer. Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Avoid output to the tty during import.Werner Koch2017-07-271-1/+3
| | | | | | | | | | | | | | | | * g10/key-check.c (key_check_all_keysigs): Add arg mode and change all output calls to use it. * g10/keyedit.c (keyedit_print_one_sig): Add arg fp and chnage all output calls to use it. (keyedit_menu): Adjust for changes. * g10/gpgcompose.c (keyedit_print_one_sig): Add dummy arg fp. * g10/import.c (import_one): Call key_check_all_keysigs with output to the log stream. -- Fixes-commit: 404fa8211b6188a0abe83ef43a4b44d528c0b035 GnuPG-bug-id: 3288 Signed-off-by: Werner Koch <[email protected]>
* gpg: Refactor key checking and fixing.Justus Winter2017-06-141-0/+18
| | | | | | | | | | | | | | * g10/Makefile.am (gpg_sources): Add new files. * g10/gpgcompose.c (keyedit_print_one_sig): New stub. * g10/keyedit.c (sig_comparison): Move to new module. (check_all_keysigs): Likewise. (fix_keyblock): Adapt callsite. (keyedit_menu): Likewise. * g10/key-check.c: New file. * g10/key-check.h: Likewise. GnuPG-bug-id: 2236 Signed-off-by: Justus Winter <[email protected]>
* gpg: Send gpgcompose --help output to stdout, not stderr.Neal H. Walfield2017-06-111-7/+7
| | | | | | | * g10/gpgcompose.c (show_help): Send gpgcompose --help output to stdout, not stderr. Reported-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Improve some output of gpgcompose.Neal H. Walfield2017-06-111-2/+5
|
* gpg: Support 'gpgcompose --encrypted-pop --help'Neal H. Walfield2017-06-111-3/+21
| | | | | | | * g10/gpgcompose.c (encrypted_pop_options): New variable. (encrypted_pop): Support the --help option. Reported-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Remove dead code.Neal H. Walfield2017-06-111-7/+1
| | | | | | * g10/gpgcompose.c (filter_pop): F->PKTTYPE will never be PKT_ENCRYPTED_MDC. (encrypted_pop): Likewise and there is no option --encrypted-mdc-pop.
* g10: Fix gpgcompose.c.NIIBE Yutaka2017-05-171-1/+1
| | | | | | | | | * g10/gpgcompose.c (show_help): Check return value. -- Fixes-commit: 00b7767bc6fe309aa20375c859ebf708cfc7b9ea Signed-off-by: NIIBE Yutaka <[email protected]>
* common: Let format_text return an error.Werner Koch2017-05-151-0/+2
| | | | | | | | | | | | | | | * common/stringhelp.c (format_text): Return NULL on error. * common/t-stringhelp.c (test_format_text): Adjust for change. * g10/gpgcompose.c (show_help): Abort on out of core. * g10/tofu.c (ask_about_binding): Abort on format_text error. (show_statistics): Ditto. (show_warning): Ditto. -- For better re-usability function in common/ shot better not use xmalloc functions. Signed-off-by: Werner Koch <[email protected]>
* common: Simplify format_text.NIIBE Yutaka2017-04-121-1/+1
| | | | | | | | | | | * common/stringhelp.c (format_text): Don't allow IN_PLACE formatting. * common/stringhelp.h: Change the API with no IN_PLACE. * common/t-stringhelp.c (test_format_text): Follow the change. * g10/gpgcompose.c (show_help): Likewise. * g10/tofu.c (format_conflict_msg_part1, ask_about_binding) (show_statistics, show_warning): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Pass CTRL to many more functions.Werner Koch2017-03-311-5/+12
| | | | | | | | | | -- For proper operations as a server we need to avoid global variables. Thus we need to pass the session state CTRL to most functions. Quite a lot of changes but fortunately straightforward to do. Signed-off-by: Werner Koch <[email protected]>
* Replace use of variable-length-arrays.Werner Koch2017-01-021-5/+12
| | | | | | | | | | | | | * common/t-iobuf.c (main): Replace variable-length-array. * g10/gpgcompose.c (mksubpkt_callback): Ditto. (encrypted): Ditto. * g10/t-stutter.c (log_hexdump): Ditto. (oracle_test): Ditto. * g10/tofu.c (get_policy): Ditto. Use "%zu" for size_t. * scd/app-openpgp.c (ecc_writekey): Replace variable-length-array. Check for zero length OID_LEN. Signed-off-by: Werner Koch <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* Fix symbol conflict.Ben Kibbey2016-09-101-20/+20
| | | | | | | | | * g10/gpgcompose.c: Rename struct siginfo to signinfo. -- Fixes android-ndk and OpenIndiana (Solaris) builds. Signed-off-by: Ben Kibbey <[email protected]>
* Fix spelling and grammar.Daniel Kahn Gillmor2016-08-031-1/+1
| | | | | | | | | | | | | | * agent/learncard.c: s/coccured/occurred/ * doc/dirmngr.texi: s/ommitted/omitted/, s/orginally/originally/, s/reponses/responses/i * doc/gpg-agent.texi, doc/dirmngr.texi, doc/gpg.texi: Fix "allows to" to more conventional english usage. * doc/tools.texi, g10/gpgcommpose.c, tests/openpgp/armor.scm, tests/openpgp/armor.test: s/occured/occurred/ * tools/gpgsplit.c: s/calcualting/calculating/ * sm/server.c: s/formated/formatted/ Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* doc: Consistently use 'keyserver'.Werner Koch2016-06-141-2/+2
| | | | | | | -- GnuPG-bug-id: 2383 Signed-off-by: Werner Koch <[email protected]>
* Replace use of opt.homedir by accessor functions.Werner Koch2016-06-071-4/+0
| | | | | | | | | | | | | | | | | | | * common/homedir.c (the_gnupg_homedir): New var. (gnupg_set_homedir): New. (gnupg_homedir): New. * g10/options.h (struct opt): Remove 'homedir' and replace all users by the new accessor functions. * g13/g13-common.h (struct opt): Ditto. * scd/scdaemon.h (struct opt): Ditto. * sm/gpgsm.h (struct opt): Ditto. * dirmngr/dirmngr.h (struct opt): Ditto. * agent/preset-passphrase.c (opt_homedir): Ditto. * agent/protect-tool.c (opt_homedir): Ditto. -- This will make detection of a non-default homedir easier. Signed-off-by: Werner Koch <[email protected]>
* build: Build gpgcompose only in maintainer modeWerner Koch2016-04-051-1/+1
| | | | | | | * g10/Makefile.am (noinst_PROGRAMS): Add gpgcompose only in maintainer mode. Signed-off-by: Werner Koch <[email protected]>
* gpg: Replace use of "gpg2" by GPG_NAMEWerner Koch2016-04-051-10/+10
| | | | Signed-off-by: Werner Koch <[email protected]>
* g10: Add const qualifier.NIIBE Yutaka2016-03-161-2/+2
| | | | | | | | * g10/gpgcompose.c (show_help): Those are strings not to be modified. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Add new program gpgcompose.Neal H. Walfield2016-03-021-0/+3038
* g10/packet.h: Include "util.h". * g10/encrypt.c (encrypt_seskey): Don't mark as static. * g10/gpgcompose.c: New file. * g10/Makefile.am (noinst_PROGRAMS): Add gpgcompose. (gpg2_SOURCES): Split everything but gpg.c into... (gpg_sources): ... this new variable. (gpgcompose_SOURCES): New variable. (gpgcompose_LDADD): Likewise. (gpgcompose_LDFLAGS): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>