Commit Graph

63 Commits

Author SHA1 Message Date
trhodes
a8313c70dc crypt(3) incorrectly documents md5 salt, fixed.
PR:	36782
No objections from:	ru
MFC after:	3 days
2002-04-09 22:32:59 +00:00
phk
c72b8aad84 Fix grammer in comment.
Submitted by:	Engin Gunduz <engin@ripe.net>
2002-03-25 15:55:36 +00:00
phk
df20e39c54 Modernize my email-address. 2002-03-25 13:48:53 +00:00
markm
eea532a9e2 Darn. There is (now was) a signed/unsigned issue that resulted in a
very long loop.

Reported by:	nnd@mail.nsk.ru (Nickolay Dudorov)
2002-03-07 10:41:11 +00:00
markm
6e51e3575d No functional change, but big code cleanup. WARNS, lint(1) and style(9). 2002-03-06 17:18:09 +00:00
ru
17b960c086 s/crypt_format/crypt_default/ to match reality.
PR:		docs/32787
Spotted by:	Pete Carah <pete@altadena.net>
2001-12-13 08:05:32 +00:00
ru
727c2b4b9e mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
dillon
d375fe96be Implement __FBSDID() 2001-09-16 21:35:07 +00:00
markm
c8efe5c4e4 Remove out-of-date "cannot be exported from USA" notice. 2001-08-15 20:25:16 +00:00
ru
325db7b385 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
dd
c49a4e6620 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
29353320f4 mdoc(7) police: removed punctuation after the last SEE ALSO xref. 2001-07-10 18:00:19 +00:00
ru
940dc0c680 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
dd
978810079e mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
dd
520fa8f9e1 Remove duplicate words. 2001-06-24 01:34:38 +00:00
ru
f85a17a1d7 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
peter
106b391465 Help standalone builds by getting libutil.h from src/lib/libutil 2001-03-21 22:54:59 +00:00
ru
df6d18791c mdoc(7) police: ``It'' macro does not take argument in -enum lists.
(In -mdocNG, this only causes warning.  In current implementation,
it is fatal.)

Pointy hat to:	markm (for not checking stderr)
2001-03-16 12:06:26 +00:00
markm
a4013287b2 Add OpenBSD-style blowfish password hashing. This makes one less
gratuitous difference between us and our sister project.

This was given to me _ages_ ago. May apologies to Paul for the length
of time its taken me to commit.

Obtained from:	Niels Provos <provos@physnet.uni-hamburg.de>/OpenBSD
Submitted by:	Paul Herman <pherman@frenchfries.net>
2001-03-11 16:05:43 +00:00
ru
fb54000812 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
peter
0c7e19fc4f Reflect rev 1.18 in crypt.c. Note that this section is somewhat
mangled and could do with some word-smithing.
2000-12-28 11:56:45 +00:00
peter
0b9e6a5d50 Hindsight is wonderful, but I got cold feet over the crypt(3) default
so I am backing it out for now.  The problem is that some random program
calling crypt() could be passing a DES salt and the crypt(3) library
would encrypt it in md5 mode and there would be a password mismatch as a
result.  I wrote a validater function for the DES code to verify that
a salt is valid for DES, but I realized there were too many strange things
to go wrong.  passwd(1), pw(8) etc still generate md5 passwords by default
for /etc/master.passwd, so this is almost academic.  It is a big deal for
things that have their own crypt(3)-ed password strings (.htaccess,
etc etc).  Those are the things I do not want to break.

My DES salt recognizer basically checked if the salt was either 2 or
13 characters long, or began with '_' (_PASSWORD_EFMT1).  I think it
would have worked but I have seen way too much crypt() mishandling
in the past.
2000-12-28 11:23:01 +00:00
peter
f08ea7f1a7 Merge into a single US-exportable libcrypt, which only provides
one-way hash functions for authentication purposes.  There is no more
"set the libcrypt->libXXXcrypt" nightmare.
- Undo the libmd.so hack, use -D to hide the md5c.c internals.
- Remove the symlink hacks in release/Makefile
- the algorthm is set by set_crypt_format() as before.  If this is
  not called, it tries to heuristically figure out the hash format, and
  if all else fails, it uses the optional auth.conf entry to chose the
  overall default hash.
- Since source has non-hidden crypto in it there may be some issues with
  having the source it in some countries, so preserve the "secure/*"
  division.  You can still build a des-free libcrypt library if you want
  to badly enough.  This should not be a problem in the US or exporting
  from the US as freebsd.org had notified BXA some time ago.  That makes
  this stuff re-exportable by anyone.
- For consistancy, the default in absence of any other clues is md5.  This
  is to try and minimize POLA across buildworld where folk may suddenly
  be activating des-crypt()-hash support.  Since the des hash may not
  always be present, it seemed sensible to make the stronger md5 algorithm
  the default.
All things being equal, no functionality is lost.

Reviewed-by: jkh

(flame-proof suit on)
2000-12-28 10:32:02 +00:00
ru
e39a2d7511 log 2000-11-22 09:23:54 +00:00
green
176f2754e5 Still have to support libscrypt for now :( Add #defines to take DES
out for it.
2000-08-24 17:51:16 +00:00
green
69497b6ee9 How did you sneak in... 2000-08-22 02:17:54 +00:00
green
83520f8d05 Add working and easy crypt(3)-switching. Yes, we need a whole new API
for crypt(3) by now.  In any case:

Add crypt_set_format(3) + documentation to -lcrypt.
Add login_setcryptfmt(3) + documentation to -lutil.
Support for switching crypt formats in passwd(8).
Support for switching crypt formats in pw(8).

The simple synopsis is:
edit login.conf; add a passwd_format field set to "des" or "md5"; go nuts :)

Reviewed by:	peter
2000-08-22 02:15:54 +00:00
kris
30893e89bc Oops, remove vestigial reference to SHS passwords. 2000-04-22 20:43:21 +00:00
phantom
abfff559bb Introduce .Lb macro to libcrypt manpage.
Make it more mdoc(7) compliant:
. use .Tn for DES, MD5 andSHS.
. Replace double quotes with .Dq macro
. use An/Aq scheme for listing authors
2000-04-22 15:56:59 +00:00
markm
1952bf99b7 A bunch of factual corrections. 2000-01-18 18:23:28 +00:00
bde
efbbc84445 Fixed missing include in synopsis. 2000-01-13 10:21:25 +00:00
kris
23e8d50b7b Zap SHA1 password support. This will be re-implemented at a later date. 2000-01-07 06:33:54 +00:00
bde
85c0e71e46 Fixed a formatting error in the prototype for crypt(). 1999-12-23 16:53:18 +00:00
peter
b2618f2f4a Make a dlopen failure consistant with dlsym(). "Shouldn't happen." 1999-12-17 20:21:45 +00:00
peter
4335b2986a patch glitch 1999-12-17 20:19:28 +00:00
peter
5dc96ca037 Remove -lmd. Use dlopen() and dlsym() instead for calls to the MD5* and
SHA* routines so that callers of libcrypt are not exposed to the internal
implementation.
1999-12-17 20:04:01 +00:00
markm
f464febb3b Never return NULL, always return a hash.
Submitted by:	dt
1999-09-22 06:53:08 +00:00
dt
8a7ea1c51d Someone changed major numbers of the libraries from 2 to 3 for 0 (zero) reasons.
Revert the major number back to 2.

libcrypt only export one function, before the recent changes and now:
char *crypt(const char *key, const char *salt);
The prototype didn't changed. Internal representation of `char' and `char *'
didn't changed. Therefore, there is no reason to change the version number.
1999-09-21 17:52:05 +00:00
peter
ac86ac7d86 Somebody deleted the SONAME override causing the symlink to be expanded
at link time and the target name compiled into the binaries.  ie:
everything used libscrypt or libdescrypt explicitly.
1999-09-21 14:44:27 +00:00
markm
7baa7108b2 Big code cleanup. (Inspired by Brandon Gillespie). Also move as
much as possible away from secure/ to make extending easier.
1999-09-20 12:45:49 +00:00
peter
51ddb038ec $Header$ -> $FreeBSD$ 1999-08-28 05:11:36 +00:00
peter
e226894fa0 $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
bde
746eca4c88 Simplified using new SYMLINKS macro, mainly to test this macro. The
ifdefs are too ugly for this to be much of a simplification.  The
existence tests are even uglier now.  Note that the previous commit
was not submitted by me.  It missed the point and just added a second
layer of unused removals.

Fixed hard-coded "libcrypt"s.  The LCRYPTBASE macro mainly makes
things hard to read, but use it while we have it.
1999-03-23 03:41:09 +00:00
markm
0b9c694ce8 Fix symlinking. Without the -f "force" option, the wrong version
can be found.
Submitted by:   Bruce
1999-01-24 07:51:33 +00:00
markm
a9be9f5f6f The new crypt code broke "make world". Back it out. 1999-01-23 08:27:46 +00:00
brandon
0232f0f67d Moved from the old secure/lib/libcrypt area, because of the rewrite to how
the Makefile handles des support by just including the single .c file.

Reviewed by:	Mark Murray
1999-01-21 13:51:04 +00:00
brandon
e0dac0b506 Rewrite of crypt library to be more modular, and addition of the
Secure Hashing Algorithm - 1 (SHA-1), along with the further
refinement of what $x$salt$hash means.  With this new crypt the
following are all acceptable:

    $1$
    $MD5$
    $SHA1$

Note: $2$ is used by OpenBSD's Blowfish, which I considered adding
as $BF$, but there is no actual need for it with SHA-1.  However,
somebody wishing to add OpenBSD password support could easilly add
it in now.

There is also a malloc_crypt() available in the library now, which
behaves exactly the same as crypt(), but it uses a malloced buffer
instead of a static buffer.  However, this is not standard so will
likely not be used much (at all).

Also, for those interested I did a brief speed test Pentium 166/MMX,
which shows the DES crypt to do approximately 2640 crypts a CPU second,
MD5 to do about 62 crypts a CPU second and SHA1 to do about 18 crypts
a CPU second.

Reviewed by:	Mark Murray
1999-01-21 13:50:09 +00:00
bde
eff2f51f58 Fixed the elf case of the creation of the libcrypt.so -> libscrypt->so
link.  Shared libraries are in ${SHLIBDIR}, not necessarily in ${LIBDIR}.
1998-09-02 15:09:15 +00:00
jb
e678529bc8 BINFORMAT -> OBJFORMAT ready for E-day. 1998-08-30 02:52:04 +00:00
jb
ad07d4a0af BINFORMAT -> OBJFORMAT ready for E-day. 1998-08-30 01:57:55 +00:00