xbps
xbps copied to clipboard
Generalizing sha256-functions
Hey! I've resolved the deprecated SHA256_* functions with it's EVP_* functions. With that I've generic all xbps_file_sha256(...) functions to xbps_file_hash(XBPS_HASH_SHA256, ...) thus making support for other hashes in e.g. xbps-digest more easy.
-
File Hashing Abstraction:
- Introduces an enumeration
xbps_hash_algorithm_trepresenting different hashing algorithms, includingXBPS_HASH_SHA256andXBPS_HASH_BLAKE2B256. - Adds functions
xbps_hash_size_rawandxbps_hash_sizeto retrieve raw and hexstring hash sizes. - Implements
xbps_file_hash_rawandxbps_file_hashto calculate raw and hexstring file hashes, respectively, based on the chosen algorithm.
- Introduces an enumeration
-
Code Refactoring:
- Replaces instances of direct SHA256 calls with the new file hashing functions (
xbps_file_hash_rawandxbps_file_hash) in various parts of the codebase. - Enhances the
xbps_file_hash_checkfunction to support different hashing algorithms.
- Replaces instances of direct SHA256 calls with the new file hashing functions (
-
Support for Blake2b256:
- Adjusts the existing codebase to use the new hash functions, ensuring compatibility with both SHA256 and Blake2b256.