1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

core: add option "certs" in command /debug

This commit is contained in:
Sébastien Helleu
2021-06-17 21:51:18 +02:00
parent fa785e8668
commit 2225ac4e56
25 changed files with 428 additions and 135 deletions
+16 -1
View File
@@ -54,6 +54,7 @@
#include "wee-input.h"
#include "wee-list.h"
#include "wee-log.h"
#include "wee-network.h"
#include "wee-proxy.h"
#include "wee-secure.h"
#include "wee-secure-buffer.h"
@@ -1927,6 +1928,18 @@ COMMAND_CALLBACK(debug)
return WEECHAT_RC_OK;
}
if (string_strcasecmp (argv[1], "certs") == 0)
{
gui_chat_printf (NULL,
NG_("%d certificate loaded (system: %d, user: %d)",
"%d certificates loaded (system: %d, user: %d)",
network_num_certs),
network_num_certs,
network_num_certs_system,
network_num_certs_user);
return WEECHAT_RC_OK;
}
if (string_strcasecmp (argv[1], "memory") == 0)
{
debug_memory ();
@@ -7444,7 +7457,7 @@ command_init ()
N_("list"
" || set <plugin> <level>"
" || dump [<plugin>]"
" || buffer|color|infolists|memory|tags|term|windows"
" || buffer|color|infolists|libs|certs|memory|tags|term|windows"
" || mouse|cursor [verbose]"
" || hdata [free]"
" || time <command>"),
@@ -7463,6 +7476,7 @@ command_init ()
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" certs: display number of loaded trusted certificate authorities\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"
@@ -7481,6 +7495,7 @@ command_init ()
" || hooks"
" || infolists"
" || libs"
" || certs"
" || memory"
" || mouse verbose"
" || tags"
+9
View File
@@ -68,6 +68,9 @@
int network_init_gnutls_ok = 0;
int network_num_certs_system = 0; /* number of system certs loaded */
int network_num_certs_user = 0; /* number of user certs loaded */
int network_num_certs = 0; /* number of certs loaded (system + user) */
gnutls_certificate_credentials_t gnutls_xcred; /* GnuTLS client credentials */
@@ -125,6 +128,8 @@ network_load_system_ca_file (int force_display)
rc);
}
network_num_certs_system = rc;
return rc;
}
@@ -212,6 +217,8 @@ end:
if (options)
hashtable_free (options);
network_num_certs_user = num_loaded;
return num_loaded;
}
@@ -225,6 +232,8 @@ network_load_ca_files (int force_display)
if (weechat_no_gnutls)
return;
network_num_certs_system = 0;
network_num_certs_user = 0;
network_num_certs = 0;
network_num_certs += network_load_system_ca_file (force_display);
+3
View File
@@ -44,6 +44,9 @@ struct t_network_socks5
};
extern int network_init_gnutls_ok;
extern int network_num_certs_system;
extern int network_num_certs_user;
extern int network_num_certs;
extern void network_init_gcrypt ();
extern void network_load_ca_files (int force_display);