From 4ba74a357376c8f8bf49487f96ae71cf2460c3f3 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 10 Oct 2012 07:05:10 -0300 Subject: * 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. --- crypt/crypt-private.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crypt/crypt-private.h') diff --git a/crypt/crypt-private.h b/crypt/crypt-private.h index b4bfa8b4ac..54418fcb54 100644 --- a/crypt/crypt-private.h +++ b/crypt/crypt-private.h @@ -26,6 +26,7 @@ #define CRYPT_PRIVATE_H 1 #include +#include /* 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); -- cgit v1.2.1