summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-02-11 06:20:24 (GMT)
committerAndreas Baumann <mail@andreasbaumann.cc>2023-02-11 06:20:24 (GMT)
commitf867d7b44080fa9716deeff4476275f9a489879f (patch)
treebc964662fc3300dc626fb6d833d8ed5c8f46eca7 /lib/utils_base.c
parent9734c439cba0a02b087e50789e94ec9b07754608 (diff)
parentc07206f2ccc2356aa74bc6813a94c2190017d44e (diff)
downloadmonitoring-plugins-f867d7b44080fa9716deeff4476275f9a489879f.tar.gz
Merge branch 'master' into curlfixes
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c
index 08fa215..eb1823b 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -402,20 +402,20 @@ int mp_translate_state (char *state_text) {
402 * parse of argv, so that uniqueness in parameters are reflected there. 402 * parse of argv, so that uniqueness in parameters are reflected there.
403 */ 403 */
404char *_np_state_generate_key() { 404char *_np_state_generate_key() {
405 struct sha1_ctx ctx; 405 struct sha256_ctx ctx;
406 int i; 406 int i;
407 char **argv = this_monitoring_plugin->argv; 407 char **argv = this_monitoring_plugin->argv;
408 unsigned char result[20]; 408 unsigned char result[20];
409 char keyname[41]; 409 char keyname[41];
410 char *p=NULL; 410 char *p=NULL;
411 411
412 sha1_init_ctx(&ctx); 412 sha256_init_ctx(&ctx);
413 413
414 for(i=0; i<this_monitoring_plugin->argc; i++) { 414 for(i=0; i<this_monitoring_plugin->argc; i++) {
415 sha1_process_bytes(argv[i], strlen(argv[i]), &ctx); 415 sha256_process_bytes(argv[i], strlen(argv[i]), &ctx);
416 } 416 }
417 417
418 sha1_finish_ctx(&ctx, &result); 418 sha256_finish_ctx(&ctx, &result);
419 419
420 for (i=0; i<20; ++i) { 420 for (i=0; i<20; ++i) {
421 sprintf(&keyname[2*i], "%02x", result[i]); 421 sprintf(&keyname[2*i], "%02x", result[i]);