summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBartlomiej Sieka <tur@semihalf.com>2008-03-14 16:22:34 +0100
committerBartlomiej Sieka <tur@semihalf.com>2008-03-14 16:22:34 +0100
commit766529fccc860ecb9e955b4239dff69cd9e4ea09 (patch)
tree8fab1a4b93df22aa183d6f049ecf99c876e35ffc /common
parent0ede0c383530a418cf98be9122371a86573cd0db (diff)
downloadu-boot-imx-766529fccc860ecb9e955b4239dff69cd9e4ea09.zip
u-boot-imx-766529fccc860ecb9e955b4239dff69cd9e4ea09.tar.gz
u-boot-imx-766529fccc860ecb9e955b4239dff69cd9e4ea09.tar.bz2
Add MD5 support to the new uImage format
Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
Diffstat (limited to 'common')
-rw-r--r--common/image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/image.c b/common/image.c
index a2a739e..6508df9 100644
--- a/common/image.c
+++ b/common/image.c
@@ -54,6 +54,7 @@
#endif
#if defined(CONFIG_FIT)
+#include <md5.h>
#include <sha1.h>
static int fit_check_ramdisk (const void *fit, int os_noffset,
@@ -70,6 +71,7 @@ static image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch,
int verify);
#else
#include "mkimage.h"
+#include <md5.h>
#include <time.h>
#include <image.h>
#endif /* !USE_HOSTCC*/
@@ -1940,8 +1942,8 @@ static int calculate_hash (const void *data, int data_len, const char *algo,
(unsigned char *) value);
*value_len = 20;
} else if (strcmp (algo, "md5") == 0 ) {
- printf ("MD5 not supported\n");
- *value_len = 0;
+ md5 ((unsigned char *)data, data_len, value);
+ *value_len = 16;
} else {
debug ("Unsupported hash alogrithm\n");
return -1;