aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* w32: Use --enable-gpg2-is-gpg by default.Werner Koch2016-04-211-1/+1
| | | | | | * autogen.rc: Add option also for plain Windows. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve UID selction of --quick-sign-key.Werner Koch2016-04-191-10/+54
| | | | | | | | * g10/keyedit.c (keyedit_quick_sign): Improve UID selection and print error for non-found userids. -- GnuPG-bug-id: 2315
* gpg: Avoid debug like output at start of --edit-key.Werner Koch2016-04-191-6/+12
| | | | | | | | * g10/keyedit.c (check_all_keysigs): Print info only after something has been modified. -- Signed-off-by: Werner Koch <[email protected]>
* g10: Fix exporting secret keys of certain sizes.Justus Winter2016-04-071-1/+1
| | | | | | | | | | | | | * g10/build-packet.c (do_key): Do not use the header length specified by the public key packet from the keyring, but let 'write_header2' compute the required length. -- Specifically exporting RSA keys of length 1024 failed, as the encoded public key packet requires 141 bytes a length that fits into one byte, but the secret key is significantly larger, making the export fail. GnuPG-bug-id: 2307 Signed-off-by: Justus Winter <[email protected]>
* g10: Fix typo.Justus Winter2016-04-071-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Revert "g10: Support armored keyrings in gpgv."Justus Winter2016-04-065-134/+10
| | | | This reverts commit abb352de51bc964c06007fce43ed6f6caea87c15.
* build: Fix for: Build gpgcompose only in maintainer modeWerner Koch2016-04-051-1/+2
| | | | | | | * g10/Makefile.am (noinst_PROGRAMS): Always add module_tests. -- Fixes-commit: 4b5341d
* build: Build gpgcompose only in maintainer modeWerner Koch2016-04-052-1/+3
| | | | | | | * 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-053-15/+16
| | | | Signed-off-by: Werner Koch <[email protected]>
* Now build "gpg" binary but install as "gpg2"Werner Koch2016-04-042-18/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (USE_GPG2_HACK): New ac_define am_conditional. * common/homedir.c (gnupg_module_name): Replace use of macro NAME_OF_INSTALLED_GPG. * g10/keygen.c (generate_keypair): Ditto. * g10/Makefile.am (bin_PROGRAMS): Remove. (noinst_PROGRAMS): Add gpg or gpg2 and gpgv or gpg2. (gpg2_hack_list): New. (use_gpg2_hack): New. (gpg2_SOURCES): Rename to gpg_SOURCES. (gpgv2_SOURCES): Rename to gpgv_SOURCES. (gpg2_LDADD): Rename to gpg_LDADD. (gpgv2_LDADD): Rename to gpgv_LDADD. (gpg2_LDFLAGS): Rename to gpg_LDFLAGS. (gpgv2_LDFLAGS): Rename to gpgv2_LDFLAGS. (install-exec-hook): Remove WinCE specific rules and add new rules. (uninstall-local): Uninstall gpg/gpg2 and gpgv/gpgv2. * tests/openpgp/Makefile.am (required_pgms): s/gpg2/gpg/. * tests/openpgp/defs.inc: Ditto. * tests/openpgp/gpgtar.test: Ditto. * tests/openpgp/mkdemodirs: Ditto. * tests/openpgp/signdemokey: Ditto. * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Remove obsolete --enable-mailto, add --enable-gpg2-is-gpg. -- Although we need to duplicate some automake generated code this method allows to easily switch the name of the installed target using the configure option "--enable-gpg2-is-gpg". Signed-off-by: Werner Koch <[email protected]>
* g10: Support armored keyrings in gpgv.Justus Winter2016-04-045-10/+134
| | | | | | | | | | | | | * doc/gpgv.texi: Document the feature. * g10/Makefile.am (gpgv2_SOURCES): Add dearmor.c. * g10/dearmor.c (dearmor_file): Add sink argument. * g10/gpg.c (main): Adapt accordingly. * g10/gpgv.c (make_temp_dir): New function. (main): De-armor keyrings. * g10/main.h (dearmor_file): Adapt prototype. GnuPG-bug-id: 2290 Signed-off-by: Justus Winter <[email protected]>
* g10: Remove option --always-trust if compiled without trust models.Justus Winter2016-04-011-0/+2
| | | | | | | * g10/gpg.c (opts): Remove option --always-trust if compiled without trust models. Signed-off-by: Justus Winter <[email protected]>
* g10: Use gpg-error abstraction of sched_yield.Justus Winter2016-03-311-2/+1
| | | | | | * g10/tofu.c (begin_transaction): Use 'gpgrt_yield'. Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix NULL-segv for missing tofu DB.Werner Koch2016-03-291-1/+2
| | | | | | | | | | | * g10/tofu.c (opendb): Guard call to timeout function. -- GnuPG-bug-id: 2294 Fix not tested but is pretty obvious. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve message when asking for key capabilities.Werner Koch2016-03-221-5/+7
| | | | | | | | | | | | * g10/keygen.c (ask_key_flags): Improve message. -- Because the curve is only selected after the capabilities are queried we do not know whether ECDSA or EdDSA will eventually be used. When printing the possible capabilities we now use print "ECDSA/EdDSA" for the algorithm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove the extra prompt for Curve25519.Werner Koch2016-03-221-34/+30
| | | | | | | | | | | | | | * g10/keygen.c (MY_USE_ECDSADH): New macro local to ask_curve. (ask_curve): Use a fixed table of curve names and reserve a slot for Curve448. Simplify CurveNNNN/EdNNNN switching. (ask_curve): Remove the Curve25519 is non-standard prompt. -- Given that ECC generation is only available in export mode and that gpg will in any case support our current ed2559/cv25519 definition the extra prompt does not make anymore sense. Signed-off-by: Werner Koch <[email protected]>
* gpg: Silence trustdb computation with --quiet.Werner Koch2016-03-191-8/+11
| | | | | | | * g10/trustdb.c (validate_keys): Do not print log_info stuff in quiet mode. 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: Do not rely on a certain evaluation order.Werner Koch2016-03-151-1/+5
| | | | | | | | | * g10/keyedit.c (print_and_check_one_sig): Call check_key_signature before derefing IS_SELFSIG. -- Fixes-commit: 5fbd80579aea0f75ca1d2700515c5b8747a75c7d Signed-off-by: Werner Koch <[email protected]>
* scd: Add manufacturer id 0x000aWerner Koch2016-03-141-0/+1
| | | | | | * g10/card-util.c (get_manufacturer): Add it. Signed-off-by: Werner Koch <[email protected]>
* g10: Silence message if --quiet is given.Kevin J. McCarthy2016-03-101-1/+1
| | | | | | | * g10/getkey.c (parse_def_secret_key): Silence message if --quiet is given. Signed-off-by: Justus Winter <[email protected]>
* gpg: Add a new test.Neal H. Walfield2016-03-083-2/+616
| | | | | | | | | | | | | * g10/Makefile.am (EXTRA_DIST): Add t-stutter-data.asc. (module_tests): Add t-stutter. (t_stutter_SOURCES): New variable. (t_stutter_LDADD): New variable. -- Signed-off-by: Neal H. Walfield <[email protected]> Add a test to check that the Mister and Zuccerato attack described in "An Attack on CFB Mode Encryption As Used by OpenPGP" works.
* g10: Drop superfluous declaration.Justus Winter2016-03-041-1/+0
| | | | | | * g10/main.h (disable_core_dumps): Drop declaration. Signed-off-by: Justus Winter <[email protected]>
* g10: Guard code against errors.Justus Winter2016-03-041-7/+8
| | | | | | | | * g10/keygen.c (do_generate_keypair): Check for errors, in which case 'pri_psk' is NULL. Fixes-commit: bf9d1248 Signed-off-by: Justus Winter <[email protected]>
* gpg: Add new program gpgcompose.Neal H. Walfield2016-03-025-5/+3061
| | | | | | | | | | | | | | | * 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]>
* gpg: More robustly detect valid non-armored OpenPGP messages.Neal H. Walfield2016-03-021-13/+54
| | | | | | | | * g10/armor.c (is_armored): More robustly detect valid non-armored OpenPGP messages. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Split write_pubkey_enc_from_list.Neal H. Walfield2016-03-022-61/+73
| | | | | | | | | * g10/encrypt.c (write_pubkey_enc_from_list): Split the body of this function out into... (write_pubkey_enc): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Allow the caller to write the contents of a plaintext packet.Neal H. Walfield2016-03-021-8/+16
| | | | | | | | | * g10/build-packet.c (do_plaintext): Change the semantics such that if PT->BUF is NULL, it is the caller's responsibility to write the content (and disable partial body length mode, if appropriate). -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Add a new function for creating binary notations.Neal H. Walfield2016-03-022-2/+79
| | | | | | | * g10/build-packet.c (blob_to_notation): New function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Refactor the printing of binary notations.Neal H. Walfield2016-03-021-4/+28
| | | | | | | | | | | * g10/build-packet.c (sig_to_notation): Break printing of binary notations into... (notation_value_to_human_readable_string): ... this new function. Provide a small preview of the binary data substituting non-printable characters with '?'. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Consolidate Assuan server argument handling.Justus Winter2016-03-021-34/+1
| | | | | | | | | | | | | | | * common/Makefile.am (common_sources): Add new files. * common/server-help.c: New file. * common/server-help.h: Likewise. * agent/command.c: Drop argument handling primitives in favor of using the consolidated ones. * dirmngr/server.c: Likewise. * g10/server.c: Likewise. * g13/server.c: Likewise. * scd/command.c: Likewise. * sm/server.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* gpg: More carefully encode a packet's length.Neal H. Walfield2016-02-251-1/+8
| | | | | | | | | * g10/build-packet.c (write_header2): Make sure the length bits are cleared. Fail if HDRLEN is set and the specified length can't be encoded in the available space. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Avoid directly twiddling bits.Neal H. Walfield2016-02-251-3/+4
| | | | | | | | | * g10/build-packet.c (do_plaintext): Use ctb_new_format_p to check the packet's format. (write_header2): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Improve documentation and comments related to OpenPGP packets.Neal H. Walfield2016-02-253-66/+362
| | | | | -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Add some asserts.Neal H. Walfield2016-02-251-4/+62
| | | | | | | | | | | | | | | | | | | * g10/build-packet.c (ctb_new_format_p): New function. (ctb_pkttype): New function. (do_user_id): Add some asserts. (do_key): Likewise. (do_symkey_enc): Likewise. (do_pubkey_enc): Likewise. (do_plaintext): Likewise. (do_encrypted): Likewise. (do_encrypted_mdc): Likewise. (do_compressed): Likewise. (do_signature): Likewise. (do_signature): Likewise. (write_header2): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Avoid an unnecessary copy.Neal H. Walfield2016-02-251-14/+9
| | | | | | | | * g10/build-packet.c (sig_to_notation): Avoid an unnecessary copy of the data: the size of the packet is fixed. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Use higher-level functions.Neal H. Walfield2016-02-231-16/+6
| | | | | | | | | | * g10/build-packet.c (do_symkey_enc): Use iobuf_write instead of iobuf_put in a loop. Use iobuf_copy instead of iobuf_read and iobuf_write in a loop. Move the memory wiping from here... * common/iobuf.c (iobuf_copy): ... to here. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: More accurately name function.Neal H. Walfield2016-02-232-3/+3
| | | | | | | | * common/iobuf.c (iobuf_set_partial_block_mode): Rename from this... (iobuf_set_partial_body_length_mode): ... to this. Update callers. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Systematically detect and fix signatures that are out of order.Neal H. Walfield2016-02-191-125/+564
| | | | | | | | | | | | | | * g10/keyedit.c (sig_comparison): New function. (fix_key_signature_order): Merge functionality into... (check_all_keysigs): ... this function. Rewrite to eliminate duplicates and use a systematic approach to detecting and moving signatures that are out of order instead of a heuristic. (fix_keyblock): Don't call fix_key_signature_order. Call check_all_keysigs instead after collapsing the uids. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2236
* gpg: Split check_key_signature2.Neal H. Walfield2016-02-192-92/+286
| | | | | | | | | | | | * 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 <[email protected]>
* gpg: Split print_and_check_one_sig.Neal H. Walfield2016-02-191-11/+20
| | | | | | | | | * g10/keyedit.c (print_and_check_one_sig): Split the print functionality into... (print_one_sig): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* 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 <[email protected]>
* gpg: Use format_keyid rather than manually formatting the keyid.Neal H. Walfield2016-02-192-5/+4
| | | | | | | | | * g10/keyedit.c (menu_addrevoker): Use format_keyid rather than manually formatting the keyid. * g10/keygen.c (card_write_key_to_backup_file): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Initialize the primary key when generating a key.Neal H. Walfield2016-02-191-0/+7
| | | | | | | | * g10/keygen.c (do_generate_keypair): Initialize pri_psk->flags.primary, pri_psk->keyid and pri_psk->main_keyid. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.Neal H. Walfield2016-02-193-3/+94
| | | | | | | | | | | | | | | | | * g10/keydb.h (keyid_cmp): New function. * g10/keyid.c (pk_keyid): New function. (pk_main_keyid): New function. (keyid_copy): New function. (pk_keyid_str): New function. * g10/packet.h (PKT_public_key): Update comments for main_keyid and keyid. -- Signed-off-by: Neal H. Walfield <[email protected]> Before accessing pk->keyid, it is necessary to call keyid_from_pk (pk, NULL) to ensure that pk->keyid is valid. Because it is easy to forget to do this, these accessor functions take care of it.
* gpg: Clean up dangling agent_open and agent_closed declarations.Daniel Kahn Gillmor2016-02-182-4/+1
| | | | | | | | | | | | | | * g10/keydb.h: Remove agent_open, agent_close declarations/ * g10/migrate.c: #include <unistd.h> for access() -- agent_open() is only defined statically in common/simple-pw-query.c, it is neither used nor referenced anywhere else. agent_close doesn't exist anywhere. The removal of these declarations removes an unecessary inclusion of libassuan.h. migrate.c was relying on keydb.h -> libassuan.h -> unistd.h for the declaration of access(), so we now handle that explicitly instead.
* gpg: Make ASCII armor decoding more robust to encoding errors.Neal H. Walfield2016-02-161-0/+18
| | | | | | | | | | * g10/armor.c (radix64_read): If the = is followed by the string "3D", check if the following four characters are valid radix 64 and are followed by a new line. If so, warn and ignore the '3D'. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2250
* common, g10: Fix indentation to silence GCC-6.NIIBE Yutaka2016-02-152-12/+12
| | | | | | | | | | * common/iobuf.c (iobuf_ioctl): Fix. * g10/encrypt.c (encrypt_filter): Likewise. * g10/keyring.c (prepare_search): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>