diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 19:06:20 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 19:06:58 +0000 |
commit | 3fcbb67b7949a8b362de5558bf1c6dd7ec5d21cf (patch) | |
tree | b867f9a6d3426f212b2f073bef8067a830f13022 /crypt/crypt-entry.c | |
parent | b6df7ac2cbe11e6a72f2ab7bd35c6130b72d21d9 (diff) | |
parent | cab56836b146bc129f1ad43f0393d95a9deca63a (diff) |
Merge commit 'refs/top-bases/t/tls-threadvar' into t/tls-threadvar
Diffstat (limited to 'crypt/crypt-entry.c')
-rw-r--r-- | crypt/crypt-entry.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c index a7dfccaa36..4e95f74878 100644 --- a/crypt/crypt-entry.c +++ b/crypt/crypt-entry.c @@ -1,7 +1,7 @@ /* * UFC-crypt: ultra fast crypt(3) implementation * - * Copyright (C) 1991-2016 Free Software Foundation, Inc. + * Copyright (C) 1991-2018 Free Software Foundation, Inc. * * The GNU C Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,7 @@ #endif #include "crypt-private.h" +#include <shlib-compat.h> /* Prototypes for local functions. */ #ifndef __GNU_LIBRARY__ @@ -141,6 +142,15 @@ __crypt_r (const char *key, const char *salt, * And convert back to 6 bit ASCII */ _ufc_output_conversion_r (res[0], res[1], salt, data); + + /* + * Erase key-dependent intermediate data. Data dependent only on + * the salt is not considered sensitive. + */ + explicit_bzero (ktab, sizeof (ktab)); + explicit_bzero (data->keysched, sizeof (data->keysched)); + explicit_bzero (res, sizeof (res)); + return data->crypt_3_buf; } weak_alias (__crypt_r, crypt_r) @@ -167,17 +177,7 @@ crypt (const char *key, const char *salt) return __crypt_r (key, salt, &_ufc_foobar); } - -/* - * To make fcrypt users happy. - * They don't need to call init_des. - */ -#ifdef _LIBC +#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) weak_alias (crypt, fcrypt) -#else -char * -__fcrypt (const char *key, const char *salt) -{ - return crypt (key, salt); -} +compat_symbol (libcrypt, fcrypt, fcrypt, GLIBC_2_0); #endif |