From 89e6fb9a42f917b19e256d5b8e60881bd4bf0664 Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 11 Jan 2021 14:34:58 +0800 Subject: [PATCH] apps/md5: fix md5 result error MIRTOS-325 Change-Id: I0dd6c3e155b8fe41fe8ea6859271168a0d283829 Signed-off-by: ligd --- nshlib/nsh_codeccmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nshlib/nsh_codeccmd.c b/nshlib/nsh_codeccmd.c index 4b70a9054..b3944b80d 100644 --- a/nshlib/nsh_codeccmd.c +++ b/nshlib/nsh_codeccmd.c @@ -257,7 +257,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, static const unsigned char hexchars[] = "0123456789abcdef"; MD5_CTX ctx; unsigned char mac[16]; - FAR char *src; + FAR unsigned char *src; FAR char *dest; #endif @@ -443,7 +443,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, int i; md5_final(mac, &ctx); - src = (FAR char *)&mac; + src = mac; dest = destbuf; for (i = 0; i < 16; i++, src++) { @@ -481,7 +481,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, func(srcbuf, srclen, (char *)&ctx, &buflen, 0); md5_final(mac, &ctx); - src = (char *)&mac; + src = mac; dest = destbuf; for (i = 0; i < 16; i++, src++) {