On Mon, Jul 18, 2011 at 2:41 PM, Patrick Donnelly <batr...@batbytes.com> wrote:
> Why does this command prepend useless redundant information?
>
> $ openssl md5 <(echo foo)
> MD5(/dev/fd/63)= d3b07384d113edec49eaa6238ad5ff00

--snip--

> Thank you *so* much. I would have framed this email more politely but
> you have successfully punted compatibility detection onto third party
> developers. There is no way for you to fix it.

I'm not an OpenSSL developer, but I can field this one because the
answer is fairly obvious.

To answer your initial question, consider the case of "$ openssl md5
*.txt", where each line needs to have that information. The new format
makes the output consistent regardless of manner of implementation,
which from a future-proofing standpoint makes more sense than changing
the output depending on the precise manner of input.

My question is why you're depending on the output format of "openssl
md5" in the first place. md5sum is almost as commonly available and is
much more amenable to shell scripting, and if you're not doing shell
scripting the output is irrelevant because you could be using OpenSSL
as a library.

Regardless, this is a simple change, and a simple awk or sed script
will solve the problem while retaining compatibility with older
versions. Perhaps:

openssl md5 < blah | sed "s/^.*= *//"

will serve. (This says, "if the line starts with an arbitrary number
of characters, followed by an equals sign, followed by zero or more
whitespace, remove that.")

/s/ Adam
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to