Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/util.h
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-11 20:16:42 -0500
committerDan McGee <dan@archlinux.org>2011-08-15 12:13:35 -0500
commitbd5ec9cd8e23bba4334a7b3a5a73843c3667c085 (patch)
tree76e6018d88a861a5cc16729d8274b3ceab7e3ccb /lib/libalpm/util.h
parentf37c5016572fecb16cc53d5e3fdd059944e36359 (diff)
Validate the sha256sum if available
Adjust load_internal() to check the sha256sum value if we have it. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/util.h')
-rw-r--r--lib/libalpm/util.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index 9ee63709..921ed459 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -91,6 +91,11 @@ struct archive_read_buffer {
int ret;
};
+enum _alpm_csum {
+ ALPM_CSUM_MD5,
+ ALPM_CSUM_SHA256,
+};
+
int _alpm_makepath(const char *path);
int _alpm_makepath_mode(const char *path, mode_t mode);
int _alpm_copyfile(const char *src, const char *dest);
@@ -109,7 +114,7 @@ int _alpm_str_cmp(const void *s1, const void *s2);
char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);
const char *_alpm_filecache_setup(alpm_handle_t *handle);
int _alpm_lstat(const char *path, struct stat *buf);
-int _alpm_test_md5sum(const char *filepath, const char *md5sum);
+int _alpm_test_checksum(const char *filepath, const char *expected, enum _alpm_csum type);
int _alpm_archive_fgets(struct archive *a, struct archive_read_buffer *b);
int _alpm_splitname(const char *target, char **name, char **version,
unsigned long *name_hash);