mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
add count to 'show keys' (issue #5002)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -501,6 +501,7 @@ static int show_keys(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_key *key;
|
||||
char sum[16 * 2 + 1];
|
||||
int count_keys = 0;
|
||||
|
||||
ast_mutex_lock(&keylock);
|
||||
key = keys;
|
||||
@@ -512,8 +513,10 @@ static int show_keys(int fd, int argc, char *argv[])
|
||||
key->ktype & KEY_NEEDS_PASSCODE ? "[Needs Passcode]" : "[Loaded]", sum);
|
||||
|
||||
key = key->next;
|
||||
count_keys++;
|
||||
}
|
||||
ast_mutex_unlock(&keylock);
|
||||
ast_cli(fd, "%d known RSA keys.\n", count_keys);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user