From addae04c266401cf049f1188917bf3432873933c Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Tue, 11 Aug 2009 19:02:22 +0300 Subject: db, audit: audit symlinks (by hash of the link target) --- src/apk_blob.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/apk_blob.h') diff --git a/src/apk_blob.h b/src/apk_blob.h index 68b8f7c..06cd8b2 100644 --- a/src/apk_blob.h +++ b/src/apk_blob.h @@ -27,6 +27,7 @@ typedef int (*apk_blob_cb)(void *ctx, apk_blob_t blob); #define APK_CHECKSUM_NONE 0 #define APK_CHECKSUM_MD5 16 #define APK_CHECKSUM_SHA1 20 +#define APK_CHECKSUM_DEFAULT APK_CHECKSUM_SHA1 /* Internal cointainer for MD5 or SHA1 */ struct apk_checksum { @@ -34,12 +35,7 @@ struct apk_checksum { unsigned char type; }; -static inline const EVP_MD *apk_default_checksum(void) -{ - return EVP_sha1(); -} - -static inline const EVP_MD *apk_get_digest(int type) +static inline const EVP_MD *apk_checksum_evp(int type) { switch (type) { case APK_CHECKSUM_MD5: @@ -50,6 +46,11 @@ static inline const EVP_MD *apk_get_digest(int type) return EVP_md_null(); } +static inline const EVP_MD *apk_checksum_default(void) +{ + return apk_checksum_evp(APK_CHECKSUM_DEFAULT); +} + #define APK_BLOB_IS_NULL(blob) ((blob).ptr == NULL) #define APK_BLOB_NULL ((apk_blob_t){0, NULL}) -- cgit v1.2.3-60-g2f50