summaryrefslogtreecommitdiffstats
path: root/src/apk_blob.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r--src/apk_blob.h13
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})