[PATCH] commands: add md5/sha1/sha256sum commands using the digest api

Peter Korsgaard jacmet at sunsite.dk
Tue May 17 16:05:34 EDT 2011

>>>>> "Sascha" == Sascha Hauer <s.hauer at pengutronix.de> writes:


 >> commands/mem.c: buf = xmalloc(RW_BUF_SIZE);

 Sascha> And I am perfectly fine with this at least for fixed small length
 Sascha> allocations. And I consider 4096 bytes small enough.

Ok, good.

 >> Maybe. I wanted something automatic rather than a series of strcmp
 >> checks, but feel free to suggest something else.

 Sascha> You could use three different functions called by the command
 Sascha> descriptors and pass a string with the digest name to do_digest.

Ok, will change.

 Jean-Christophe> do we really need to stop if ine of them is not availlable

 >> I don't feel strongly about it, but it seems the simplest solution.

 Sascha> How about printing an error and continue? That's what my host md5sum
 Sascha> does.

Ok, will change.

 Jean-Christophe> and we should check the getc to be able to interrupt it
 >> crc doesn't do that either, but ok - I can add a ctrlc() check in the
 >> main loop.

 Sascha> It's good practice. It's nice being able to interrupt if this
 Sascha> command is accidently being called on a veray large file.

Ok, will change.

I'll send a v2 shortly.

Bye, Peter Korsgaard

More information about the barebox mailing list