From owner-freebsd-hackers Wed Sep 24 16:58:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA08879 for hackers-outgoing; Wed, 24 Sep 1997 16:58:46 -0700 (PDT) Received: from usr03.primenet.com (tlambert@usr03.primenet.com [206.165.6.203]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA08854 for ; Wed, 24 Sep 1997 16:58:41 -0700 (PDT) Received: (from tlambert@localhost) by usr03.primenet.com (8.8.5/8.8.5) id QAA29468; Wed, 24 Sep 1997 16:58:37 -0700 (MST) From: Terry Lambert Message-Id: <199709242358.QAA29468@usr03.primenet.com> Subject: Re: crypt() returning an error... To: brandon@roguetrader.com (Brandon Gillespie) Date: Wed, 24 Sep 1997 23:58:37 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: from "Brandon Gillespie" at Sep 24, 97 12:06:29 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > The man page on crypt() states that a NULL will be returned instead of a > pointer to a string, if an error occurred. The MD5 crypt does not follow > this, however DES crypt does. Furthermore, in the attempt to hunt out a > 'standard' for handling error codes, I have checked how other crypt() > implementations function. OpenBSD for some unknown reason returns the > string: > > ":" > > Where Digital Unix also returns a NULL, as does Unixware--however their > manual pages do not specify NULL as a valid return value. Forget that; we want to know how you are making a straight MD5 hash cause an error in the first place... 8-) 8-). > crypt("", "") > > With MD5 will actually return an encrypted value, with a zero-length salt. > After my changes, this will return a NULL instead. > > Anybody forsee any problems with this? I do not, but I figured I would > bring it up... You should wrapper this; I don't know if "crypt" is enough of a wrapper. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.