safec  3.2
Safe C Library - ISO TR24731 Bounds Checking Interface
strispassword_s.c File Reference
#include "safe_str_lib.h"
+ Include dependency graph for strispassword_s.c:

Functions

bool strispassword_s (const char *dest, rsize_t dmax)
 This function validates the make-up of a password string. More...
 

Function Documentation

◆ strispassword_s()

bool strispassword_s ( const char *  dest,
rsize_t  dmax 
)

This function validates the make-up of a password string.

-Password must have mininmum SAFE_STR_PASSWORD_MIN_LENGTH characters
-Password can have maximum SAFE_STR_PASSWORD_MAX_LENGTH characters
-Password must have at least SAFE_STR_MIN_LOWERCASE lower case characters
-Password must have at least SAFE_STR_MIN_UPPERCASE upper case characters
-Password must have at least SAFE_STR_MIN_NUMBERS numbers
-Password must have at least SAFE_STR_MIN_SPECIALS special characters

Remarks
EXTENSION TO ISO/IEC TR 24731, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
destpointer to string
dmaxmaximum length of password string
Precondition
dest shall not be a null pointer.
dmax > SAFE_STR_PASSWORD_MIN_LENGTH
dmax < SAFE_STR_PASSWORD_MAX_LENGTH
dest shall not be unterminated
Returns
true when string has valid password makeup
false when string does not meet requirements or an error occurred
See also
strzero_s()