0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-16 10:31:07 +00:00

Disable hashes for charts and alerts if openssl is not available or cloud is disabled ()

* disable hashes for charts and alerts if openssl is not available

* create hashes if disable_cloud has not been defined and https has been defined
This commit is contained in:
Emmanuel Vasilakis 2022-02-08 16:30:15 +02:00 committed by GitHub
parent 87071cbae2
commit 713018281a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -1646,8 +1646,14 @@ int sql_store_chart_hash(
return 1;
}
/*
chart hashes are used for cloud communication.
if cloud is disabled or openssl is not available (which will prevent cloud connectivity)
skip hash calculations
*/
void compute_chart_hash(RRDSET *st)
{
#if !defined DISABLE_CLOUD && defined ENABLE_HTTPS
EVP_MD_CTX *evpctx;
unsigned char hash_value[EVP_MAX_MD_SIZE];
unsigned int hash_len;
@ -1693,6 +1699,9 @@ void compute_chart_hash(RRDSET *st)
st->module_name,
st->priority,
st->chart_type);
#else
UNUSED(st);
#endif
return;
}

View file

@ -890,11 +890,19 @@ int sql_store_alert_config_hash(uuid_t *hash_id, struct alert_config *cfg)
return 1;
}
/*
alert hashes are used for cloud communication.
if cloud is disabled or openssl is not available (which will prevent cloud connectivity)
skip hash calculations
*/
#if !defined DISABLE_CLOUD && defined ENABLE_HTTPS
#define DIGEST_ALERT_CONFIG_VAL(v) ((v) ? EVP_DigestUpdate(evpctx, (v), strlen((v))) : EVP_DigestUpdate(evpctx, "", 1))
#endif
int alert_hash_and_store_config(
uuid_t hash_id,
struct alert_config *cfg)
{
#if !defined DISABLE_CLOUD && defined ENABLE_HTTPS
EVP_MD_CTX *evpctx;
unsigned char hash_value[EVP_MAX_MD_SIZE];
unsigned int hash_len;
@ -939,6 +947,10 @@ int alert_hash_and_store_config(
/* store everything, so it can be recreated when not in memory or just a subset ? */
(void)sql_store_alert_config_hash( (uuid_t *)&hash_value, cfg);
#else
UNUSED(hash_id);
UNUSED(cfg);
#endif
return 1;
}