diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-08-23 15:41:17 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-08-23 15:41:17 +0000 |
commit | 0cfbe27d2faccf806f4f206f2d15ed84b8669b89 (patch) | |
tree | aa7ac7b998c0e25efcf3f20ff94defec475e6a77 /res | |
parent | 6a909df1e119eab4e47d9047f75bb0d8505b43f0 (diff) |
add count to 'show keys' (issue #5002)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6383 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rwxr-xr-x | res/res_crypto.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c index 35abfa6fc..aff70061b 100755 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -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; } |