diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/asn1_lib.c | 2 | ||||
-rw-r--r-- | crypto/pem/pem.h | 3 | ||||
-rw-r--r-- | crypto/pem/pem_lib.c | 24 |
3 files changed, 8 insertions, 21 deletions
diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index e84dd5f34b..be8daa8688 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -421,4 +421,4 @@ int ASN1_STRING_type(ASN1_STRING *x) { return M_ASN1_STRING_type(x); } unsigned char * ASN1_STRING_data(ASN1_STRING *x) -{ return ASN1_STRING_data(x); } +{ return M_ASN1_STRING_data(x); } diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h index 80ab491a1c..26c313b2ef 100644 --- a/crypto/pem/pem.h +++ b/crypto/pem/pem.h @@ -601,9 +601,6 @@ EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, vo int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); -#ifdef MS_CALLBACK -int MS_CALLBACK PEM_cb(char *buf, int len, int verify, void *key); -#endif #endif /* SSLEAY_MACROS */ diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 49aeb62bde..1b441d7852 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -85,7 +85,7 @@ static int do_pk8pkey_fp(FILE *bp, EVP_PKEY *x, int isder, char *kstr, int klen, pem_password_cb *cb, void *u); -static int def_callback(char *buf, int num, int w, void *userdata) +static int def_callback(char *buf, int num, int w, void *key) { #ifdef NO_FP_API /* We should not ever call the default callback routine from @@ -95,6 +95,12 @@ static int def_callback(char *buf, int num, int w, void *userdata) #else int i,j; const char *prompt; + if(key) { + i=strlen(key); + i=(i > num)?num:i; + memcpy(buf,key,i); + return(i); + } prompt=EVP_get_pw_prompt(); if (prompt == NULL) @@ -121,22 +127,6 @@ static int def_callback(char *buf, int num, int w, void *userdata) #endif } -/* This is a generic callback. If the user data is not NULL it is assumed - * to be a null terminated password. Otherwise the default password callback - * is called. - */ - - -int MS_CALLBACK PEM_cb(char *buf, int len, int verify, void *key) -{ - int i; - if (key == NULL) return def_callback(buf, len, verify, key); - i=strlen(key); - i=(i > len)?len:i; - memcpy(buf,key,i); - return(i); -} - void PEM_proc_type(char *buf, int type) { const char *str; |