libxbps: ABI/API break due to hash function changes

This commit is contained in:
Duncan Overbruck
2020-02-10 01:54:52 +01:00
parent aa4d726dca
commit 0d90534236
18 changed files with 141 additions and 118 deletions

View File

@@ -51,7 +51,7 @@
*
* This header documents the full API for the XBPS Library.
*/
#define XBPS_API_VERSION "20200208"
#define XBPS_API_VERSION "20200210"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@@ -258,6 +258,9 @@
*/
#define XBPS_FETCH_TIMEOUT 30
#define XBPS_SHA256_DIGEST_SIZE 32
#define XBPS_SHA256_SIZE 64+1
#ifdef __cplusplus
extern "C" {
#endif
@@ -763,8 +766,8 @@ int xbps_fetch_file(struct xbps_handle *xhp, const char *uri,
* @return -1 on error, 0 if not downloaded (because local/remote size/mtime
* do not match) and 1 if downloaded successfully.
**/
int xbps_fetch_file_digest(struct xbps_handle *xhp, const char *uri,
const char *flags, unsigned char **digestp);
int xbps_fetch_file_sha256(struct xbps_handle *xhp, const char *uri,
const char *flags, unsigned char *digest, size_t digestlen);
/**
* Download a file from a remote URL to current working directory,
@@ -794,8 +797,9 @@ int xbps_fetch_file_dest(struct xbps_handle *xhp, const char *uri,
* @return -1 on error, 0 if not downloaded (because local/remote size/mtime
* do not match) and 1 if downloaded successfully.
**/
int xbps_fetch_file_dest_digest(struct xbps_handle *xhp, const char *uri,
const char *filename, const char *flags, unsigned char **digestp);
int xbps_fetch_file_dest_sha256(struct xbps_handle *xhp, const char *uri,
const char *filename, const char *flags,
unsigned char *digest, size_t digestlen);
/**
* Returns last error string reported by xbps_fetch_file().
@@ -1859,7 +1863,7 @@ bool xbps_mmap_file(const char *file, void **mmf, size_t *mmflen, size_t *filele
* is set appropiately. The pointer should be free(3)d when it's no
* longer needed.
*/
char *xbps_file_hash(const char *file);
bool xbps_file_sha256(char *dst, size_t dstlen, const char *file);
/**
* Returns a raw byte buffer with the sha256 hash for the file specified
@@ -1870,7 +1874,7 @@ char *xbps_file_hash(const char *file);
* is set appropiately. The pointer should be free(3)d when it's no
* longer needed.
*/
unsigned char *xbps_file_hash_raw(const char *file);
bool xbps_file_sha256_raw(unsigned char *dst, size_t dstlen, const char *file);
/**
* Compares the sha256 hash of the file \a file with the sha256
@@ -1882,7 +1886,7 @@ unsigned char *xbps_file_hash_raw(const char *file);
* @return 0 if \a file and \a sha256 have the same hash, ERANGE
* if it differs, or any other errno value on error.
*/
int xbps_file_hash_check(const char *file, const char *sha256);
int xbps_file_sha256_check(const char *file, const char *sha256);
/**
* Verifies the RSA signature \a sigfile against \a digest with the