mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 01:06:20 +00:00
17
src/common.c
17
src/common.c
@@ -56,7 +56,6 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "common.h"
|
||||
#include "tools/p_sha1.h"
|
||||
|
||||
struct curl_data_t
|
||||
{
|
||||
@@ -319,22 +318,6 @@ release_is_new(char *found_version)
|
||||
}
|
||||
}
|
||||
|
||||
char*
|
||||
p_sha1_hash(char *str)
|
||||
{
|
||||
P_SHA1_CTX ctx;
|
||||
uint8_t digest[20];
|
||||
uint8_t *input = (uint8_t*)malloc(strlen(str) + 1);
|
||||
memcpy(input, str, strlen(str) + 1);
|
||||
|
||||
P_SHA1_Init(&ctx);
|
||||
P_SHA1_Update(&ctx, input, strlen(str));
|
||||
P_SHA1_Final(&ctx, digest);
|
||||
|
||||
free(input);
|
||||
return g_base64_encode(digest, sizeof(digest));
|
||||
}
|
||||
|
||||
static size_t
|
||||
_data_callback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user