summaryrefslogtreecommitdiff
path: root/lib/libcrypt/crypt-md5.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-261-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* Make libcrypt thread-safe. Add crypt_r(3).Ed Schouten2016-08-101-28/+22
| | | | | | | | | | | | | | | | | | | | | | glibc has a pretty nice function called crypt_r(3), which is nothing more than crypt(3), but thread-safe. It accomplishes this by introducing a 'struct crypt_data' structure that contains a buffer that is large enough to hold the resulting string. Let's go ahead and also add this function. It would be a shame if a useful function like this wouldn't be usable in multithreaded apps. Refactor crypt.c and all of the backends to no longer declare static arrays, but write their output in a provided buffer. There is no need to do any buffer length computation here, as we'll just need to ensure that 'struct crypt_data' is large enough, which it is. _PASSWORD_LEN is defined to 128 bytes, but in this case I'm picking 256, as this is going to be part of the actual ABI. Differential Revision: https://reviews.freebsd.org/D7306 Notes: svn path=/head/; revision=303920
* Tidy the code up a fraction. Re-release with a 2-clause BSD licenseMark Murray2003-06-021-19/+33
| | | | | | | | | with the kind permission of the author/copyright holder. Thanks to: phk Notes: svn path=/head/; revision=115733
* Fix grammer in comment.Poul-Henning Kamp2002-03-251-1/+1
| | | | | | | Submitted by: Engin Gunduz <engin@ripe.net> Notes: svn path=/head/; revision=93157
* Modernize my email-address.Poul-Henning Kamp2002-03-251-1/+1
| | | | Notes: svn path=/head/; revision=93148
* Darn. There is (now was) a signed/unsigned issue that resulted in aMark Murray2002-03-071-4/+4
| | | | | | | | | very long loop. Reported by: nnd@mail.nsk.ru (Nickolay Dudorov) Notes: svn path=/head/; revision=91795
* No functional change, but big code cleanup. WARNS, lint(1) and style(9).Mark Murray2002-03-061-47/+47
| | | | Notes: svn path=/head/; revision=91754
* Implement __FBSDID()Matthew Dillon2001-09-161-4/+2
| | | | Notes: svn path=/head/; revision=83551
* Removed duplicate VCS ID tags, as per style(9).Ruslan Ermilov2001-08-131-3/+0
| | | | Notes: svn path=/head/; revision=81586
* Merge into a single US-exportable libcrypt, which only providesPeter Wemm2000-12-281-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=70419
* Make a dlopen failure consistant with dlsym(). "Shouldn't happen."Peter Wemm1999-12-171-1/+3
| | | | Notes: svn path=/head/; revision=54753
* Remove -lmd. Use dlopen() and dlsym() instead for calls to the MD5* andPeter Wemm1999-12-171-1/+44
| | | | | | | | SHA* routines so that callers of libcrypt are not exposed to the internal implementation. Notes: svn path=/head/; revision=54751
* Big code cleanup. (Inspired by Brandon Gillespie). Also move asMark Murray1999-09-201-0/+142
| | | | | | | much as possible away from secure/ to make extending easier. Notes: svn path=/head/; revision=51462
* The new crypt code broke "make world". Back it out.Mark Murray1999-01-231-120/+0
| | | | Notes: svn path=/head/; revision=43092
* Rewrite of crypt library to be more modular, and addition of theBrandon Gillespie1999-01-211-0/+120
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 Notes: svn path=/head/; revision=42981