summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/evp_key.c')
-rw-r--r--src/lib/libcrypto/evp/evp_key.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index dafa686f64..21eda418bc 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -58,15 +58,14 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "x509.h" 61#include <openssl/x509.h>
62#include "objects.h" 62#include <openssl/objects.h>
63#include "evp.h" 63#include <openssl/evp.h>
64 64
65/* should be init to zeros. */ 65/* should be init to zeros. */
66static char prompt_string[80]; 66static char prompt_string[80];
67 67
68void EVP_set_pw_prompt(prompt) 68void EVP_set_pw_prompt(char *prompt)
69char *prompt;
70 { 69 {
71 if (prompt == NULL) 70 if (prompt == NULL)
72 prompt_string[0]='\0'; 71 prompt_string[0]='\0';
@@ -74,7 +73,7 @@ char *prompt;
74 strncpy(prompt_string,prompt,79); 73 strncpy(prompt_string,prompt,79);
75 } 74 }
76 75
77char *EVP_get_pw_prompt() 76char *EVP_get_pw_prompt(void)
78 { 77 {
79 if (prompt_string[0] == '\0') 78 if (prompt_string[0] == '\0')
80 return(NULL); 79 return(NULL);
@@ -83,29 +82,19 @@ char *EVP_get_pw_prompt()
83 } 82 }
84 83
85#ifdef NO_DES 84#ifdef NO_DES
86int des_read_pw_string(char *buf,int len,char *prompt,int verify); 85int des_read_pw_string(char *buf,int len,const char *prompt,int verify);
87#endif 86#endif
88 87
89int EVP_read_pw_string(buf,len,prompt,verify) 88int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
90char *buf;
91int len;
92char *prompt;
93int verify;
94 { 89 {
95 if ((prompt == NULL) && (prompt_string[0] != '\0')) 90 if ((prompt == NULL) && (prompt_string[0] != '\0'))
96 prompt=prompt_string; 91 prompt=prompt_string;
97 return(des_read_pw_string(buf,len,prompt,verify)); 92 return(des_read_pw_string(buf,len,prompt,verify));
98 } 93 }
99 94
100int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv) 95int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt,
101EVP_CIPHER *type; 96 unsigned char *data, int datal, int count, unsigned char *key,
102EVP_MD *md; 97 unsigned char *iv)
103unsigned char *salt;
104unsigned char *data;
105int datal;
106int count;
107unsigned char *key;
108unsigned char *iv;
109 { 98 {
110 EVP_MD_CTX c; 99 EVP_MD_CTX c;
111 unsigned char md_buf[EVP_MAX_MD_SIZE]; 100 unsigned char md_buf[EVP_MAX_MD_SIZE];