Page MenuHome GnuPG

Add a way to extract ECC key parameters from a public key
Open, HighPublic

Description

We need a helper function in GPGM to extract the PGP ECC parameters from a key. These are required by Kleopatra to be passed to the KEYTOCARD command.

We need something similar to this:

char *
ecdh_param_str_from_pk (PKT_public_key *pk)
{
  const unsigned char *s;
  unsigned int n;

  if (!pk
      || pk->pubkey_algo != PUBKEY_ALGO_ECDH
      || !gcry_mpi_get_flag (pk->pkey[2], GCRYMPI_FLAG_OPAQUE)
      || !(s = gcry_mpi_get_opaque (pk->pkey[2], &n)) || !n)
    {
      gpg_err_set_errno (EINVAL);
      return NULL;  /* Invalid parameter */
    }

  n = (n+7)/8;
  return bin2hex (s, n, NULL);
}

Event Timeline

werner triaged this task as Normal priority.Jul 27 2023, 6:33 PM
werner created this task.
werner created this object with edit policy "Contributor (Project)".
werner renamed this task from Add a way to extarct ECC key parameters from a public key to Add a way to extract ECC key parameters from a public key.Jul 27 2023, 6:35 PM
werner updated the task description. (Show Details)
werner raised the priority of this task from Normal to High.Jan 24 2024, 4:26 PM
werner added projects: kleopatra, Restricted Project.

Just a reminder, this is important for 384 bit keys (see T6379).