aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-06-04ecc-sos,gpg: More fixes for SOS.gniibe/sosNIIBE Yutaka4-5/+44
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-06-04Fix previous commit.NIIBE Yutaka1-1/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-06-04ecc-sos,gpg: Use sexp_extract_param_sos to get MPI.NIIBE Yutaka3-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]>
2020-06-04ecc-sos: Apply SOS also to ECDSA.NIIBE Yutaka3-5/+12
This causes a regression in: FAIL: tests/openpgp/ecc.scm Signed-off-by: NIIBE Yutaka <[email protected]>
2020-06-04ecc-sos: Fix handling cleartext secret key from agent.NIIBE Yutaka1-7/+52
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-27ecc-sos: SOS as Strange Octet String.NIIBE Yutaka1-14/+9
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-25ecc-sos: Backport master change for ECDH.NIIBE Yutaka3-298/+368
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-20ecc-sos: Avoid using gcry_mpi_print and gcry_mpi_scan.NIIBE Yutaka5-49/+79
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-20ecc-sos: Fix ECDH.NIIBE Yutaka1-8/+2
* g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Fix deallocation. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-19ecc-sos: Fix exporting secret key for SOS.NIIBE Yutaka1-7/+7
* g10/export.c (transfer_format_to_openpgp): Use SOS. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-14ecc-sos: Use opaque for key from agent.NIIBE Yutaka1-1/+1
* g10/export.c (cleartext_secret_key_to_openpgp): Use /q. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-14ecc-sos: Compatible mode for SOS.NIIBE Yutaka1-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]>
2020-05-14ecc-sos: No need to expose sos_write.NIIBE Yutaka2-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]>
2020-05-12ecc-sos: Clean up use of mpi_get_opaque.NIIBE Yutaka1-2/+2
* g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Tidy up. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-08ecc-sos: Remove zero-octet removal on write.NIIBE Yutaka2-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]>
2020-05-04ecc-sos: Fix gpg_mpi_write for opaque bit string.NIIBE Yutaka1-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]>
2020-05-04ecc-sos: Fix reading SEXP from agent.NIIBE Yutaka1-1/+1
* g10/keygen.c (ecckey_from_sexp): Use GCRYMPI_FMT_OPAQUE. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04ecc-sos: Fix parsing key for EdDSA/ECDH.NIIBE Yutaka1-1/+5
* g10/parse-packet.c (parse_key): Read by sos_read. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04ecc-sos: public key is MPI with the prefix 0x40.NIIBE Yutaka4-10/+4
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04sos: don't change NBITS.NIIBE Yutaka1-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]>
2020-05-04sos: Fix fingerprint computation.NIIBE Yutaka4-9/+14
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04Fix exporting key for ECC.NIIBE Yutaka1-2/+2
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Fix for the condition calling gpg_sos_write.NIIBE Yutaka1-4/+20
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Use opaque MPI for shared point.NIIBE Yutaka1-7/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Implement the fix-up of zero for SOS.NIIBE Yutaka1-0/+23
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Use opaque MPI for ECDH.NIIBE Yutaka2-24/+4
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Use GCRYMPI_FLAG_USER2 for SOS, and hash_public_key with that.NIIBE Yutaka2-3/+13
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04Add sos_read.NIIBE Yutaka2-10/+98
Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Use opaque byte MPI interface for ECC key.NIIBE Yutaka1-1/+1
* g10/keygen.c (ecckey_from_sexp): Parse by GCRYMPI_FMT_OPAQUE. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-05-04gpg: Introduce SOS (Simply Octet String) support.NIIBE Yutaka2-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]>
2020-04-16gpg: Make AEAD modes subject to compliance checks.Werner Koch1-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]>
2020-04-15indent: Some typo and indentation changes for gpg.Werner Koch4-14/+16
--
2020-04-15gpg: Fix broken setting of AEAD algo.Werner Koch1-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.
2020-04-08gpg: ECDH: Accept longer padding.NIIBE Yutaka1-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]>
2020-04-03gpg,card: Use the new MANUFACTURER attribute.Werner Koch3-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]>
2020-04-03gpg: Add regular expression support.NIIBE Yutaka2-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]>
2020-03-18gpg: Also allow a v5 fingerprint for --trusted-key.Werner Koch1-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]>
2020-03-18gpg: Update --trusted-key to accept fingerprint as well as long key id.Daniel Kahn Gillmor1-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]>
2020-03-18gpg: Fix key expiration and usage for keys created at the Epoch.Werner Koch1-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]>
2020-03-14gpgconf: Further simplify the gpgconf option processing.Werner Koch1-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]>
2020-03-14gpg: New option --auto-key-importWerner Koch3-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]>
2020-03-13gpg: Make use of the included key block in a signature.Werner Koch11-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]>
2020-03-13gpg: New option --include-key-block.Werner Koch4-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]>
2020-03-13gpg: Add property "fpr" for use by --export-filter.Werner Koch6-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]>
2020-03-12doc: Add a comment to explain the signature postscript.Werner Koch1-3/+8
-- Hal Finney explained this on January 22, 2004 on a question from Peter Gutmann on the WG list.
2020-03-06gpg: Re-group the options in the --help output.Werner Koch1-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]>
2020-03-06gpgconf: Support reading global options (part 2).Werner Koch1-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]>
2020-03-03card: Add yet another vendor.Werner Koch1-0/+1
--
2020-03-03card: Add new vendor.Werner Koch1-0/+1
--
2020-02-25gpg: Re-enable versioned config filesWerner Koch1-2/+2
* g10/gpg.c (main): Use ARGPARSE_FLAG_USERVERS. Signed-off-by: Werner Koch <[email protected]>