EVP_read_pw_string

Prompt on the terminal for a password into buf.

Synopsis

Declared in <openssl/evp.h>

int
EVP_read_pw_string(
    char* buf,
    int length,
    char const* prompt,
    int verify);

Return Value

0 on success, a negative value on mismatch/cancel, or a positive UI error code.

Parameters

NameDescription
bufDestination buffer receiving the password (NUL-terminated).
lengthCapacity of buf in bytes including the NUL terminator.
promptPrompt string shown to the user, or NULL for the default.
verifyNonzero to ask twice and require matching input.