Browse Source

文件被覆盖,重新提交

guohui 1 year ago
parent
commit
2e61a91f72
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pro/src/upg.c

+ 2 - 1
pro/src/upg.c

@@ -495,6 +495,7 @@ typedef union {
 		uint16_t        size;
 		uint32_t        partition;
 		uint32_t		version;
+        char            md5[32];
 	}hdr;
 	uint8_t				padd[128];
 }fw_hdr_t;
@@ -528,7 +529,7 @@ static int md5_check(buf_t *fb)
     fw_hdr_t *hdr=(fw_hdr_t*)fb->buf;
 
     md5_init(&ctx);
-    md5_update(&ctx, (uint8_t*)fb->buf+sizeof(fw_hdr_t), fb->dlen-hdr->size);
+    md5_update(&ctx, (uint8_t*)fb->buf+sizeof(fw_hdr_t), fb->dlen-hdr->hdr.size);
     md5_final(&ctx, tmp);
 
     for (i=0; i<16; i++) {