1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

* crypt/crypt-private.h: Include stdbool.h.

(_ufc_setup_salt_r): Return bool.
* crypt/crypt-entry.c: Include errno.h.
(__crypt_r): Return NULL with EINVAL for bad salt.
* crypt/crypt_util.c (bad_for_salt): New.
(_ufc_setup_salt_r): Check that salt is long enough and within
the specified alphabet.
* crypt/badsalttest.c: New file.
* crypt/Makefile (tests): Add it.
($(objpfx)badsalttest): New.
This commit is contained in:
Alexandre Oliva
2012-10-10 07:05:10 -03:00
parent 0e3b5d6a68
commit 4ba74a3573
6 changed files with 148 additions and 9 deletions

View File

@@ -26,6 +26,7 @@
#define CRYPT_PRIVATE_H 1
#include <features.h>
#include <stdbool.h>
/* crypt.c */
extern void _ufc_doit_r (ufc_long itr, struct crypt_data * __restrict __data,
@@ -36,7 +37,7 @@ extern void _ufc_doit_r (ufc_long itr, struct crypt_data * __restrict __data,
extern void __init_des_r (struct crypt_data * __restrict __data);
extern void __init_des (void);
extern void _ufc_setup_salt_r (const char *s,
extern bool _ufc_setup_salt_r (const char *s,
struct crypt_data * __restrict __data);
extern void _ufc_mk_keytab_r (const char *key,
struct crypt_data * __restrict __data);