From nobody@FreeBSD.ORG  Fri Jan 21 12:09:32 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id ADDED154E7; Fri, 21 Jan 2000 12:09:32 -0800 (PST)
Message-Id: <20000121200932.ADDED154E7@hub.freebsd.org>
Date: Fri, 21 Jan 2000 12:09:32 -0800 (PST)
From: racker75@hotmail.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Crypt() function returns wierd results
X-Send-Pr-Version: www-1.0

>Number:         16278
>Category:       misc
>Synopsis:       Crypt() function returns wierd results
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 21 12:10:07 PST 2000
>Closed-Date:    Mon Jun 26 03:39:40 PDT 2000
>Last-Modified:  Mon Jun 26 03:41:09 PDT 2000
>Originator:     David Hasson
>Release:        3.3-RELEASE
>Organization:
>Environment:
FreeBSD jkmiller.ath.cx 3.3-RELEASE FreeBSD 3.3-RELEASE #0: Sun Nov 28 21:12:3
9 PST 1999     funtaff@nimrod.ath.cx:/usr/src/sys/compile/NITWIT  i386 
>Description:
    Using perl, crypt() returns long, unintelligable values.  For example, the perl installed with 3.3-RELEASE produces these results:
     $salt = 'fs';
     $pass = 'heynow';
     $out = crypt($salt, $pass);
     print "$out\n"; 
returns this:
bash-2.03$ perl test3.pl
$1$heynow$0jPK61iCt92vyGs2ciUUa.

I do not know the cause of this, or how it can be fixed, it seems to be dependent on this particular machine.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Daniel Hagan <dhagan@cs.vt.edu>
To: freebsd-gnats-submit@freebsd.org
Cc: racker75@hotmail.com
Subject: Re: misc/16278: Perl crypt() returns bogus data?
Date: Wed, 8 Mar 2000 10:00:08 -0500 (EST)

 > Using perl, crypt() returns long, unintelligable values.  For example,
 > the perl installed with 3.3-RELEASE produces these results:
 >         $salt = 'fs';
 >         $pass = 'heynow';
 >         $out = crypt($salt, $pass);
 >         print "$out\n"; 
 >    returns this:
 >    bash-2.03$ perl test3.pl
 >    $1$heynow$0jPK61iCt92vyGs2ciUUa.
 
 man crypt(3) shows that crypt expects crypt(password, salt), not
 vice-versa.  If you switch the arguments you will probably get the correct
 result.  Also, I believe the $1$ at the start indicates that this is a MD5
 password, and thus won't necessarily match other crypt() calls (on other
 UNIXs).
 
 Daniel
 
 -- 
 Daniel Hagan                                             Computer Science CSE
 dhagan@cs.vt.edu                                http://www.cs.vt.edu/~dhagan/
 
 
State-Changed-From-To: open->closed 
State-Changed-By: nbm 
State-Changed-When: Mon Jun 26 03:39:40 PDT 2000 
State-Changed-Why:  
Explanation should be sufficient, and no feedback was received. 
Testing indicates that the current behaviour is correct on both 3.4 and 
4.0. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=16278 
>Unformatted:
