mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-15 22:00:06 -04:00
Replace sha1 with sha256 in utils_base
This commit is contained in:
parent
cfa0738187
commit
34c6fae0ca
2 changed files with 5 additions and 5 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue