aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/call-agent.c10
-rw-r--r--g10/export.c8
-rw-r--r--g10/keyedit.c14
-rw-r--r--g10/keygen.c4
-rw-r--r--g10/sign.c4
-rw-r--r--sm/call-agent.c1
6 files changed, 25 insertions, 16 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index a1a48c75c..5e13a3e52 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -1082,7 +1082,7 @@ agent_keytotpm (ctrl_t ctrl, const char *hexgrip)
if (strchr (hexgrip, ','))
{
- log_error ("storing a part of a dual key is not yet supported\n");
+ log_error ("storing a part of a composite key is not yet supported\n");
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
@@ -1117,7 +1117,7 @@ agent_keytocard (const char *hexgrip, int keyno, int force,
if (strchr (hexgrip, ','))
{
- log_error ("storing a part of a dual key is not yet supported\n");
+ log_error ("storing a part of a composite key is not yet supported\n");
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
@@ -2484,8 +2484,6 @@ agent_get_keyinfo (ctrl_t ctrl, const char *hexkeygrip,
if (err)
return err;
- /* FIXME: Support dual keys. Maybe under the assumption that the
- * first key might be on a card. */
if (!hexkeygrip)
return gpg_error (GPG_ERR_INV_VALUE);
s = strchr (hexkeygrip, ',');
@@ -3236,7 +3234,7 @@ agent_export_key (ctrl_t ctrl, const char *hexkeygrip, const char *desc,
snprintf (line, DIM(line), "EXPORT_KEY %s%s%s %s",
mode1003? "--mode1003" : openpgp_protected ? "--openpgp ":"",
- cache_nonce_addr && *cache_nonce_addr? "--cache-nonce=":"",
+ cache_nonce_addr && *cache_nonce_addr? " --cache-nonce=":"",
cache_nonce_addr && *cache_nonce_addr? *cache_nonce_addr:"",
hexkeygrip);
@@ -3322,7 +3320,7 @@ agent_delete_key (ctrl_t ctrl, const char *hexkeygrip, const char *desc,
return err;
}
- /* FIXME: Shall we add support to DELETE_KEY for dual keys? */
+ /* FIXME: Shall we add support to DELETE_KEY for composite keys? */
snprintf (line, DIM(line), "DELETE_KEY%s %s",
force? " --force":"", hexkeygrip);
err = assuan_transact (agent_ctx, line, NULL, NULL,
diff --git a/g10/export.c b/g10/export.c
index fc2625684..479862021 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -645,7 +645,7 @@ canon_pk_algo (enum gcry_pk_algos algo)
/* Take an s-expression with the public and private key and change the
* parameter array in PK to include the secret parameters. With
- * IS_PART2 set the second key from a dual key is merged into PK. */
+ * IS_PART2 set the second key from a composite key is merged into PK. */
static gpg_error_t
secret_key_to_mode1003 (gcry_sexp_t s_key, PKT_public_key *pk, int is_part2)
{
@@ -802,7 +802,7 @@ secret_key_to_mode1003 (gcry_sexp_t s_key, PKT_public_key *pk, int is_part2)
/* Note that we always have just one secret key parameter in
* mode1003. That one is the entire s-expression as received from
- * the agent and thus also includes the public part. For a dual key
+ * the agent and thus also includes the public part. For a composite key
* both s-expressions are simply concatenated. */
nskey = npkey + 1;
if (nskey > PUBKEY_MAX_NSKEY)
@@ -1486,7 +1486,7 @@ print_status_exported (PKT_public_key *pk)
* If MODE1003 is set, the key is requested in raw GnuPG format from
* the agent. This usually does not require a passphrase unless the
* gpg-agent has not yet used the key and needs to convert it to its
- * internal format first. For the second key of a dual key IS_PART2
+ * internal format first. For the second key of a composite key IS_PART2
* needs to be set.
*
* CACHE_NONCE_ADDR is used to share nonce for multiple key retrievals.
@@ -2019,7 +2019,7 @@ do_export_one_keyblock (ctrl_t ctrl, kbnode_t keyblock, u32 *keyid,
continue;
}
- /* In case of a dual key let hexgrip2 point to the second. */
+ /* In case of a composite key let hexgrip2 point to the second. */
if ((p = strchr (hexgrip, ',')))
{
*p = 0;
diff --git a/g10/keyedit.c b/g10/keyedit.c
index bae79b37e..970a72027 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1201,6 +1201,7 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
int any;
u32 keyid[2], subid[2];
char *hexgrip = NULL;
+ const char *hexgrip2;
char *cache_nonce = NULL;
char *passwd_nonce = NULL;
@@ -1230,7 +1231,6 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
err = hexkeygrip_from_pk (pk, &hexgrip);
if (err)
goto leave;
- /* FIXME: Handle dual keys. */
err = agent_get_keyinfo (ctrl, hexgrip, &serialno, NULL);
if (!err && serialno)
; /* Key on card. */
@@ -1258,7 +1258,7 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
if (node->pkt->pkttype == PKT_PUBLIC_KEY
|| node->pkt->pkttype == PKT_PUBLIC_SUBKEY)
{
- char *desc;
+ char *desc, *p;
pk = node->pkt->pkt.public_key;
keyid_from_pk (pk, subid);
@@ -1267,12 +1267,22 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
err = hexkeygrip_from_pk (pk, &hexgrip);
if (err)
goto leave;
+ if ((p=strchr (hexgrip, ',')))
+ {
+ *p++ = 0;
+ hexgrip2 = p;
+ }
+ else
+ hexgrip2 = NULL;
/* Note that when using --dry-run we don't change the
* passphrase but merely verify the current passphrase. */
desc = gpg_format_keydesc (ctrl, pk, FORMAT_KEYDESC_NORMAL, 1);
err = agent_passwd (ctrl, hexgrip, desc, !!opt.dry_run,
&cache_nonce, &passwd_nonce);
+ if (!err && hexgrip2)
+ err = agent_passwd (ctrl, hexgrip2, desc, !!opt.dry_run,
+ &cache_nonce, &passwd_nonce);
xfree (desc);
if (err)
diff --git a/g10/keygen.c b/g10/keygen.c
index 19770c8de..f88fc5aa8 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1859,7 +1859,7 @@ do_create_from_keygrip (ctrl_t ctrl, int algo,
/* Common code for the key generation function gen_xxx. The optional
* (COMMON_GEN_CB,COMMON_GEN_CB_PARM) can be used as communication
- * object. A KEYPARMS2 forces the use of a dual key (e.g. Kyber+ECC).
+ * object. A KEYPARMS2 forces the use of a composite key (e.g. Kyber+ECC).
*/
static int
common_gen (const char *keyparms, const char *keyparms2,
@@ -6965,7 +6965,7 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock, const char *algostr,
err = hexkeygrip_from_pk (pri_psk, &hexgrip);
if (err)
goto leave;
- /* FIXME: Right now the primary key won't be a dual key. But this
+ /* FIXME: Right now the primary key won't be a composite key. But this
* will change */
if (agent_get_keyinfo (NULL, hexgrip, &serialno, NULL))
{
diff --git a/g10/sign.c b/g10/sign.c
index 9ef032e74..8ceeeda48 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -514,7 +514,7 @@ do_sign (ctrl_t ctrl, PKT_public_key *pksk, PKT_signature *sig,
gcry_sexp_t s_sigval;
desc = gpg_format_keydesc (ctrl, pksk, FORMAT_KEYDESC_NORMAL, 1);
- /* FIXME: Eventually support dual keys. */
+ /* FIXME: Eventually support composite keys. */
err = agent_pksign (NULL/*ctrl*/, cache_nonce, hexgrip, desc,
pksk->keyid, pksk->main_keyid, pksk->pubkey_algo,
dp, gcry_md_get_algo_dlen (mdalgo), mdalgo,
@@ -600,7 +600,7 @@ openpgp_card_v1_p (PKT_public_key *pk)
{
char *hexgrip;
- /* Note: No need to care about dual keys for non-RSA keys. */
+ /* Note: No need to care about composite keys for non-RSA keys. */
err = hexkeygrip_from_pk (pk, &hexgrip);
if (err)
{
diff --git a/sm/call-agent.c b/sm/call-agent.c
index 370cd8e30..75dcf8779 100644
--- a/sm/call-agent.c
+++ b/sm/call-agent.c
@@ -1431,6 +1431,7 @@ keyinfo_status_cb (void *opaque, const char *line)
parm->serialno[s2 - s] = 0;
}
}
+ s -= 3;
}
if (parm->fill_mode && *s0)