Age | Commit message (Collapse) | Author | Files | Lines |
|
We were defining the compatibility symbols crypt_gensalt_r, xcrypt,
xcrypt_r, xcrypt_gensalt, and xcrypt_gensalt_r with default ELF
symbol versions, meaning that they were accessible for linkage by a
program that declared them itself. This was intended to make e.g.
AC_CHECK_FUNCS([xcrypt]) detect them as available, but that seems
to be causing more problems than it solves, see e.g. issue #100.
Make these into normal compatibility symbols (that is, defined with no
default symbol version). They will still be usable by newly compiled
programs that include xcrypt.h, since xcrypt.h uses __REDIRECT to map
them onto the currently supported API. However, programs that declare
them themselves will fail to link.
This also corrects the minor glitch where these symbols were defined
by libxcrypt.so.2 in a --disable-obsolete-api configuration. For
further consistency, make --disable-obsolete-api imply
--disable-xcrypt-compat-files.
|
|
|
|
Some third-party build-tools, used for building package
collections or customized system environments from scratch,
require the autotools bootstrap script to be named 'autogen.sh'.
Thus we should follow this naming convention.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For _all_ hashing methods, fail with ERANGE if the phrase is
longer than CRYPT_MAX_PASSPHRASE_SIZE characters.
|
|
The NT hashing method no longer truncates passphrases
at 128 characters; Windows does not do this. (The
Windows login dialog _limits_ interactively entered
passphrases to 127 characters. Passphrases set via
the low-level API can be longer.)
Additionally this commit adds serveral optimizations
and simplifications to the crypt_nt_rn function by
Zack Weinberg and me.
Closes: #78.
|
|
|
|
If enabled, this option replaces the obsolete APIs (fcrypt, encrypt{,_r},
and setkey{,_r}) with stubs that set errno to ENOSYS and return without
performing any real operations.
This allows one to disable DEScrypt support while preserving POSIX
compliance.
For security reasons, the encrypt{,r} functions will also overwrite
their data-block argument with random bits.
The fcrypt function will always produce a failure token (*0 or *1),
unless the library was also configured with --disable-failure-tokens,
in which case it will always return NULL.
|
|
|
|
|
|
|
|
Fixes: #74.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
|
|
This also needs to re-add those functions from the upstream
codebase, which have been dropped on intial integration of
yescrypt with libxcrypt.
|
|
|
|
The relro flag ensures that the ELF sections are reordered so that the
ELF internal data sections (.got, .dtors, etc.) precede the program's
data sections (.data and .bss) and that the non-PLT GOT is read-only.
In case of a bss or data overflow bug the relro flags protects the ELF
internal data sections from being overwritten (as the ELF sections are
reordered).
The bind-now flag tells the dynamic linker to resolve all symbols when
the program is started, or when the shared library is linked to using
dlopen, instead of deferring function call resolution to the point when
the function is first called. Together with the relro flag the bind-now
effectively re-maps the whole GOT to be read-only.
The only downside of immediate binding causing slowed down startup of
processes as the linker has to perform all relocations at startup time,
is not that much of a problem for libxcrypt, as the only external
dependency it has is the system's libc.
The resulting full read-only relocation mitigates the well known
technique of modifying a GOT entry to get control over the program
execution flow.
|
|
|
|
|
|
|
|
crypt_preferred_method(3) is a convenience function to get the prefix
of the preferred hash method. If a preferred method is available, it
is the same as the one also used by the crypt_gensalt functions, if
their given prefix parameter is NULL.
If no preferred hash method is supported, the return value of this
function is NULL.
|
|
|
|
This is needed as some configure scripts may look for symbols available
in libxcrypt.so. For static libraries a corresponding symlink for the
archive file will be installed.
The installation of those compatibility files can be disabled by passing
the '--disable-xcrypt-compat-files' flag to the configure script.
|
|
Those aliases were added for code compatibility with libxcrypt
v3.1.1 and earlier.
Also replace the prototype for the crypt_gensalt_r function with
a declaration through a macro, so new compiled applications link
against the identical crypt_gensalt_rn function directly.
|
|
|
|
|
|
The function was available in older versions (v3.1.1 and earlier)
of libxcrypt. It has the same semantics and the same prototype as
the crypt_gensalt_rn function.
Adding such an alias makes porting applications written for those
earlier versions of libxcrypt much easier and requires less
conditionals to keep code compatibility for systems still using an
antique release.
|
|
|
|
This prefix was never intended for use when hashing new passphrases.
The only use case originally intended was to manually edit '$2a$' to
'$2x$' in passphrase hashes to knowingly take the risk yet enable
users to continue to log in when upgrading systems with buggy bcrypt
implementations to fixed versions.
There was never an intent to be able to generate new setting strings
with that prefix. The original implementation of the bcrypt gensalt
function doesn't allow the use of the prefix '$2x'.
Thus libxcrypt must not, either.
|
|
|
|
|
|
There are now separate INCLUDE_ macros for all four variants of
bcrypt. --enable-hashes=bcrypt enables only the preferred $2b$
variant. The $2x$ variant, which has a bug that makes collisions
easy to find for some passphrases, is no longer included in the STRONG
group, and the OS compatibility groups have been adjusted so that each
includes only the variants historically available on the OS we’re
being compatible with.
As a side-effect, this makes the “optional suffix on the name of the
gensalt_fn” column of hashes.lst unnecessary, and allows
simplification of gen-hashes.awk.
The bcrypt-related tests have not actually changed, but many entries
in test case arrays were rearranged to minimize the number of
additional ifdefs needed.
|