xcrypt 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +106 -0
- data/ext/libxcrypt/AUTHORS +38 -0
- data/ext/libxcrypt/COPYING.LIB +502 -0
- data/ext/libxcrypt/ChangeLog +239 -0
- data/ext/libxcrypt/INSTALL +380 -0
- data/ext/libxcrypt/LICENSING +152 -0
- data/ext/libxcrypt/Makefile.am +704 -0
- data/ext/libxcrypt/Makefile.in +4110 -0
- data/ext/libxcrypt/NEWS +630 -0
- data/ext/libxcrypt/README +1 -0
- data/ext/libxcrypt/README.md +179 -0
- data/ext/libxcrypt/THANKS +13 -0
- data/ext/libxcrypt/TODO +1 -0
- data/ext/libxcrypt/TODO.md +100 -0
- data/ext/libxcrypt/aclocal.m4 +2617 -0
- data/ext/libxcrypt/autogen.sh +33 -0
- data/ext/libxcrypt/autom4te.cache/output.0 +19884 -0
- data/ext/libxcrypt/autom4te.cache/output.1 +19884 -0
- data/ext/libxcrypt/autom4te.cache/output.2 +19884 -0
- data/ext/libxcrypt/autom4te.cache/output.3 +19885 -0
- data/ext/libxcrypt/autom4te.cache/requests +714 -0
- data/ext/libxcrypt/autom4te.cache/traces.0 +4088 -0
- data/ext/libxcrypt/autom4te.cache/traces.1 +1060 -0
- data/ext/libxcrypt/autom4te.cache/traces.2 +4088 -0
- data/ext/libxcrypt/autom4te.cache/traces.3 +1060 -0
- data/ext/libxcrypt/build-aux/ci/ci-log-dependency-versions +79 -0
- data/ext/libxcrypt/build-aux/ci/ci-log-logfiles +22 -0
- data/ext/libxcrypt/build-aux/ci/clang-gcov-wrapper +2 -0
- data/ext/libxcrypt/build-aux/ci/configure-wrapper +10 -0
- data/ext/libxcrypt/build-aux/ci/summarize-coverage +24 -0
- data/ext/libxcrypt/build-aux/m4/ax_append_compile_flags.m4 +46 -0
- data/ext/libxcrypt/build-aux/m4/ax_append_flag.m4 +50 -0
- data/ext/libxcrypt/build-aux/m4/ax_check_compile_flag.m4 +53 -0
- data/ext/libxcrypt/build-aux/m4/ax_check_vscript.m4 +142 -0
- data/ext/libxcrypt/build-aux/m4/ax_gcc_func_attribute.m4 +246 -0
- data/ext/libxcrypt/build-aux/m4/ax_require_defined.m4 +37 -0
- data/ext/libxcrypt/build-aux/m4/ax_valgrind_check.m4 +239 -0
- data/ext/libxcrypt/build-aux/m4/libtool.m4 +8488 -0
- data/ext/libxcrypt/build-aux/m4/ltoptions.m4 +467 -0
- data/ext/libxcrypt/build-aux/m4/ltsugar.m4 +124 -0
- data/ext/libxcrypt/build-aux/m4/ltversion.m4 +24 -0
- data/ext/libxcrypt/build-aux/m4/lt~obsolete.m4 +99 -0
- data/ext/libxcrypt/build-aux/m4/pkg_compat.m4 +88 -0
- data/ext/libxcrypt/build-aux/m4/zw_alignment.m4 +90 -0
- data/ext/libxcrypt/build-aux/m4/zw_automodern.m4 +307 -0
- data/ext/libxcrypt/build-aux/m4/zw_detect_asan.m4 +24 -0
- data/ext/libxcrypt/build-aux/m4/zw_endianness.m4 +152 -0
- data/ext/libxcrypt/build-aux/m4/zw_ld_wrap.m4 +47 -0
- data/ext/libxcrypt/build-aux/m4/zw_prog_perl.m4 +40 -0
- data/ext/libxcrypt/build-aux/m4/zw_simple_warnings.m4 +150 -0
- data/ext/libxcrypt/build-aux/m4/zw_static_assert.m4 +68 -0
- data/ext/libxcrypt/build-aux/m4-autogen/compile +364 -0
- data/ext/libxcrypt/build-aux/m4-autogen/config.guess +1815 -0
- data/ext/libxcrypt/build-aux/m4-autogen/config.sub +2354 -0
- data/ext/libxcrypt/build-aux/m4-autogen/depcomp +792 -0
- data/ext/libxcrypt/build-aux/m4-autogen/install-sh +541 -0
- data/ext/libxcrypt/build-aux/m4-autogen/ltmain.sh +11524 -0
- data/ext/libxcrypt/build-aux/m4-autogen/missing +236 -0
- data/ext/libxcrypt/build-aux/m4-autogen/test-driver +160 -0
- data/ext/libxcrypt/build-aux/scripts/BuildCommon.pm +712 -0
- data/ext/libxcrypt/build-aux/scripts/check-perlcritic-config +76 -0
- data/ext/libxcrypt/build-aux/scripts/compute-symver-floor +116 -0
- data/ext/libxcrypt/build-aux/scripts/expand-selected-hashes +80 -0
- data/ext/libxcrypt/build-aux/scripts/gen-crypt-h +131 -0
- data/ext/libxcrypt/build-aux/scripts/gen-crypt-hashes-h +141 -0
- data/ext/libxcrypt/build-aux/scripts/gen-crypt-symbol-vers-h +150 -0
- data/ext/libxcrypt/build-aux/scripts/gen-libcrypt-map +67 -0
- data/ext/libxcrypt/build-aux/scripts/move-if-change +84 -0
- data/ext/libxcrypt/build-aux/scripts/skip-if-exec-format-error +78 -0
- data/ext/libxcrypt/codecov.yml +4 -0
- data/ext/libxcrypt/config.h.in +303 -0
- data/ext/libxcrypt/configure +19885 -0
- data/ext/libxcrypt/configure.ac +549 -0
- data/ext/libxcrypt/doc/crypt.3 +512 -0
- data/ext/libxcrypt/doc/crypt.5 +343 -0
- data/ext/libxcrypt/doc/crypt_checksalt.3 +106 -0
- data/ext/libxcrypt/doc/crypt_gensalt.3 +285 -0
- data/ext/libxcrypt/doc/crypt_gensalt_ra.3 +1 -0
- data/ext/libxcrypt/doc/crypt_gensalt_rn.3 +1 -0
- data/ext/libxcrypt/doc/crypt_preferred_method.3 +68 -0
- data/ext/libxcrypt/doc/crypt_r.3 +1 -0
- data/ext/libxcrypt/doc/crypt_ra.3 +1 -0
- data/ext/libxcrypt/doc/crypt_rn.3 +1 -0
- data/ext/libxcrypt/lib/alg-des-tables.c +3858 -0
- data/ext/libxcrypt/lib/alg-des.c +269 -0
- data/ext/libxcrypt/lib/alg-des.h +74 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-const.h +313 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-core.c +238 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-core.h +51 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-hmac.c +78 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-hmac.h +46 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-precalc.h +1426 -0
- data/ext/libxcrypt/lib/alg-gost3411-2012-ref.h +67 -0
- data/ext/libxcrypt/lib/alg-hmac-sha1.c +140 -0
- data/ext/libxcrypt/lib/alg-hmac-sha1.h +35 -0
- data/ext/libxcrypt/lib/alg-md4.c +270 -0
- data/ext/libxcrypt/lib/alg-md4.h +43 -0
- data/ext/libxcrypt/lib/alg-md5.c +291 -0
- data/ext/libxcrypt/lib/alg-md5.h +43 -0
- data/ext/libxcrypt/lib/alg-sha1.c +288 -0
- data/ext/libxcrypt/lib/alg-sha1.h +34 -0
- data/ext/libxcrypt/lib/alg-sha256.c +630 -0
- data/ext/libxcrypt/lib/alg-sha256.h +123 -0
- data/ext/libxcrypt/lib/alg-sha512.c +311 -0
- data/ext/libxcrypt/lib/alg-sha512.h +81 -0
- data/ext/libxcrypt/lib/alg-sm3-hmac.c +113 -0
- data/ext/libxcrypt/lib/alg-sm3-hmac.h +42 -0
- data/ext/libxcrypt/lib/alg-sm3.c +449 -0
- data/ext/libxcrypt/lib/alg-sm3.h +63 -0
- data/ext/libxcrypt/lib/alg-yescrypt-common.c +713 -0
- data/ext/libxcrypt/lib/alg-yescrypt-opt.c +1568 -0
- data/ext/libxcrypt/lib/alg-yescrypt-platform.c +106 -0
- data/ext/libxcrypt/lib/alg-yescrypt.h +360 -0
- data/ext/libxcrypt/lib/byteorder.h +164 -0
- data/ext/libxcrypt/lib/crypt-bcrypt.c +1061 -0
- data/ext/libxcrypt/lib/crypt-des-obsolete.c +215 -0
- data/ext/libxcrypt/lib/crypt-des.c +491 -0
- data/ext/libxcrypt/lib/crypt-gensalt-static.c +40 -0
- data/ext/libxcrypt/lib/crypt-gost-yescrypt.c +182 -0
- data/ext/libxcrypt/lib/crypt-md5.c +232 -0
- data/ext/libxcrypt/lib/crypt-nthash.c +134 -0
- data/ext/libxcrypt/lib/crypt-obsolete.h +40 -0
- data/ext/libxcrypt/lib/crypt-pbkdf1-sha1.c +260 -0
- data/ext/libxcrypt/lib/crypt-port.h +514 -0
- data/ext/libxcrypt/lib/crypt-scrypt.c +247 -0
- data/ext/libxcrypt/lib/crypt-sha256.c +308 -0
- data/ext/libxcrypt/lib/crypt-sha512.c +323 -0
- data/ext/libxcrypt/lib/crypt-sm3-yescrypt.c +189 -0
- data/ext/libxcrypt/lib/crypt-sm3.c +308 -0
- data/ext/libxcrypt/lib/crypt-static.c +44 -0
- data/ext/libxcrypt/lib/crypt-sunmd5.c +314 -0
- data/ext/libxcrypt/lib/crypt-yescrypt.c +177 -0
- data/ext/libxcrypt/lib/crypt.c +421 -0
- data/ext/libxcrypt/lib/crypt.h.in +249 -0
- data/ext/libxcrypt/lib/gen-des-tables.c +363 -0
- data/ext/libxcrypt/lib/hashes.conf +59 -0
- data/ext/libxcrypt/lib/libcrypt.map.in +48 -0
- data/ext/libxcrypt/lib/libcrypt.minver +97 -0
- data/ext/libxcrypt/lib/libxcrypt.pc.in +15 -0
- data/ext/libxcrypt/lib/util-base64.c +26 -0
- data/ext/libxcrypt/lib/util-gensalt-sha.c +88 -0
- data/ext/libxcrypt/lib/util-get-random-bytes.c +154 -0
- data/ext/libxcrypt/lib/util-make-failure-token.c +48 -0
- data/ext/libxcrypt/lib/util-xbzero.c +43 -0
- data/ext/libxcrypt/lib/util-xstrcpy.c +42 -0
- data/ext/libxcrypt/lib/xcrypt.h.in +58 -0
- data/ext/libxcrypt/libxcrypt.spec.rpkg +481 -0
- data/ext/libxcrypt/rpkg.conf +2 -0
- data/ext/libxcrypt/rpkg.macros +86 -0
- data/ext/libxcrypt/test/TestCommon.pm +326 -0
- data/ext/libxcrypt/test/alg-des.c +80 -0
- data/ext/libxcrypt/test/alg-gost3411-2012-hmac.c +90 -0
- data/ext/libxcrypt/test/alg-gost3411-2012.c +191 -0
- data/ext/libxcrypt/test/alg-hmac-sha1.c +187 -0
- data/ext/libxcrypt/test/alg-md4.c +111 -0
- data/ext/libxcrypt/test/alg-md5.c +134 -0
- data/ext/libxcrypt/test/alg-pbkdf-hmac-sha256.c +269 -0
- data/ext/libxcrypt/test/alg-sha1.c +111 -0
- data/ext/libxcrypt/test/alg-sha256.c +141 -0
- data/ext/libxcrypt/test/alg-sha512.c +170 -0
- data/ext/libxcrypt/test/alg-sm3-hmac.c +149 -0
- data/ext/libxcrypt/test/alg-sm3.c +168 -0
- data/ext/libxcrypt/test/alg-yescrypt.c +466 -0
- data/ext/libxcrypt/test/badsalt.c +726 -0
- data/ext/libxcrypt/test/badsetting.c +350 -0
- data/ext/libxcrypt/test/byteorder.c +254 -0
- data/ext/libxcrypt/test/checksalt.c +265 -0
- data/ext/libxcrypt/test/compile-strong-alias.c +43 -0
- data/ext/libxcrypt/test/crypt-badargs.c +392 -0
- data/ext/libxcrypt/test/crypt-gost-yescrypt.c +149 -0
- data/ext/libxcrypt/test/crypt-nested-call.c +180 -0
- data/ext/libxcrypt/test/crypt-sm3-yescrypt.c +149 -0
- data/ext/libxcrypt/test/crypt-too-long-phrase.c +157 -0
- data/ext/libxcrypt/test/des-cases.h +196 -0
- data/ext/libxcrypt/test/des-obsolete.c +206 -0
- data/ext/libxcrypt/test/des-obsolete_r.c +207 -0
- data/ext/libxcrypt/test/explicit-bzero.c +334 -0
- data/ext/libxcrypt/test/gensalt-bcrypt_x.c +54 -0
- data/ext/libxcrypt/test/gensalt-extradata.c +246 -0
- data/ext/libxcrypt/test/gensalt-nested-call.c +126 -0
- data/ext/libxcrypt/test/gensalt-nthash.c +65 -0
- data/ext/libxcrypt/test/gensalt.c +599 -0
- data/ext/libxcrypt/test/getrandom-fallbacks.c +295 -0
- data/ext/libxcrypt/test/getrandom-interface.c +211 -0
- data/ext/libxcrypt/test/ka-table-gen.py +945 -0
- data/ext/libxcrypt/test/ka-table.inc +5849 -0
- data/ext/libxcrypt/test/ka-tester.c +240 -0
- data/ext/libxcrypt/test/preferred-method.c +133 -0
- data/ext/libxcrypt/test/short-outbuf.c +119 -0
- data/ext/libxcrypt/test/special-char-salt.c +1160 -0
- data/ext/libxcrypt/test/symbols-compat.pl +137 -0
- data/ext/libxcrypt/test/symbols-renames.pl +107 -0
- data/ext/libxcrypt/test/symbols-static.pl +87 -0
- data/ext/xcrypt/xcrypt.c +9 -0
- data/lib/xcrypt/ffi.rb +76 -0
- data/lib/xcrypt/version.rb +5 -0
- data/lib/xcrypt.rb +89 -0
- metadata +267 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
[](https://github.com/besser82/libxcrypt/actions/workflows/config-matrix.yml)
|
|
2
|
+
[](https://github.com/besser82/libxcrypt/actions/workflows/memcheck.yml)
|
|
3
|
+
[](https://github.com/besser82/libxcrypt/actions/workflows/distcheck.yml)
|
|
4
|
+
[](https://copr.fedorainfracloud.org/coprs/besser82/libxcrypt_CI)
|
|
5
|
+
[](https://codecov.io/gh/besser82/libxcrypt)
|
|
6
|
+
[](https://scan.coverity.com/projects/besser82-libxcrypt)
|
|
7
|
+
[](https://www.codacy.com/manual/besser82/libxcrypt?utm_source=github.com&utm_medium=referral&utm_content=besser82/libxcrypt&utm_campaign=Badge_Grade)
|
|
8
|
+
|
|
9
|
+
README for libxcrypt
|
|
10
|
+
====================
|
|
11
|
+
|
|
12
|
+
libxcrypt is a modern library for one-way hashing of passwords. It
|
|
13
|
+
supports a wide variety of both modern and historical hashing methods:
|
|
14
|
+
yescrypt, gost-yescrypt, sm3-yescrypt, scrypt, bcrypt, sha512crypt,
|
|
15
|
+
sha256crypt, sm3crypt, md5crypt, SunMD5, sha1crypt, NT, bsdicrypt,
|
|
16
|
+
bigcrypt, and descrypt.
|
|
17
|
+
It provides the traditional Unix `crypt` and `crypt_r` interfaces, as
|
|
18
|
+
well as a set of extended interfaces pioneered by Openwall Linux,
|
|
19
|
+
`crypt_rn`, `crypt_ra`, `crypt_gensalt`, `crypt_gensalt_rn`, and
|
|
20
|
+
`crypt_gensalt_ra`.
|
|
21
|
+
|
|
22
|
+
libxcrypt is intended to be used by `login(1)`, `passwd(1)`, and other
|
|
23
|
+
similar programs; that is, to hash a small number of passwords during
|
|
24
|
+
an interactive authentication dialogue with a human. It is not
|
|
25
|
+
suitable for use in bulk password-cracking applications, or in any
|
|
26
|
+
other situation where speed is more important than careful handling of
|
|
27
|
+
sensitive data. However, it *is* intended to be fast and lightweight
|
|
28
|
+
enough for use in servers that must field thousands of login attempts
|
|
29
|
+
per minute.
|
|
30
|
+
|
|
31
|
+
Authorship and Licensing
|
|
32
|
+
------------------------
|
|
33
|
+
|
|
34
|
+
libxcrypt is currently maintained by Björn Esser and Zack Weinberg.
|
|
35
|
+
Many people have contributed to the code making up libxcrypt, often
|
|
36
|
+
under the aegis of a different project. Please see the AUTHORS and
|
|
37
|
+
THANKS files for a full set of credits.
|
|
38
|
+
|
|
39
|
+
libxcrypt as a whole is licensed under the GNU Lesser General Public
|
|
40
|
+
License (version 2.1, or at your option, any later version). However,
|
|
41
|
+
many individual files may be reused under more permissive licenses if
|
|
42
|
+
separated from the library. Please see the LICENSING file for a
|
|
43
|
+
comprehensive inventory of licenses, and COPYING.LIB for the terms of
|
|
44
|
+
the LGPL.
|
|
45
|
+
|
|
46
|
+
Bug Reports, Feature Requests, Contributions, Etc.
|
|
47
|
+
--------------------------------------------------
|
|
48
|
+
|
|
49
|
+
libxcrypt is currently maintained at Github: the canonical repository
|
|
50
|
+
URL is <https://github.com/besser82/libxcrypt>. Please file bug
|
|
51
|
+
reports at <https://github.com/besser82/libxcrypt/issues>. This is
|
|
52
|
+
also the appropriate place to suggest new features, offer patches,
|
|
53
|
+
etc. All your feedback is welcome and will eventually receive a
|
|
54
|
+
response, but this is a spare-time project for all of the present
|
|
55
|
+
maintainers, so please be patient.
|
|
56
|
+
|
|
57
|
+
Build Requirements and Instructions
|
|
58
|
+
-----------------------------------
|
|
59
|
+
|
|
60
|
+
To build from a tarball release, the tools required are the standard
|
|
61
|
+
Unix shell environment, a C compiler, and Perl (version 5.14 or
|
|
62
|
+
later). Follow the generic build and installation instructions in the
|
|
63
|
+
file `INSTALL`. There are several package-specific configure options;
|
|
64
|
+
run `./configure --help` for more detail on these options.
|
|
65
|
+
Run `man -l crypt.5` for more detail on the hashing algorithms that
|
|
66
|
+
can be enabled or disabled by `--enable-hashes`. You can do both of
|
|
67
|
+
these things before building the software.
|
|
68
|
+
|
|
69
|
+
Building from a Git checkout additionally requires the Autotools
|
|
70
|
+
suite: `autoconf`, `automake`, `libtool`, and `pkg-config`.
|
|
71
|
+
Run `./autogen.sh` at the top level of the source tree, and then
|
|
72
|
+
follow the instructions in `INSTALL` (which is created by that command).
|
|
73
|
+
|
|
74
|
+
The oldest versions of Autotools components that are known to work
|
|
75
|
+
are: autoconf 2.69, automake 1.14, libtool 2.4.6, pkg-config 0.29.
|
|
76
|
+
If you test with an older version of one of these and find that it
|
|
77
|
+
works, please let us know. We are not deliberately requiring newer
|
|
78
|
+
versions; we just can’t conveniently test older versions ourselves.
|
|
79
|
+
|
|
80
|
+
Portability Notes
|
|
81
|
+
-----------------
|
|
82
|
+
|
|
83
|
+
libxcrypt should be buildable with any ISO C1999-compliant C compiler,
|
|
84
|
+
with one critical exception: the symbol versioning macros in
|
|
85
|
+
`crypt-port.h` only work with compilers that implement certain GCC and
|
|
86
|
+
GNU Binutils extensions (`__attribute__((alias))`, GCC-style `asm`,
|
|
87
|
+
and `.symver`).
|
|
88
|
+
|
|
89
|
+
A few C2011 features are used; the intention is not to use any of them
|
|
90
|
+
without a fallback, but we do not currently test this. A few POSIX
|
|
91
|
+
and nonstandard-but-widespread Unix APIs are also used; again, the
|
|
92
|
+
intention is not to use any of them without a fallback, but we do not
|
|
93
|
+
currently test this. In particular, the crypt_gensalt functions may
|
|
94
|
+
not always be able to retrieve cryptographically-sound random numbers
|
|
95
|
+
from the operating system; if you call these functions with a null
|
|
96
|
+
pointer for the “rbytes” argument, be prepared for them to fail.
|
|
97
|
+
|
|
98
|
+
As of mid-2018, GCC and LLVM don’t support link-time optimization of
|
|
99
|
+
libraries that use symbol versioning. If you build libxcrypt with
|
|
100
|
+
either of these compilers, do not use `-flto`. See [GCC bug 48200][1]
|
|
101
|
+
for specifics; the problem is very similar for LLVM. Because this is,
|
|
102
|
+
at its root, a set of missing compiler features, we expect link-time
|
|
103
|
+
optimization won’t work in other C compilers either, but we haven’t
|
|
104
|
+
tested it ourselves.
|
|
105
|
+
|
|
106
|
+
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200
|
|
107
|
+
|
|
108
|
+
Compatibility Notes
|
|
109
|
+
-------------------
|
|
110
|
+
|
|
111
|
+
On Linux-based systems, by default libxcrypt will be binary backward
|
|
112
|
+
compatible with the libcrypt.so.1 shipped as part of the GNU C
|
|
113
|
+
Library. This means that all existing binary executables linked
|
|
114
|
+
against glibc’s libcrypt should work unmodified with this library’s
|
|
115
|
+
libcrypt.so.1. We have taken pains to provide exactly the same symbol
|
|
116
|
+
versions as were used by glibc on various CPU architectures, and to
|
|
117
|
+
account for the variety of ways in which the Openwall extensions were
|
|
118
|
+
patched into glibc’s libcrypt by some Linux distributions. (For
|
|
119
|
+
instance, compatibility symlinks for SUSE’s “libowcrypt” are provided.)
|
|
120
|
+
|
|
121
|
+
However, the converse is not true: programs linked against libxcrypt
|
|
122
|
+
will not work with glibc’s libcrypt. Also, programs that use certain
|
|
123
|
+
legacy APIs supplied by glibc’s libcrypt (`encrypt`, `encrypt_r`,
|
|
124
|
+
`setkey`, `setkey_r`, and `fcrypt`) cannot be *compiled* against
|
|
125
|
+
libxcrypt.
|
|
126
|
+
|
|
127
|
+
Binary backward compatibility can be disabled by supplying the
|
|
128
|
+
`--disable-obsolete-api` switch to `configure`, in which case libxcrypt
|
|
129
|
+
will install libcrypt.so.2 instead of libcrypt.so.1. This
|
|
130
|
+
configuration is always used on all operating systems other than
|
|
131
|
+
Linux. We are willing to consider adding binary backward
|
|
132
|
+
compatibility for other operating systems’ existing libcrypts, but we
|
|
133
|
+
don’t currently plan to do that work ourselves.
|
|
134
|
+
|
|
135
|
+
Individual hash functions may be enabled or disabled by use of the
|
|
136
|
+
`--enable-hashes` switch to `configure`. The default is to enable all
|
|
137
|
+
supported hashes. Disabling the traditional ‘des’ hash algorithm
|
|
138
|
+
implies `--disable-obsolete-api`. Security-conscious environments
|
|
139
|
+
without backward compatibility constraints are encouraged to use
|
|
140
|
+
`--enable-hashes=strong`, which enables only the hash functions that
|
|
141
|
+
are strong enough to be safe for newly hashed passwords.
|
|
142
|
+
|
|
143
|
+
The original implementation of the SunMD5 hashing algorithm has a bug,
|
|
144
|
+
which is mimicked by libxcrypt to be fully compatible with hashes
|
|
145
|
+
generated on (Open)Solaris. According to the only existing
|
|
146
|
+
[documentation of this algorithm][2], its hashes were supposed to have
|
|
147
|
+
the format `$md5[,rounds=%u]$<salt>$<checksum>`, and include only the
|
|
148
|
+
bare string `$md5[,rounds=%u]$<salt>` in the salt digest
|
|
149
|
+
step. However, almost all hashes encountered in production
|
|
150
|
+
environments have the format `$md5[,rounds=%u]$<salt>$$<checksum>`
|
|
151
|
+
(note the double $$). Unfortunately, it is not merely a cosmetic
|
|
152
|
+
difference: hashes of this format incorporate the first $ after the
|
|
153
|
+
salt within the salt digest step, so the resulting checksum is
|
|
154
|
+
different. The documentation hints that this stems from a bug within
|
|
155
|
+
the production implementation’s parser. This bug causes the
|
|
156
|
+
implementation to return `$$`-format hashes when passed a
|
|
157
|
+
configuration string that ends with `$`. It returns the intended
|
|
158
|
+
original format and checksum only if there is at least one letter
|
|
159
|
+
after the `$`, e.g. `$md5[,rounds=%u]$<salt>$x`.
|
|
160
|
+
|
|
161
|
+
The NT algorithm, in its original implementation, never came with any
|
|
162
|
+
`gensalt` function, because the algorithm does not use any. libxcrypt
|
|
163
|
+
ships a bogus `gensalt` function for the NT algorithm, which simply
|
|
164
|
+
returns `$3$`.
|
|
165
|
+
|
|
166
|
+
glibc’s libcrypt could optionally be configured to use Mozilla’s NSS
|
|
167
|
+
library’s implementations of the cryptographic primitives md5crypt,
|
|
168
|
+
sha256crypt, and sha512crypt. This option is not available in
|
|
169
|
+
libxcrypt, because we do not currently believe it is a desirable
|
|
170
|
+
option. The stated rationale for the option was to source all
|
|
171
|
+
cryptographic primitives from a library that has undergone FIPS
|
|
172
|
+
certification, but we believe FIPS certification would need to cover
|
|
173
|
+
all of libxcrypt itself to have any meaningful value. Moreover, the
|
|
174
|
+
strongest hashing methods, yescrypt and bcrypt, use cryptographic
|
|
175
|
+
primitives that are not available from NSS, so the certification
|
|
176
|
+
would not cover any part of what will hopefully be the most used code
|
|
177
|
+
paths.
|
|
178
|
+
|
|
179
|
+
[2]: https://dropsafe.crypticide.com/article/1389
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
As mentioned in the README, many people have contributed to the code
|
|
2
|
+
making up libxcrypt, often under the aegis of a different project. Of
|
|
3
|
+
the past contributors, we particularly wish to credit David Burren,
|
|
4
|
+
Ulrich Drepper, Alec Muffett, Colin Percival, Alexey Degtyarev, and
|
|
5
|
+
Thorsten Kukuk.
|
|
6
|
+
|
|
7
|
+
As well as the present maintainers, active contributors to the library
|
|
8
|
+
include Solar Designer, Dmitry V. Levin, and <vt at altlinux dot org>.
|
|
9
|
+
|
|
10
|
+
We would also like to extend our thanks in advance to everyone who
|
|
11
|
+
will, in the future, send us bug reports, suggestions, and contributions.
|
|
12
|
+
|
|
13
|
+
-- The Authors.
|
data/ext/libxcrypt/TODO
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TODO.md
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
to-do list for libxcrypt
|
|
2
|
+
------------------------
|
|
3
|
+
|
|
4
|
+
This list is categorized but not in any kind of priority order.
|
|
5
|
+
It was last updated 20 October 2018.
|
|
6
|
+
|
|
7
|
+
* Code cleanliness
|
|
8
|
+
* Find and remove any code that still does dodgy things with type punning
|
|
9
|
+
* Factor out all of the repetitive base64 code
|
|
10
|
+
* Factor out the multiple implementations of HMAC and PBKDF
|
|
11
|
+
|
|
12
|
+
* Testsuite improvements
|
|
13
|
+
* Investigate branch coverage
|
|
14
|
+
* Do some API fuzz testing and add missing cases to the testsuite
|
|
15
|
+
* Many of the `test-crypt-*.c` files repeat more or less the same
|
|
16
|
+
code with different data, consider merging them
|
|
17
|
+
|
|
18
|
+
* Portability
|
|
19
|
+
* Make sure the symbol versioning macros work with all of the
|
|
20
|
+
compilers that anyone needs (they use GCC extensions that clang
|
|
21
|
+
also supports).
|
|
22
|
+
|
|
23
|
+
* Hardening
|
|
24
|
+
* bcrypt-like selftest/memory scribble for all hashing methods
|
|
25
|
+
* how do we know the memory scribble is doing its job?
|
|
26
|
+
* build out of the box with compiler hardening features turned on
|
|
27
|
+
* something bespoke for not having to write serialization and
|
|
28
|
+
deserialization logic for hash strings by hand, as this is
|
|
29
|
+
probably the most error-prone part of writing a hashing method
|
|
30
|
+
|
|
31
|
+
* the most sensitive piece of data handled by this library is a
|
|
32
|
+
cleartext passphrase. OS may have trusted-path facilities for
|
|
33
|
+
prompting the user for a passphrase and feeding it to a KDF
|
|
34
|
+
without its ever being accessible in normal memory. investigate
|
|
35
|
+
whether we can use these.
|
|
36
|
+
|
|
37
|
+
* Additional hashing methods
|
|
38
|
+
* Argon2 <https://password-hashing.net/>
|
|
39
|
+
* ...?
|
|
40
|
+
|
|
41
|
+
* Runtime configurability (in progress on the [crypt.conf branch][])
|
|
42
|
+
* allow installations to enable or disable specific hash methods
|
|
43
|
+
without rebuilding the library
|
|
44
|
+
* make the default cost parameter used by `crypt_gensalt_*` for new
|
|
45
|
+
hashes configurable
|
|
46
|
+
* update the compiled-in defaults used by `crypt_gensalt_*` (not the
|
|
47
|
+
defaults used when no explicit cost parameter is present in a
|
|
48
|
+
hash; those can’t be changed without breaking existing stored hashes)
|
|
49
|
+
* relevant benchmarking at
|
|
50
|
+
<https://pthree.org/2016/06/28/lets-talk-password-hashing/>
|
|
51
|
+
* offer a way to tune cost parameters for a specific installation
|
|
52
|
+
* N.B. Solaris 11 has all of these features but our implementation will
|
|
53
|
+
probably not match them (they have a `crypt.conf` but it’s not the
|
|
54
|
+
same, and their `crypt_gensalt` is API-incompatible anyway).
|
|
55
|
+
|
|
56
|
+
[crypt.conf branch]: https://github.com/besser82/libxcrypt/tree/zack/crypt.conf
|
|
57
|
+
|
|
58
|
+
* Potential API enhancements:
|
|
59
|
+
|
|
60
|
+
* Support for "pepper" (an additional piece of information, _not_
|
|
61
|
+
stored in the password file, that you need to check a password)
|
|
62
|
+
|
|
63
|
+
* Reading passphrases from the terminal is finicky and there are
|
|
64
|
+
several competing, poorly portable, questionably sound library
|
|
65
|
+
functions to do it (`getpass`, `readpassphrase`, etc) -- should we
|
|
66
|
+
incorporate one?
|
|
67
|
+
* If we do, should it know how to trigger the trusted-path
|
|
68
|
+
password prompt in modern GUI environments? (probably)
|
|
69
|
+
|
|
70
|
+
* Make the crypt and crypt_gensalt static state thread-specific?
|
|
71
|
+
* Solaris 11 may have done this (its `crypt(3)` manpage describes
|
|
72
|
+
it as MT-Safe and I don’t see any other way they could have
|
|
73
|
+
accomplished that).
|
|
74
|
+
* if allocated on first use, this would also shave 32kB of
|
|
75
|
+
data segment off the shared library
|
|
76
|
+
* alternatively, add a global lock and *crash the program* if we
|
|
77
|
+
detect concurrent calls
|
|
78
|
+
|
|
79
|
+
* Allow access to more of yescrypt’s tunable parameters and ROM
|
|
80
|
+
feature, in a way that’s generic enough that we could also use it
|
|
81
|
+
for e.g. Argon2’s tunable parameters
|
|
82
|
+
|
|
83
|
+
* Other yescrypt-inspired features relevant to using this library to
|
|
84
|
+
back a “dedicated authentication service,” e.g. preallocation of
|
|
85
|
+
large blocks of scratch memory
|
|
86
|
+
* the main obstacles here are that `struct crypt_data` has a fixed
|
|
87
|
+
size which is either too big or too small depending how you look
|
|
88
|
+
at it, and no destructor function
|
|
89
|
+
|
|
90
|
+
* Permissive relicensing, to encourage use beyond the GNU ecosystem?
|
|
91
|
+
* Replace crypt-md5.c with original md5crypt from FreeBSD?
|
|
92
|
+
* Other files subject to the (L)GPL are crypt.c, crypt-static.c,
|
|
93
|
+
crypt-gensalt-static.c, crypt-obsolete.h, crypt-port.h,
|
|
94
|
+
test-badsalt.c. It is not clear to me how much material originally
|
|
95
|
+
assigned to the FSF remains in these files.
|
|
96
|
+
Several of them are API definitions and trivial wrappers that
|
|
97
|
+
could not be meaningfully changed without breaking them (so are
|
|
98
|
+
arguably uncopyrightable).
|
|
99
|
+
* Most of the test suite lacks any license or even authorship
|
|
100
|
+
information. We would have to track down the original authors.
|