1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Make unused Pageant accessor functions private.

We're no longer calling pageant_nth_ssh*_key or pageant_add_ssh*_key
from outside pageant.c. Remove them from pageant.h and turn them
static, so that we carry on not doing so.
This commit is contained in:
Simon Tatham 2021-04-02 11:39:01 +01:00
parent fbab166728
commit 30c87c2896
2 changed files with 8 additions and 14 deletions

View File

@ -128,6 +128,8 @@ static bool gui_request_in_progress = false;
static void failure(PageantClient *pc, PageantClientRequestId *reqid,
strbuf *sb, unsigned char type, const char *fmt, ...);
static void fail_requests_for_key(PageantKey *pk, const char *reason);
static RSAKey *pageant_nth_ssh1_key(int i);
static ssh2_userkey *pageant_nth_ssh2_key(int i);
static void pk_free(PageantKey *pk)
{
@ -213,7 +215,7 @@ static int count_keys(int ssh_version)
int pageant_count_ssh1_keys(void) { return count_keys(1); }
int pageant_count_ssh2_keys(void) { return count_keys(2); }
bool pageant_add_ssh1_key(RSAKey *rkey)
static bool pageant_add_ssh1_key(RSAKey *rkey)
{
PageantKey *pk = snew(PageantKey);
memset(pk, 0, sizeof(PageantKey));
@ -234,7 +236,7 @@ bool pageant_add_ssh1_key(RSAKey *rkey)
}
}
bool pageant_add_ssh2_key(ssh2_userkey *skey)
static bool pageant_add_ssh2_key(ssh2_userkey *skey)
{
PageantKey *pk = snew(PageantKey);
memset(pk, 0, sizeof(PageantKey));
@ -1370,7 +1372,7 @@ void pageant_init(void)
keytree = newtree234(cmpkeys);
}
RSAKey *pageant_nth_ssh1_key(int i)
static RSAKey *pageant_nth_ssh1_key(int i)
{
PageantKey *pk = index234(keytree, find_first_key_for_version(1) + i);
if (pk && pk->sort.ssh_version == 1)
@ -1379,7 +1381,7 @@ RSAKey *pageant_nth_ssh1_key(int i)
return NULL;
}
ssh2_userkey *pageant_nth_ssh2_key(int i)
static ssh2_userkey *pageant_nth_ssh2_key(int i)
{
PageantKey *pk = index234(keytree, find_first_key_for_version(2) + i);
if (pk && pk->sort.ssh_version == 2)

View File

@ -112,19 +112,11 @@ void pageant_make_keylist1(BinarySink *);
void pageant_make_keylist2(BinarySink *);
/*
* Accessor functions for Pageant's internal key lists. Fetch the nth
* key; count the keys; attempt to add a key (returning true on
* success, in which case the ownership of the key structure has been
* taken over by pageant.c); attempt to delete a key (returning true
* on success, in which case the ownership of the key structure is
* passed back to the client).
* Accessor functions for Pageant's internal key lists, used by GUI
* Pageant, to count the keys and to delete a key.
*/
RSAKey *pageant_nth_ssh1_key(int i);
ssh2_userkey *pageant_nth_ssh2_key(int i);
int pageant_count_ssh1_keys(void);
int pageant_count_ssh2_keys(void);
bool pageant_add_ssh1_key(RSAKey *rkey);
bool pageant_add_ssh2_key(ssh2_userkey *skey);
bool pageant_delete_nth_ssh1_key(int i);
bool pageant_delete_nth_ssh2_key(int i);