From 34c6fae0ca405cddf2d60e76d785fc520d336582 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 31 Jan 2023 15:17:51 +0100 Subject: Replace sha1 with sha256 in utils_base 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) { * parse of argv, so that uniqueness in parameters are reflected there. */ char *_np_state_generate_key() { - struct sha1_ctx ctx; + struct sha256_ctx ctx; int i; char **argv = this_monitoring_plugin->argv; unsigned char result[20]; char keyname[41]; char *p=NULL; - sha1_init_ctx(&ctx); + sha256_init_ctx(&ctx); for(i=0; iargc; i++) { - sha1_process_bytes(argv[i], strlen(argv[i]), &ctx); + sha256_process_bytes(argv[i], strlen(argv[i]), &ctx); } - sha1_finish_ctx(&ctx, &result); + sha256_finish_ctx(&ctx, &result); for (i=0; i<20; ++i) { sprintf(&keyname[2*i], "%02x", result[i]); diff --git a/lib/utils_base.h b/lib/utils_base.h index 9482f23..5906550 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h @@ -2,7 +2,7 @@ #define _UTILS_BASE_ /* Header file for Monitoring Plugins utils_base.c */ -#include "sha1.h" +#include "sha256.h" /* This file holds header information for thresholds - use this in preference to individual plugin logic */ -- cgit v0.10-9-g596f