Sign repodata

This commit is contained in:
Piotr Wójcik
2019-10-01 21:18:25 +02:00
committed by Juan RP
parent 6886a73288
commit 04194f44c8
8 changed files with 122 additions and 20 deletions

View File

@@ -108,6 +108,22 @@ xbps_mmap_file(const char *file, void **mmf, size_t *mmflen, size_t *filelen)
return true;
}
unsigned char *
xbps_buffer_hash_raw(const char *buffer, ssize_t len)
{
unsigned char *digest;
SHA256_CTX sha256;
digest = malloc(SHA256_DIGEST_LENGTH);
assert(digest);
SHA256_Init(&sha256);
SHA256_Update(&sha256, buffer, len);
SHA256_Final(digest, &sha256);
return digest;
}
unsigned char *
xbps_file_hash_raw(const char *file)
{