aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ecc-sos,gpg: More fixes for SOS.gniibe/sosNIIBE Yutaka2020-06-044-5/+44
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix previous commit.NIIBE Yutaka2020-06-041-1/+1
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos,gpg: Use sexp_extract_param_sos to get MPI.NIIBE Yutaka2020-06-043-14/+8
| | | | | | | * g10/export.c (sexp_extract_param_sos): Expose. * g10/keygen.c (ecckey_from_sexp): Use it. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Apply SOS also to ECDSA.NIIBE Yutaka2020-06-043-5/+12
| | | | | | | | This causes a regression in: FAIL: tests/openpgp/ecc.scm Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix handling cleartext secret key from agent.NIIBE Yutaka2020-06-041-7/+52
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: SOS as Strange Octet String.NIIBE Yutaka2020-05-271-14/+9
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Backport master change for ECDH.NIIBE Yutaka2020-05-253-298/+368
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Avoid using gcry_mpi_print and gcry_mpi_scan.NIIBE Yutaka2020-05-205-49/+79
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix ECDH.NIIBE Yutaka2020-05-201-8/+2
| | | | | | * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Fix deallocation. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix exporting secret key for SOS.NIIBE Yutaka2020-05-191-7/+7
| | | | | | * g10/export.c (transfer_format_to_openpgp): Use SOS. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Use opaque for key from agent.NIIBE Yutaka2020-05-141-1/+1
| | | | | | * g10/export.c (cleartext_secret_key_to_openpgp): Use /q. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Compatible mode for SOS.NIIBE Yutaka2020-05-141-6/+27
| | | | | | | | * g10/build-packet.c (sos_write): Add an argument COMPAT. When COMPAT=1, NBITS specifies number of bits when interpreted as MPI, except the case when the first octet is zero. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: No need to expose sos_write.NIIBE Yutaka2020-05-142-12/+8
| | | | | | | * g10/build-packet.c (sos_write): Rename from gpg_sos_write. * g10/packet.h (gpg_sos_write): Remove. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Clean up use of mpi_get_opaque.NIIBE Yutaka2020-05-121-2/+2
| | | | | | * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Tidy up. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Remove zero-octet removal on write.NIIBE Yutaka2020-05-082-18/+0
| | | | | | | * g10/build-packet.c (gpg_mpi_write): Don't remove zero bits. * g10/packet.h (CALC_NBITS): Remove. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix gpg_mpi_write for opaque bit string.NIIBE Yutaka2020-05-041-0/+1
| | | | | | | * g10/build-packet.c (gpg_mpi_write): Handle opaque bit string when it's has exact number of bits. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix reading SEXP from agent.NIIBE Yutaka2020-05-041-1/+1
| | | | | | * g10/keygen.c (ecckey_from_sexp): Use GCRYMPI_FMT_OPAQUE. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix parsing key for EdDSA/ECDH.NIIBE Yutaka2020-05-041-1/+5
| | | | | | * g10/parse-packet.c (parse_key): Read by sos_read. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: public key is MPI with the prefix 0x40.NIIBE Yutaka2020-05-044-10/+4
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* sos: don't change NBITS.NIIBE Yutaka2020-05-041-2/+0
| | | | | | | | | | | For SOS, an ECC point with prefix 0x40 can be represented in two ways. One for 0x40 interpreted as 7-bit, another as 8-bit (MSB is zero). This matters for fingerprint computation, so, the representation should be preserved, or we should use another flag to hold the difference in the representation... Signed-off-by: NIIBE Yutaka <[email protected]>
* sos: Fix fingerprint computation.NIIBE Yutaka2020-05-044-9/+14
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix exporting key for ECC.NIIBE Yutaka2020-05-041-2/+2
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Fix for the condition calling gpg_sos_write.NIIBE Yutaka2020-05-041-4/+20
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Use opaque MPI for shared point.NIIBE Yutaka2020-05-041-7/+1
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Implement the fix-up of zero for SOS.NIIBE Yutaka2020-05-041-0/+23
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Use opaque MPI for ECDH.NIIBE Yutaka2020-05-042-24/+4
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Use GCRYMPI_FLAG_USER2 for SOS, and hash_public_key with that.NIIBE Yutaka2020-05-042-3/+13
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* Add sos_read.NIIBE Yutaka2020-05-042-10/+98
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Use opaque byte MPI interface for ECC key.NIIBE Yutaka2020-05-041-1/+1
| | | | | | * g10/keygen.c (ecckey_from_sexp): Parse by GCRYMPI_FMT_OPAQUE. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Introduce SOS (Simply Octet String) support.NIIBE Yutaka2020-05-042-6/+59
| | | | | | | | * g10/build-packet.c (gpg_sos_write): New. (do_key): Use gpg_sos_write. (do_signature): Use gpg_sos_write for EdDSA. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Make AEAD modes subject to compliance checks.Werner Koch2020-04-161-10/+13
| | | | | | | | | * g10/decrypt-data.c (decrypt_data): Move aead algo detection up. -- Note that the AEAD modes are not yet approved for --compliance=de-vs Signed-off-by: Werner Koch <[email protected]>
* indent: Some typo and indentation changes for gpg.Werner Koch2020-04-154-14/+16
| | | | --
* gpg: Fix broken setting of AEAD algo.Werner Koch2020-04-151-7/+1
| | | | | | | | | * g10/main.h (DEFAULT_AEAD_ALGO): Set to OCB. -- With the old code and using libgcrypt 1.9 would have switched from the high performance OCB to the ugly EAX mode. We are free software, we are OCB.
* gpg: ECDH: Accept longer padding.NIIBE Yutaka2020-04-081-4/+1
| | | | | | | | | | | | | | * g10/pubkey-enc.c (get_it): Remove check which mandates shorter padding. -- According to the section 8 of RFC 6637, the sender MAY use 21 bytes of padding for AES-128 to provide 40-byte "m". Reported-by: Metin Savignano GnuPG-bug-id: 4908 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg,card: Use the new MANUFACTURER attribute.Werner Koch2020-04-033-43/+20
| | | | | | | | | | | | | | | | | | | * tools/gpg-card.h (struct card_info_s): Add manufacturer fields. * tools/card-call-scd.c (release_card_info): Release them. (learn_status_cb): Parse MANUFACTURER attribute. * tools/gpg-card.c (get_manufacturer): Remove. (list_card): Use the new attribute. * g10/call-agent.h (struct agent_card_info_s): Add manufacturer fields. * g10/call-agent.c (agent_release_card_info): Release them. (learn_status_cb): Parse MANUFACTURER attribute. * g10/card-util.c (get_manufacturer): Remove. (current_card_status): Use new attribute. -- This does away with the duplicated OpenPGP vendor tables; they are now at a better place (app-openpgp.c). Signed-off-by: Werner Koch <[email protected]>
* gpg: Add regular expression support.NIIBE Yutaka2020-04-032-21/+3
| | | | | | | | | | | | | | | | | * AUTHORS, COPYING.other: Update. * Makefile.am (SUBDIRS): Add regexp sub directory. * configure.ac (DISABLE_REGEX): Remove. * g10/Makefile.am (needed_libs): Add libregexp.a. * g10/trustdb.c: Remove DISABLE_REGEX support. * regexp/LICENSE, regexp/jimregexp.c, regexp/jimregexp.h, regexp/utf8.c, regexp/utf8.h: New from Jim Tcl. * regexp/UnicodeData.txt: New from Unicode. * regexp/Makefile.am, regexp/parse-unidata.awk: New. * tests/openpgp/Makefile.am: Remove DISABLE_REGEX support. * tools/Makefile.am: Remove DISABLE_REGEX support. GnuPG-bug-id: 4843 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Also allow a v5 fingerprint for --trusted-key.Werner Koch2020-03-181-0/+7
| | | | | | | | | * g10/trustdb.c (tdb_register_trusted_key): Add case for 32 octet fingerprints. -- GnuPG-bug-id: 4855 Signed-off-by: Werner Koch <[email protected]>
* gpg: Update --trusted-key to accept fingerprint as well as long key id.Daniel Kahn Gillmor2020-03-181-6/+18
| | | | | | | | | | | | | | | * g10/trustdb.c (tdb_register_trusted_key): accept fingerprint as well as long key ID. * doc/gpg.texi: document that --trusted-key can accept a fingerprint. -- GnuPG-bug-id: 4855 Signed-off-by: Daniel Kahn Gillmor <[email protected]> Fixed uses or return and kept the old string to avoid breaking translations. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix key expiration and usage for keys created at the Epoch.Werner Koch2020-03-181-12/+16
| | | | | | | | | | | | | | | * g10/getkey.c (merge_selfsigs_main): Take a zero key creation time in account. -- Keys created at the Epoch have a creation time of 0; when figuring out the latest signature with properties to apply to a key the usual comparison A > B does not work if A is always 0. We now special case this for the expiration and usage data. Co-authored-by: [email protected] GnuPG-bug-id: 4670 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Further simplify the gpgconf option processing.Werner Koch2020-03-141-34/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/gc-opt-flags.h (GC_OPT_FLAG_RUNTIME): Move to ... * tools/gpgconf-comp.c: here. (known_options_scdaemon): Remove "options". (known_options_dirmngr): Remove "options". (known_options_gpgsm): Remove "options". (known_options_gpg): Remove "options" and "keyserver". (struct gc_option_s): Rename active t gpgconf_list. (gc_component_list_options): Do not act upon active. (option_check_validity): Ditto. (is_known_option): Make it work correctly for unknown options. (retrieve_options_from_program): Use renamed flag gpgconf_list only to detect duplicated items from --gpgconf-list. Do not set runtime. Only e set the options if set by --gpgconf-list; never clear them. * agent/gpg-agent.c: Simplify the --gpgconf-list output. * dirmngr/dirmngr.c: Ditto. * g10/gpg.c: Ditto. * kbx/keyboxd.c: Ditto. * scd/scdaemon.c: Ditto. * sm/gpgsm.c: Ditto. * tests/openpgp/gpgconf.scm: Use "compliance" instead of "keyserver" for the string arg test. -- There is no need to read the list of options from the components unless they convey a default value. It is better to consult only the list we have in gpgconf-comp.c to decide on whether an option should be displayed. Right, this might mess up thing if a newer gpgconf version is used with an older component, but we already print warnings in this case and in general we do not want to support this anymore - the times of gpg 1.4. and 2.0 are long over now. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --auto-key-importWerner Koch2020-03-143-9/+20
| | | | | | | | | | | | | | | | | * g10/gpg.c (opts): New options --auto-key-import, --no-auto-key-import, and --no-include-key-block. (gpgconf_list): Add them. * g10/options.h (opt): Add field flags.auto_key_import. * g10/mainproc.c (check_sig_and_print): Use flag to enable that feature. * tools/gpgconf-comp.c: Give the new options a Basic config level. -- Note that the --no variants of the options are intended for easy disabling at the command line. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* gpg: Make use of the included key block in a signature.Werner Koch2020-03-1311-50/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/import.c (read_key_from_file): Rename to ... (read_key_from_file_or_buffer): this and add new parameters. Adjust callers. (import_included_key_block): New. * g10/packet.h (PKT_signature): Add field flags.key_block. * g10/parse-packet.c (parse_signature): Set that flags. * g10/sig-check.c (check_signature2): Add parm forced_pk and change all callers. * g10/mainproc.c (do_check_sig): Ditto. (check_sig_and_print): Try the included key block if no key is available. -- This is is the second part to support the new Key Block subpacket. The idea is that after having received a signed mail, it is instantly possible to reply encrypted - without the need for any centralized infrastructure. There is one case where this does not work: A signed mail is received using a specified signer ID (e.g. using gpg --sender option) and the key block with only that user ID is thus imported. The next time a mail is received using the same key but with a different user ID; the signatures checks out using the key imported the last time. However, the new user id is not imported. Now when trying to reply to that last mail, no key will be found. We need to see whether we can update a key in such a case. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --include-key-block.Werner Koch2020-03-134-11/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (SIGSUBPKT_KEY_BLOCK): New. * g10/gpg.c (oIncludeKeyBlock): New. (opts): New option --include-key-block. (main): Implement. * g10/options.h (opt): New flag include_key_block. * g10/parse-packet.c (dump_sig_subpkt): Support SIGSUBPKT_KEY_BLOCK. (parse_one_sig_subpkt): Ditto. (can_handle_critical): Ditto. * g10/sign.c (mk_sig_subpkt_key_block): New. (write_signature_packets): Call it for data signatures. -- This patch adds support for a to be proposed OpenPGP ferature: Introduce the Key Block subpacket to align OpenPGP with CMS. This new subpacket may be used similar to the CertificateSet of CMS (RFC-5652) and thus allows to start encrypted communication after having received a signed message. In practice a stripped down version of the key should be including having only the key material and the self-signatures which are really useful and shall be used by the recipient to reply encrypted. #### Key Block (1 octet with value 0, N octets of key data) This subpacket MAY be used to convey key data along with a signature of class 0x00, 0x01, or 0x02. It MUST contain the key used to create the signature; either as the primary key or as a subkey. The key SHOULD contain a primary or subkey capable of encryption and the entire key must be a valid OpenPGP key including at least one User ID packet and the corresponding self-signatures. Implementations MUST ignore this subpacket if the first octet does not have a value of zero or if the key data does not represent a valid transferable public key. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* gpg: Add property "fpr" for use by --export-filter.Werner Koch2020-03-136-2/+67
| | | | | | | | | | | | | | | | * g10/export.c (push_export_filters): New. (pop_export_filters): New. (export_pubkey_buffer): Add args prefix and prefixlen. Adjust callers. * g10/import.c (impex_filter_getval): Add property "fpr". * g10/main.h (struct impex_filter_parm_s): Add field hexfpr. -- The push and pop feature will help us to use the export filter internally in gpg. Same for the export_pubkey_buffer change. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* doc: Add a comment to explain the signature postscript.Werner Koch2020-03-121-3/+8
| | | | | | | -- Hal Finney explained this on January 22, 2004 on a question from Peter Gutmann on the WG list.
* gpg: Re-group the options in the --help output.Werner Koch2020-03-061-288/+291
| | | | | | | | | | | * g10/gpg.c (opts): Change oLoadExtensions, oStrict, and oNoStrict to use ARGPARSE_ignore and remove the code in the option switch. -- This looks better and is also required for further simplifications of gpgconf. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Support reading global options (part 2).Werner Koch2020-03-061-9/+15
| | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c: Remove all regular option descriptions. They are now read in from the component. Also remove a few meanwhile obsolete options. * agent/gpg-agent.c: Add option description which were only set in gpgconf-comp.c. * dirmngr/dirmngr.c: Ditto. * scd/scdaemon.c: Ditto. * sm/gpgsm.c: Ditto. * g10/gpg.c: Ditto. -- This second part removes all regular option descriptions because they can be read from the components. A few were missing in the components and thus moved to there. Signed-off-by: Werner Koch <[email protected]>
* card: Add yet another vendor.Werner Koch2020-03-031-0/+1
| | | | --
* card: Add new vendor.Werner Koch2020-03-031-0/+1
| | | | --
* gpg: Re-enable versioned config filesWerner Koch2020-02-251-2/+2
| | | | | | * g10/gpg.c (main): Use ARGPARSE_FLAG_USERVERS. Signed-off-by: Werner Koch <[email protected]>