Commit Graph

6 Commits

Author SHA1 Message Date
Xin LI
c721d4192e libcrypt: There is no need to clear message digest context after they
are finialized after r336539, so do not do it.

Submitted by:	David CARLIER <devnexen gmail com>
MFC after:	1 month (after r336539)
Differential Revision:	https://reviews.freebsd.org/D16059
2018-07-20 07:16:28 +00:00
Xin LI
a7e92a77da Get rid of unused variables.
copied_key and copied_salt are assigned with NULL and never used
otherwise. Remove the two variables and related code.

Reviewed by:	pfg
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16314
2018-07-20 07:07:27 +00:00
Pedro F. Giffuni
5e53a4f90f lib: further adoption of SPDX licensing ID tags.
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.
2017-11-26 02:00:33 +00:00
Ed Schouten
5f521d7ba7 Make libcrypt thread-safe. Add crypt_r(3).
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
2016-08-10 15:16:28 +00:00
David E. O'Brien
ad45dd4174 s/shaN_crypt/crypt_shaN/g to be a more consistent with the existing naming.
Reviewed by:	markm
2011-05-05 01:09:42 +00:00
Mark Murray
3d6f63c046 Add SHA256/512 ($5$ and $6$) to crypt(3). Used in linux-world, doesn't
hurt us.

PR:		misc/124164
Submitted by:	KIMURA Yasuhiro < yasu utahime org >
MFC after:	1 month
2011-04-09 14:02:04 +00:00