summaryrefslogtreecommitdiffstats
path: root/database/sqlite/sqlite_health.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-15 03:25:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-15 03:26:11 +0000
commit412fb90f5888df13fdeafb5705b9ea6eef1a4df1 (patch)
treea33fe79d3373f32b30ff799e6e15331bd6975f76 /database/sqlite/sqlite_health.c
parentReleasing debian version 1.33.0-1. (diff)
downloadnetdata-412fb90f5888df13fdeafb5705b9ea6eef1a4df1.tar.xz
netdata-412fb90f5888df13fdeafb5705b9ea6eef1a4df1.zip
Merging upstream version 1.33.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/sqlite/sqlite_health.c')
-rw-r--r--database/sqlite/sqlite_health.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/database/sqlite/sqlite_health.c b/database/sqlite/sqlite_health.c
index 116cb4f3..27c67c3a 100644
--- a/database/sqlite/sqlite_health.c
+++ b/database/sqlite/sqlite_health.c
@@ -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;
}