Skip to content

Commit

Permalink
Make unused Pageant accessor functions private.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sgtatham committed Apr 2, 2021
1 parent fbab166 commit 30c87c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 6 additions & 4 deletions pageant.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
12 changes: 2 additions & 10 deletions pageant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 30c87c2

Please sign in to comment.