mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-09 12:54:23 +01:00
gpg: Remove unused arg in a card related function.
* g10/call-agent.c (agent_scd_setattr): Remove unused arg serialno. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 3a4534d82682f69788da3cf4a445e38fbaf6b98e)
This commit is contained in:
parent
6e6078c8d0
commit
c66a2cc8d3
@ -720,7 +720,10 @@ learn_status_cb (void *opaque, const char *line)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call the scdaemon to learn about a smartcard */
|
|
||||||
|
/* Call the scdaemon to learn about a smartcard. Note that in
|
||||||
|
* contradiction to the function's name, gpg-agent's LEARN command is
|
||||||
|
* used and not the low-level "SCD LEARN". */
|
||||||
int
|
int
|
||||||
agent_scd_learn (struct agent_card_info_s *info, int force)
|
agent_scd_learn (struct agent_card_info_s *info, int force)
|
||||||
{
|
{
|
||||||
@ -868,23 +871,21 @@ agent_scd_getattr (const char *name, struct agent_card_info_s *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Send an setattr command to the SCdaemon. SERIALNO is not actually
|
/* Send an setattr command to the SCdaemon.
|
||||||
used here but required by gpg 1.4's implementation of this code in
|
* Used by:
|
||||||
cardglue.c. */
|
* card-util.c
|
||||||
int
|
*/
|
||||||
agent_scd_setattr (const char *name,
|
gpg_error_t
|
||||||
const unsigned char *value, size_t valuelen,
|
agent_scd_setattr (const char *name, const void *value_arg, size_t valuelen)
|
||||||
const char *serialno)
|
|
||||||
{
|
{
|
||||||
int rc;
|
gpg_error_t err;
|
||||||
|
const unsigned char *value = value_arg;
|
||||||
char line[ASSUAN_LINELENGTH];
|
char line[ASSUAN_LINELENGTH];
|
||||||
char *p;
|
char *p;
|
||||||
struct default_inq_parm_s parm;
|
struct default_inq_parm_s parm;
|
||||||
|
|
||||||
memset (&parm, 0, sizeof parm);
|
memset (&parm, 0, sizeof parm);
|
||||||
|
|
||||||
(void)serialno;
|
|
||||||
|
|
||||||
if (!*name || !valuelen)
|
if (!*name || !valuelen)
|
||||||
return gpg_error (GPG_ERR_INV_VALUE);
|
return gpg_error (GPG_ERR_INV_VALUE);
|
||||||
|
|
||||||
@ -910,16 +911,16 @@ agent_scd_setattr (const char *name,
|
|||||||
}
|
}
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
rc = start_agent (NULL, 1);
|
err = start_agent (NULL, 1);
|
||||||
if (!rc)
|
if (!err)
|
||||||
{
|
{
|
||||||
parm.ctx = agent_ctx;
|
parm.ctx = agent_ctx;
|
||||||
rc = assuan_transact (agent_ctx, line, NULL, NULL,
|
err = assuan_transact (agent_ctx, line, NULL, NULL,
|
||||||
default_inq_cb, &parm, NULL, NULL);
|
default_inq_cb, &parm, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
status_sc_op_failure (rc);
|
status_sc_op_failure (err);
|
||||||
return rc;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,9 +99,8 @@ int agent_keytocard (const char *hexgrip, int keyno, int force,
|
|||||||
const char *serialno, const char *timestamp);
|
const char *serialno, const char *timestamp);
|
||||||
|
|
||||||
/* Send a SETATTR command to the SCdaemon. */
|
/* Send a SETATTR command to the SCdaemon. */
|
||||||
int agent_scd_setattr (const char *name,
|
gpg_error_t agent_scd_setattr (const char *name,
|
||||||
const unsigned char *value, size_t valuelen,
|
const void *value, size_t valuelen);
|
||||||
const char *serialno);
|
|
||||||
|
|
||||||
/* Send a WRITECERT command to the SCdaemon. */
|
/* Send a WRITECERT command to the SCdaemon. */
|
||||||
int agent_scd_writecert (const char *certidstr,
|
int agent_scd_writecert (const char *certidstr,
|
||||||
|
@ -814,7 +814,7 @@ change_name (void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = agent_scd_setattr ("DISP-NAME", isoname, strlen (isoname), NULL );
|
rc = agent_scd_setattr ("DISP-NAME", isoname, strlen (isoname));
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting Name: %s\n", gpg_strerror (rc));
|
log_error ("error setting Name: %s\n", gpg_strerror (rc));
|
||||||
|
|
||||||
@ -835,7 +835,7 @@ change_url (void)
|
|||||||
trim_spaces (url);
|
trim_spaces (url);
|
||||||
cpr_kill_prompt ();
|
cpr_kill_prompt ();
|
||||||
|
|
||||||
rc = agent_scd_setattr ("PUBKEY-URL", url, strlen (url), NULL );
|
rc = agent_scd_setattr ("PUBKEY-URL", url, strlen (url));
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting URL: %s\n", gpg_strerror (rc));
|
log_error ("error setting URL: %s\n", gpg_strerror (rc));
|
||||||
xfree (url);
|
xfree (url);
|
||||||
@ -991,7 +991,7 @@ change_login (const char *args)
|
|||||||
n = strlen (data);
|
n = strlen (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = agent_scd_setattr ("LOGIN-DATA", data, n, NULL );
|
rc = agent_scd_setattr ("LOGIN-DATA", data, n);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting login data: %s\n", gpg_strerror (rc));
|
log_error ("error setting login data: %s\n", gpg_strerror (rc));
|
||||||
xfree (data);
|
xfree (data);
|
||||||
@ -1029,7 +1029,7 @@ change_private_do (const char *args, int nr)
|
|||||||
n = strlen (data);
|
n = strlen (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = agent_scd_setattr (do_name, data, n, NULL );
|
rc = agent_scd_setattr (do_name, data, n);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting private DO: %s\n", gpg_strerror (rc));
|
log_error ("error setting private DO: %s\n", gpg_strerror (rc));
|
||||||
xfree (data);
|
xfree (data);
|
||||||
@ -1128,7 +1128,7 @@ change_lang (void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = agent_scd_setattr ("DISP-LANG", data, strlen (data), NULL );
|
rc = agent_scd_setattr ("DISP-LANG", data, strlen (data));
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting lang: %s\n", gpg_strerror (rc));
|
log_error ("error setting lang: %s\n", gpg_strerror (rc));
|
||||||
xfree (data);
|
xfree (data);
|
||||||
@ -1164,7 +1164,7 @@ change_sex (void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = agent_scd_setattr ("DISP-SEX", str, 1, NULL );
|
rc = agent_scd_setattr ("DISP-SEX", str, 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting sex: %s\n", gpg_strerror (rc));
|
log_error ("error setting sex: %s\n", gpg_strerror (rc));
|
||||||
xfree (data);
|
xfree (data);
|
||||||
@ -1210,7 +1210,7 @@ change_cafpr (int fprno)
|
|||||||
|
|
||||||
rc = agent_scd_setattr (fprno==1?"CA-FPR-1":
|
rc = agent_scd_setattr (fprno==1?"CA-FPR-1":
|
||||||
fprno==2?"CA-FPR-2":
|
fprno==2?"CA-FPR-2":
|
||||||
fprno==3?"CA-FPR-3":"x", fpr, 20, NULL );
|
fprno==3?"CA-FPR-3":"x", fpr, 20);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error setting cafpr: %s\n", gpg_strerror (rc));
|
log_error ("error setting cafpr: %s\n", gpg_strerror (rc));
|
||||||
write_sc_op_status (rc);
|
write_sc_op_status (rc);
|
||||||
@ -1236,7 +1236,7 @@ toggle_forcesig (void)
|
|||||||
newstate = !info.chv1_cached;
|
newstate = !info.chv1_cached;
|
||||||
agent_release_card_info (&info);
|
agent_release_card_info (&info);
|
||||||
|
|
||||||
rc = agent_scd_setattr ("CHV-STATUS-1", newstate? "\x01":"", 1, NULL);
|
rc = agent_scd_setattr ("CHV-STATUS-1", newstate? "\x01":"", 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("error toggling signature PIN flag: %s\n", gpg_strerror (rc));
|
log_error ("error toggling signature PIN flag: %s\n", gpg_strerror (rc));
|
||||||
write_sc_op_status (rc);
|
write_sc_op_status (rc);
|
||||||
@ -1286,7 +1286,7 @@ check_pin_for_key_operation (struct agent_card_info_s *info, int *forced_chv1)
|
|||||||
{ /* Switch off the forced mode so that during key generation we
|
{ /* Switch off the forced mode so that during key generation we
|
||||||
don't get bothered with PIN queries for each
|
don't get bothered with PIN queries for each
|
||||||
self-signature. */
|
self-signature. */
|
||||||
rc = agent_scd_setattr ("CHV-STATUS-1", "\x01", 1, info->serialno);
|
rc = agent_scd_setattr ("CHV-STATUS-1", "\x01", 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("error clearing forced signature PIN flag: %s\n",
|
log_error ("error clearing forced signature PIN flag: %s\n",
|
||||||
@ -1317,7 +1317,7 @@ restore_forced_chv1 (int *forced_chv1)
|
|||||||
|
|
||||||
if (*forced_chv1)
|
if (*forced_chv1)
|
||||||
{ /* Switch back to forced state. */
|
{ /* Switch back to forced state. */
|
||||||
rc = agent_scd_setattr ("CHV-STATUS-1", "", 1, NULL);
|
rc = agent_scd_setattr ("CHV-STATUS-1", "", 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
log_error ("error setting forced signature PIN flag: %s\n",
|
log_error ("error setting forced signature PIN flag: %s\n",
|
||||||
@ -1565,7 +1565,7 @@ do_change_keyattr (int keyno, const struct key_attr *key_attr)
|
|||||||
return gpg_error (GPG_ERR_PUBKEY_ALGO);
|
return gpg_error (GPG_ERR_PUBKEY_ALGO);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = agent_scd_setattr ("KEY-ATTR", args, strlen (args), NULL);
|
err = agent_scd_setattr ("KEY-ATTR", args, strlen (args));
|
||||||
if (err)
|
if (err)
|
||||||
log_error (_("error changing key attribute for key %d: %s\n"),
|
log_error (_("error changing key attribute for key %d: %s\n"),
|
||||||
keyno+1, gpg_strerror (err));
|
keyno+1, gpg_strerror (err));
|
||||||
@ -2111,8 +2111,7 @@ kdf_setup (const char *args)
|
|||||||
goto leave_error;
|
goto leave_error;
|
||||||
|
|
||||||
err = agent_scd_setattr ("KDF", kdf_data,
|
err = agent_scd_setattr ("KDF", kdf_data,
|
||||||
single ? KDF_DATA_LENGTH_MIN : KDF_DATA_LENGTH_MAX,
|
single ? KDF_DATA_LENGTH_MIN : KDF_DATA_LENGTH_MAX);
|
||||||
NULL);
|
|
||||||
if (err)
|
if (err)
|
||||||
goto leave_error;
|
goto leave_error;
|
||||||
|
|
||||||
@ -2125,6 +2124,8 @@ kdf_setup (const char *args)
|
|||||||
leave:
|
leave:
|
||||||
agent_release_card_info (&info);
|
agent_release_card_info (&info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Data used by the command parser. This needs to be outside of the
|
/* Data used by the command parser. This needs to be outside of the
|
||||||
function scope to allow readline based command completion. */
|
function scope to allow readline based command completion. */
|
||||||
|
@ -1340,7 +1340,7 @@ subkey_is_ok (const PKT_public_key *sub)
|
|||||||
|
|
||||||
/* Return true if KEYBLOCK has only expired encryption subkyes. Note
|
/* Return true if KEYBLOCK has only expired encryption subkyes. Note
|
||||||
* that the function returns false if the key has no encryption
|
* that the function returns false if the key has no encryption
|
||||||
* subkeys at all or the subkecys are revoked. */
|
* subkeys at all or the subkeys are revoked. */
|
||||||
static int
|
static int
|
||||||
only_expired_enc_subkeys (kbnode_t keyblock)
|
only_expired_enc_subkeys (kbnode_t keyblock)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user