Replace sha1 with sha256 in utils_base

This commit is contained in:
RincewindsHat 2023-01-31 15:17:51 +01:00
parent cfa0738187
commit 34c6fae0ca
2 changed files with 5 additions and 5 deletions

View file

@ -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; i<this_monitoring_plugin->argc; 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]);

View file

@ -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 */