ESAPI-C 1.0
The OWASP Enterprise Security API for C
|
A Validation module implementation. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include "validate.h"
Go to the source code of this file.
Data Structures | |
struct | element |
A precompiled regex cache entry. More... | |
Typedefs | |
typedef struct element | element |
A precompiled regex cache entry. | |
Functions | |
int | _cmp_ele (element *a, element *b) |
int | contains_char (char *s, char c) |
char * | strip_chars (char *s, char *valid_chars) |
Remove all characters from the given input character array that are also found in the given valid characters array. | |
int | is_valid (char *input, char *regex, int flags) |
Returns true if the given regular expression matches the given data. | |
Variables | |
element * | pattern_list = NULL |
A cache of pre-compiled regex's stored as doubly-linked list. |
int is_valid | ( | char * | , |
char * | , | ||
int | |||
) |
Returns true if the given regular expression matches the given data.
input | A character array containing the user input data to validate. |
type | The regular expression name that maps to the actual regular expression from "ESAPI.properties". |
flags | May be the bitwise-or of one or more of the following: REG_EXTENDED, REG_ICASE, REG_NOSUB, REG_NEWLINE. |
Definition at line 60 of file validate.c.
char* strip_chars | ( | char * | , |
char * | |||
) |
Remove all characters from the given input character array that are also found in the given valid characters array.
input | A character array containing the user input data to validate. |
valid_chars | A character array containing the characters to strip. |
Definition at line 38 of file validate.c.