diff options
author | Richard Levitte <levitte@openssl.org> | 2001-05-30 15:29:28 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-05-30 15:29:28 +0000 |
commit | 30b4c2724ea2a078d921ba16a51b8d3e2ad85c42 (patch) | |
tree | 551cb4a7545944a838e3a1f571dabce14bea1a24 /apps/apps.h | |
parent | 2adc929367129a845ae2aa8358e645d4dbb9c624 (diff) | |
download | openssl-30b4c2724ea2a078d921ba16a51b8d3e2ad85c42.zip openssl-30b4c2724ea2a078d921ba16a51b8d3e2ad85c42.tar.gz openssl-30b4c2724ea2a078d921ba16a51b8d3e2ad85c42.tar.bz2 |
Extend all the loading functions to take an engine pointer, a pass
string (some engines may have certificates protected by a PIN!) and
a description to put into error messages.
Also, have our own password callback that we can send both a password
and some prompt info to. The default password callback in EVP assumes
that the passed parameter is a password, which isn't always the right
thing, and the ENGINE code (at least the nCipher one) makes other
assumptions...
Also, in spite of having the functions to load keys, some utilities
did the loading all by themselves... That's changed too.
Diffstat (limited to 'apps/apps.h')
-rw-r--r-- | apps/apps.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/apps/apps.h b/apps/apps.h index 96dafd9..a2b72f0 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -142,6 +142,16 @@ typedef struct args_st int count; } ARGS; +#define PW_MIN_LENGTH 4 +typedef struct pw_cb_data + { + const void *password; + const char *prompt_info; + } PW_CB_DATA; + +int password_callback(char *buf, int bufsiz, int verify, + PW_CB_DATA *cb_data); + int should_retry(int i); int args_from_file(char *file, int *argc, char **argv[]); int str2fmt(char *s); @@ -157,10 +167,14 @@ int set_ext_copy(int *copy_type, const char *arg); int copy_extensions(X509 *x, X509_REQ *req, int copy_type); int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2); int add_oid_section(BIO *err, LHASH *conf); -X509 *load_cert(BIO *err, char *file, int format); -EVP_PKEY *load_key(BIO *err, char *file, int format, char *pass, ENGINE *e); -EVP_PKEY *load_pubkey(BIO *err, char *file, int format, ENGINE *e); -STACK_OF(X509) *load_certs(BIO *err, char *file, int format); +X509 *load_cert(BIO *err, const char *file, int format, + const char *pass, ENGINE *e, const char *cert_descrip); +EVP_PKEY *load_key(BIO *err, const char *file, int format, + const char *pass, ENGINE *e, const char *key_descrip); +EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, + const char *pass, ENGINE *e, const char *key_descrip); +STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, + const char *pass, ENGINE *e, const char *cert_descrip); X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); #define FORMAT_UNDEF 0 |