apps/md5: fix md5 result error
MIRTOS-325 Change-Id: I0dd6c3e155b8fe41fe8ea6859271168a0d283829 Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
681da55d4a
commit
89e6fb9a42
@ -257,7 +257,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc,
|
|||||||
static const unsigned char hexchars[] = "0123456789abcdef";
|
static const unsigned char hexchars[] = "0123456789abcdef";
|
||||||
MD5_CTX ctx;
|
MD5_CTX ctx;
|
||||||
unsigned char mac[16];
|
unsigned char mac[16];
|
||||||
FAR char *src;
|
FAR unsigned char *src;
|
||||||
FAR char *dest;
|
FAR char *dest;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
md5_final(mac, &ctx);
|
md5_final(mac, &ctx);
|
||||||
src = (FAR char *)&mac;
|
src = mac;
|
||||||
dest = destbuf;
|
dest = destbuf;
|
||||||
for (i = 0; i < 16; i++, src++)
|
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);
|
func(srcbuf, srclen, (char *)&ctx, &buflen, 0);
|
||||||
md5_final(mac, &ctx);
|
md5_final(mac, &ctx);
|
||||||
src = (char *)&mac;
|
src = mac;
|
||||||
dest = destbuf;
|
dest = destbuf;
|
||||||
for (i = 0; i < 16; i++, src++)
|
for (i = 0; i < 16; i++, src++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user