1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 11:43:13 +02:00

core: add info_hashtable "secured_data"

This commit is contained in:
Sébastien Helleu
2021-02-25 19:06:47 +01:00
parent 5725c8561c
commit 3d587ad37d
22 changed files with 217 additions and 16 deletions
+29
View File
@@ -31,6 +31,7 @@
#include "wee-config-file.h"
#include "wee-crypto.h"
#include "wee-hashtable.h"
#include "wee-hook.h"
#include "wee-secure.h"
#include "wee-secure-config.h"
#include "wee-string.h"
@@ -493,6 +494,24 @@ secure_decrypt_data_not_decrypted (const char *passphrase)
return num_ok;
}
/*
* Returns secured data hashtable.
*/
struct t_hashtable *
secure_info_hashtable_secured_data_cb (const void *pointer, void *data,
const char *info_name,
struct t_hashtable *hashtable)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
(void) hashtable;
return hashtable_dup (secure_hashtable_data);
}
/*
* Initializes secured data.
*
@@ -535,6 +554,16 @@ secure_init ()
return 0;
}
/* info (hashtable) with the secured data */
hook_info_hashtable (
NULL,
"secured_data",
N_("secured data"),
NULL,
N_("secured data: names and values (be careful: the values are "
"sensitive data: do NOT print/log them anywhere)"),
&secure_info_hashtable_secured_data_cb, NULL, NULL);
return 1;
}