Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2001 08:10:02 -0700 (PDT)
From:      Dima Dorfman <dima@unixfreak.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/28988: We need more simple message digesting tools 
Message-ID:  <200107191510.f6JFA2Y32641@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/28988; it has been noted by GNATS.

From: Dima Dorfman <dima@unixfreak.org>
To: Peter Pentchev <roam@orbitel.bg>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/28988: We need more simple message digesting tools 
Date: Thu, 19 Jul 2001 08:05:49 -0700

 Peter Pentchev <roam@orbitel.bg> writes:
 > The following reply was made to PR bin/28988; it has been noted by GNATS.
 > 
 > From: Peter Pentchev <roam@orbitel.bg>
 > To: Anders Nordby <anders@fix.no>
 > Cc: freebsd-gnats-submit@FreeBSD.org
 > Subject: Re: bin/28988: We need more simple message digesting tools
 > Date: Thu, 19 Jul 2001 17:05:00 +0300
 > 
 >  On Thu, Jul 19, 2001 at 04:30:30AM -0700, Anders Nordby wrote:
 >  > The following reply was made to PR bin/28988; it has been noted by GNATS.
 >  > 
 >  > From: Anders Nordby <anders@fix.no>
 >  > To: Dima Dorfman <dima@unixfreak.org>
 >  > Cc: FreeBSD-gnats-submit@freebsd.org
 >  > Subject: Re: bin/28988: We need more simple message digesting tools
 >  > Date: Thu, 19 Jul 2001 13:28:57 +0200
 >  > 
 >  >  On Mon, Jul 16, 2001 at 10:20:00PM -0700, Dima Dorfman wrote:
 >  >  >> md5(1) is just a frontend for libmd. If I make md5(1) use
 >  >  >> libcrypto instead, would that be better?
 >  >  > Why?  What's wrong with:
 >  >  > 
 >  >  > 	ln -s /usr/bin/openssl md5
 >  >  
 >  >  The fact that md5 dgst -sha1 does not make sence, and that md5(1) is
 >  >  expected to output differently and have other options.
 >  
 >  It doesn't work, either.  If openssl is invoked with an algorithm name,
 >  it accepts only filenames, not commands/options.  Thus, it preserves
 >  md5(1)'s syntax (at least in this respect).
 >  
 >  
 >  [roam@edge:p1 /usr/src]$ ln -s /usr/bin/openssl /usr/tmp/md5
 >  [roam@edge:p1 /usr/src]$ /usr/tmp/md5 /etc/passwd
 >  MD5(/etc/passwd)= dbcf40cb4677824638143626b514ad4e
 >  [roam@edge:p1 /usr/src]$ /usr/tmp/md5 dgst -sha1 /etc/passwd
 >  dgst: No such file or directory
 >  -sha1: No such file or directory
 >  MD5(/etc/passwd)= dbcf40cb4677824638143626b514ad4e
 >  [roam@edge:p1 /usr/src]$
 
 Actually, it does accept arguments.  Just not the same way openssl(1)
 does.  'dgst' is the actual program name inside OpenSSL; you can think
 of 'openssl md5' as being a symlink to 'openssl dgst md5'.  When you
 make a real symlink called 'md5' to /usr/bin/openssl, you're actually
 making a symlink to the 'dgst' program, which is embedded inside
 openssl(1).  You can't run other embedded programs, but you can switch
 algorithms.  Observe:
 
 	dima@hornet% ln -s /usr/bin/openssl md5
 	dima@hornet% ./md5 /HORNET
 	MD5(/HORNET)= e3823deaea6ac04928da26c118a36149
 	dima@hornet% ./md5 -sha1 /HORNET
 	SHA1(/HORNET)= 01539871ab3ece58b874bf47be652508a1e11649
 
 That said, I fail to see why this is a problem.
 
 >  (And before phk jumps at me, yes, I know that libmd was introduced waay
 >  before libcrypto made it into the source tree, and yes, I know that they
 >  have slightly different functionality - actually I even contributed some
 >  of that difference, remember? :P  .. and no, I'm not the one advocating
 >  libmd replacement with libcrypto, just stating that some people are :)
 
 I don't know if you think I'm one of these people, but I really have
 no opinion on libmd.  As long as things are using it, I have no
 problem with it staying.  However, new things probably shouldn't be
 implemented using it.  In this case, openssl(1) is almost the perfect
 fit: what we need is *already* implemented.  Besides, when the XYZ
 hash becomes popular, chances are OpenSSL will implement it quickly;
 then, for us to have an xyz(1), all we'd have to do is create another
 symlink.  This is certainly better than implementing XYZ in libmd.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107191510.f6JFA2Y32641>