From nobody@FreeBSD.org  Thu Mar 29 17:36:24 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 29BCD106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 Mar 2012 17:36:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 140E38FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 Mar 2012 17:36:24 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q2THaNhC033614
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 Mar 2012 17:36:23 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q2THaN3H033613;
	Thu, 29 Mar 2012 17:36:23 GMT
	(envelope-from nobody)
Message-Id: <201203291736.q2THaN3H033613@red.freebsd.org>
Date: Thu, 29 Mar 2012 17:36:23 GMT
From: Mike Kelly <pioto@pioto.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: crypt(3) man page incorrectly documents modular crypt numbers for SHA256, SHA512
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         166497
>Category:       docs
>Synopsis:       [patch] crypt(3) man page incorrectly documents modular crypt numbers for SHA256, SHA512
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 29 17:40:13 UTC 2012
>Closed-Date:    Tue Apr 24 01:58:19 UTC 2012
>Last-Modified:  Tue Apr 24 01:58:19 UTC 2012
>Originator:     Mike Kelly
>Release:        9.0-RELEASE
>Organization:
>Environment:
FreeBSD nas.home.pioto.org 9.0-RELEASE FreeBSD 9.0-RELEASE #5: Tue Jan 17 00:17:39 EST 2012     root@nas.home.pioto.org:/usr/obj/usr/src/sys/NAS  i386

>Description:
The man page, as currently written, seems to imply that FreeBSD uses $4$ for SHA-256, and $5$ for SHA-512. The section in question currently renders as:

     Currently supported algorithms are:

           1.   MD5
           2.   Blowfish
           3.   NT-Hash
           4.   SHA-256
           5.   SHA-512

That would be different from what Linux uses, and would be a point of potential confusion. That isn't the case, however; the code confirms that things match up with Linux:

  lib/libcrypt/crypt-sha256.c:48:static const char sha256_salt_prefix[] = "$5$";
  lib/libcrypt/crypt-sha512.c:48:static const char sha512_salt_prefix[] = "$6$";

So, rather than using what seems to be an auto-numbering formatting in the man page, things should be enumerated explicitly. Or, maybe, some placeholder like "RESERVED" or "UNUSED" should be put into the fourth spot in the list.
>How-To-Repeat:
$ man 3 crypt
>Fix:
diff --git a/lib/libcrypt/crypt.3 b/lib/libcrypt/crypt.3
index d3f89e2..724d482 100644
--- a/lib/libcrypt/crypt.3
+++ b/lib/libcrypt/crypt.3
@@ -189,6 +189,8 @@ Blowfish
 .It
 NT-Hash
 .It
+(Reserved for future use)
+.It
 SHA-256
 .It
 SHA-512


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Fri Mar 30 02:58:36 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166497 
State-Changed-From-To: open->analyzed 
State-Changed-By: eadler 
State-Changed-When: Fri Mar 30 03:09:42 UTC 2012 
State-Changed-Why:  
awaiting review 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166497 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/166497: commit references a PR
Date: Wed, 11 Apr 2012 14:12:43 +0000 (UTC)

 Author: eadler
 Date: Wed Apr 11 14:12:28 2012
 New Revision: 234132
 URL: http://svn.freebsd.org/changeset/base/234132
 
 Log:
   Make the item numbers match the crypt magic number
   
   PR:		docs/166497
   Submitted by:	Mike Kelly <pioto@pioto.org>
   Approved by:	cperciva
   MFC after:	1 week
 
 Modified:
   head/lib/libcrypt/crypt.3
 
 Modified: head/lib/libcrypt/crypt.3
 ==============================================================================
 --- head/lib/libcrypt/crypt.3	Wed Apr 11 14:08:09 2012	(r234131)
 +++ head/lib/libcrypt/crypt.3	Wed Apr 11 14:12:28 2012	(r234132)
 @@ -187,6 +187,8 @@ Blowfish
  .It
  NT-Hash
  .It
 +(unused)
 +.It
  SHA-256
  .It
  SHA-512
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: analyzed->patched 
State-Changed-By: eadler 
State-Changed-When: Wed Apr 11 14:21:23 UTC 2012 
State-Changed-Why:  
committed in r234132 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166497 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Apr 24 01:58:18 UTC 2012 
State-Changed-Why:  
MFCed 

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