summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorLorenz Kästle <lorenz.kaestle@netways.de>2023-03-09 10:03:48 (GMT)
committerLorenz Kästle <lorenz.kaestle@netways.de>2023-03-09 10:03:48 (GMT)
commitd0edb72a0c9bc1a28197ab4566928f7ee63a6d43 (patch)
tree6d524fb16d2dd1aa9f2d98529ef1de7a39f52700 /lib/utils_base.c
parent9fdc82f0543c6e2891c7079f70297f92e8ef4619 (diff)
parent269718094177fb8a7e3d3005d1310495009fe8c4 (diff)
downloadmonitoring-plugins-d0edb72a0c9bc1a28197ab4566928f7ee63a6d43.tar.gz
Merge branch 'master' into RincewindsHat-patch-1
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]);