EVP_read_pw_string_min

Prompt for a password with a minimum and maximum length.

Synopsis

Declared in <openssl/evp.h>

int
EVP_read_pw_string_min(
    char* buf,
    int minlen,
    int maxlen,
    char const* prompt,
    int verify);

Return Value

0 on success, or a non-zero value on failure / mismatch.

Parameters

NameDescription
bufOutput buffer receiving the password (NUL-terminated).
minlenMinimum acceptable password length in characters.
maxlenMaximum length including space for the trailing NUL.
promptPrompt string shown to the user.
verifyWhen non-zero, prompt twice and require matching input.