Skip to content

Commit

Permalink
remove md5
Browse files Browse the repository at this point in the history
Signed-off-by: Niklas Eiling <[email protected]>
  • Loading branch information
n-eiling committed Jul 18, 2023
1 parent f30d9b0 commit 07db2ba
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions cpu/cpu-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <errno.h>
#include <string.h>
#include <sys/wait.h>
#include <openssl/md5.h>
#include <linux/limits.h>
#include "rpc/types.h"
#include <sys/stat.h>
Expand Down Expand Up @@ -46,34 +45,6 @@ int cpu_utils_command(char **command)

}

int cpu_utils_md5hash(char *filename, unsigned long *high, unsigned long *low)
{
unsigned char c[MD5_DIGEST_LENGTH];
FILE *fd;
MD5_CTX mdContext;
int bytes;
unsigned char data[1024];

if (filename == NULL || high == NULL || low == NULL) {
return -1;
}

if ((fd = fopen(filename, "rb")) == NULL) {
LOGE(LOG_ERROR, "%s can't be opened.", filename);
return -1;
}

MD5_Init (&mdContext);
while ((bytes = fread(data, 1, 1024, fd)) != 0)
MD5_Update(&mdContext, data, bytes);
MD5_Final(c, &mdContext);
fclose (fd);
*high = *((unsigned long*)c);
*low = *((unsigned long*)(c+8));
return 0;
}



int cpu_utils_launch_child(const char *file, char **args)
{
Expand Down

0 comments on commit 07db2ba

Please sign in to comment.