aboutsummaryrefslogtreecommitdiffstats
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-044-16/+10
| | | | | | | * 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, agent: More fixes for fixup of ECC private key.NIIBE Yutaka2020-06-044-19/+27
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos,agent: Fix sexp parsing of private key.NIIBE Yutaka2020-06-031-5/+8
| | | | | | | * agent/sexp-secret.c (fixup_when_ecc_private_key): Correctly parse SEXP. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos, agent: Add fixing up private key part for leading zero.NIIBE Yutaka2020-06-035-10/+128
| | | | | GnuPG-bug-id: 4956 Signed-off-by: NIIBE Yutaka <[email protected]>
* Revert "ecc-sos: Add special leading zero octet removal."NIIBE Yutaka2020-06-011-41/+9
| | | | This reverts commit 1c4291c3951dc73db1511f6198555c2a7642bf12.
* ecc-sos: SOS as Strange Octet String.NIIBE Yutaka2020-05-271-14/+9
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Add special leading zero octet removal.NIIBE Yutaka2020-05-271-9/+41
| | | | | | * agent/cvt-openpgp.c (extract_private_key): Remove leading zeros. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Fix SOS handling and revert change of cvt protocol.NIIBE Yutaka2020-05-261-15/+25
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Unsigned integer for SSH, more.NIIBE Yutaka2020-05-261-1/+1
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: Use unsigned integer format for SSH.NIIBE Yutaka2020-05-261-3/+1
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: When reading private key, it's unsigned.NIIBE Yutaka2020-05-261-1/+1
| | | | | | * agent/findkey.c (agent_public_key_from_file): Use 'M' format. Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: SSH clean up.NIIBE Yutaka2020-05-261-30/+9
| | | | | | | * agent/command-ssh.c (ssh_receive_key): Use sexp_key_construct for EdDSA. 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]>
* Revert "ecc-sos: Fix SOS handling in do_unprotect."NIIBE Yutaka2020-05-251-10/+9
| | | | This reverts commit 43c0c19fcae57529ea57079e034827372ed0b2b7.
* ecc-sos: Fix SOS handling in do_unprotect.NIIBE Yutaka2020-05-201-9/+10
| | | | | | | * agent/cvt-openpgp.c (do_unprotect): Exclude the case when the first byte is zero. 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]>
* agent: Don't use gcry_mpi_scan when not needed.NIIBE Yutaka2020-05-191-13/+3
| | | | | | * agent/pksign.c (do_encode_md): Use %b to build sexp. 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: Fix gpg-agent for SOS handling.NIIBE Yutaka2020-05-181-25/+63
| | | | | | | | | * agent/cvt-openpgp.c (scan_pgp_format): New. (do_unprotect): Fix NBITS in SOS. Use scan_pgp_format. (convert_from_openpgp_main): Always use opaque MPI. Use GCRYMPI_FLAG_USER1 for encrypted data. Signed-off-by: NIIBE Yutaka <[email protected]>
* ecc-sos: gpg-agent access ECC public key as opaque string.NIIBE Yutaka2020-05-141-6/+7
| | | | | | * agent/cvt-openpgp.c (extract_private_key): Use "/q" for public key. 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-045-11/+5
| | | | 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]>
* agent: Fix converting to OpenPGP.NIIBE Yutaka2020-05-041-2/+5
| | | | 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]>
* sm: Add support to export ECC private keys.Werner Koch2020-04-274-211/+559
| | | | | | | | | | | | | | | | | | | * sm/minip12.c [TEST]: Remove test code. Include util.h, tlv.h. and openpgpdefs.h. Remove the class and tag constants and replace them by those from tlv.h. (builder_add_oid, builder_add_mpi): New. (build_key_sequence): Rename to ... (build_rsa_key_sequence): this. (build_ecc_key_sequence): New. (p12_build): Call RSA or ECC builder. (p12_raw_build): Ditto. * sm/export.c (gpgsm_p12_export): Use correct armor header for ECC. (sexp_to_kparms): Support ECC. * sm/t-minip12.c: New to replace the former TEST code in minip12.h. -- GnuPG-bug-id: 4921
* common: Add an easy to use DER builder.Werner Koch2020-04-244-120/+416
| | | | | | | | | | | | | | * common/tlv-builder.c: New. * common/tlv.c: Remove stuff only used by GnuPG 1. (put_tlv_to_membuf, get_tlv_length): Move to ... * common/tlv-builder.c: here. * common/tlv.h (tlv_builder_t): New. -- Such code should actually go into libksba and we will eventually do that. However, for now it is easier to keep it here. Signed-off-by: Werner Koch <[email protected]>
* sm: Minor debug output format changes.Werner Koch2020-04-233-3/+3
| | | | --
* sm: Support decryption of ECDH data.Werner Koch2020-04-231-37/+365
| | | | | | | | | | | | | | | | | * sm/decrypt.c: Include tlv.h. (string_from_gcry_buffer): New. (hash_ecc_cms_shared_info): New. (ecdh_decrypt): New. (prepare_decryption): Support ECDH. Add arg pk_algo. (gpgsm_decrypt): Lift some variables from an inner code block. -- Note: This has only been tested with a single messages created by OpenSSL and taken from the Mozilla bug tracker. In particular the code to included UserKeyingMaterial (ukm) has not been tested. GnuPG-bug-id: 4098 Signed-off-by: Werner Koch <[email protected]>