lib/verifysig.c: add xbps_verify_signature to verify signature against digest

This commit is contained in:
Duncaen
2019-07-07 14:09:49 +02:00
committed by Juan RP
parent 62c1102cc4
commit 6ed0c8c5c5
2 changed files with 40 additions and 17 deletions

View File

@ -1866,6 +1866,19 @@ unsigned char *xbps_file_hash_raw(const char *file);
*/
int xbps_file_hash_check(const char *file, const char *sha256);
/**
* Verifies the RSA signature \a sigfile against \a digest with the
* RSA public-key associated in \a repo.
*
* @param[in] repo Repository to use with the RSA public key associated.
* @param[in] sigfile The signature file name used to verify \a digest.
* @param[in] digest The digest to verify.
*
* @return True if the signature is valid, false otherwise.
*/
bool xbps_verify_signature(struct xbps_repo *repo, const char *sigfile,
unsigned char *digest);
/**
* Verifies the RSA signature of \a fname with the RSA public-key associated
* in \a repo.