Update encrypt.cpp

This commit is contained in:
Eao3piq4e 2022-07-28 12:05:27 +08:00
parent 4ec1513e05
commit 5f334a5656
1 changed files with 23 additions and 0 deletions

View File

@ -34,6 +34,14 @@
static int check_key_num(const char* password);
static void create_child_dir(const char* pathdir);
/*
function name: check_path
description: Check if the string delivered has the character that should not be included
arguments: A pointer to string that its type is const char
return value: void
Notenone
*/
void check_path(const char *path_name)
{
const char* danger_character_list[] = {"|",
@ -69,6 +77,14 @@ void check_path(const char *path_name)
}
}
/*
function name: check_key_num
description: Check if the password is a null string, if so, then the password is invalid.
At the same time, the function check if the length of password exceeds MAX_CRYPT_LEN, if so, print the error.
arguments: A pointer to string that its type is const char
return value: An integer that its type is static int
NoteThe length of password should not be zero, and never exceeds MAX_CRYPT_LEN
*/
static int check_key_num(const char* password)
{
int key_len = 0;
@ -84,6 +100,13 @@ static int check_key_num(const char* password)
return key_len;
}
/*
function name: create_child_dir
description:
arguments: A pointer to string that its type is const char
return value: static void
Note西
*/
static void create_child_dir(const char* pathdir)
{
if (pathdir == NULL) {