You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "0528Mike (via GitHub)" <gi...@apache.org> on 2023/09/19 08:23:56 UTC

[GitHub] [nuttx-apps] 0528Mike opened a new pull request, #2075: nshlib: Implementation of modifying command md5

0528Mike opened a new pull request, #2075:
URL: https://github.com/apache/nuttx-apps/pull/2075

   ## Summary
   Simplify the "cmd_codecs_proc" md5 related framework and modify the implementation of the command md5:
   ## Impact
   None
   ## Testing
   None
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx-apps] xiaoxiang781216 merged pull request #2075: nshlib: Add FAR Keyword to command md5

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #2075:
URL: https://github.com/apache/nuttx-apps/pull/2075


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #2075: nshlib: Implementation of modifying command md5

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #2075:
URL: https://github.com/apache/nuttx-apps/pull/2075#discussion_r1330550504


##########
nshlib/nsh_codeccmd.c:
##########
@@ -572,7 +495,29 @@ int cmd_base64decode(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
 #ifdef HAVE_CODECS_HASH_MD5
 int cmd_md5(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
 {
-  return cmd_codecs_proc(vtbl, argc, argv, CODEC_MODE_HASH_MD5, md5_cb);
+  int i;
+  int ret = OK;
+  unsigned char digest[16];
+
+  if (argc == 3 && !strncmp(argv[1], "-f", 2))
+    {
+      ret = md5_file(argv[2], digest);
+      if (ret < 0)
+        {
+          return ret;
+        }
+    }
+  else
+    {
+      md5_sum((unsigned char *)argv[1], strlen(argv[1]), digest);

Review Comment:
   ```suggestion
         md5_sum((FAR unsigned char *)argv[1], strlen(argv[1]), digest);
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org