@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
$(obj)cscope.* $(obj)*.*~
@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
- @rm -f $(obj)tools/{crc32.c,environment.c,env/crc32.c,sha1.c,inca-swap-bytes}
+ @rm -f $(obj)tools/{crc32.c,environment.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
@rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c}
@rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
@rm -f $(obj)cpu/mpc824x/bedbug_603e.c
#endif
#if defined(CONFIG_FIT)
+#include <md5.h>
#include <sha1.h>
static int fit_check_ramdisk (const void *fit, int os_noffset,
int verify);
#else
#include "mkimage.h"
+#include <md5.h>
#include <time.h>
#include <image.h>
#endif /* !USE_HOSTCC*/
(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;
#include <fdt.h>
#include <libfdt.h>
#include <fdt_support.h>
+#define CONFIG_MD5 /* FIT images need MD5 support */
#endif
/*
/environment.c
/gen_eth_addr
/img2srec
+/md5.c
/mkimage
/sha1.c
/ubsha1
BIN_FILES = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
-OBJ_LINKS = environment.o crc32.o sha1.o image.o
+OBJ_LINKS = environment.o crc32.o md5.o sha1.o image.o
OBJ_FILES = img2srec.o mkimage.o envcrc.o ubsha1.o gen_eth_addr.o bmp_logo.o
ifeq ($(ARCH),mips)
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
-$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)sha1.o $(LIBFDT_OBJ_FILES)
+$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)md5.o $(obj)sha1.o $(LIBFDT_OBJ_FILES)
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
$(obj)crc32.o: $(obj)crc32.c
$(CC) -g $(CFLAGS) -c -o $@ $<
+$(obj)md5.o: $(obj)md5.c
+ $(CC) -g $(CFLAGS) -c -o $@ $<
+
$(obj)sha1.o: $(obj)sha1.c
$(CC) -g $(CFLAGS) -c -o $@ $<
@rm -f $(obj)crc32.c
ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
+$(obj)md5.c:
+ @rm -f $(obj)md5.c
+ ln -s $(src)../lib_generic/md5.c $(obj)md5.c
+
$(obj)sha1.c:
@rm -f $(obj)sha1.c
ln -s $(src)../lib_generic/sha1.c $(obj)sha1.c