diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-08-11 19:02:22 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-08-11 19:02:22 +0300 |
commit | addae04c266401cf049f1188917bf3432873933c (patch) | |
tree | e2469e26d79fa4b8828d95271fe1e740559019e3 /src/apk_blob.h | |
parent | 949d375aa9c9a7fe9cec85740df9de296fab095f (diff) | |
download | apk-tools-addae04c266401cf049f1188917bf3432873933c.tar.gz apk-tools-addae04c266401cf049f1188917bf3432873933c.tar.bz2 apk-tools-addae04c266401cf049f1188917bf3432873933c.tar.xz apk-tools-addae04c266401cf049f1188917bf3432873933c.zip |
db, audit: audit symlinks (by hash of the link target)
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r-- | src/apk_blob.h | 13 |
1 files changed, 7 insertions, 6 deletions
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}) |