projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Due to an increasing number of clashes between modern OpenSSL and
[openssl.git]
/
crypto
/
des
/
read2pwd.c
diff --git
a/crypto/des/read2pwd.c
b/crypto/des/read2pwd.c
index a8ceaf088a90d06b2a217bbb5ec5e5be526a8aff..e7d8c1272490d96d7899c6b6c4723b8742cb2bf7 100644
(file)
--- a/
crypto/des/read2pwd.c
+++ b/
crypto/des/read2pwd.c
@@
-57,14
+57,21
@@
*/
#include "des_locl.h"
*/
#include "des_locl.h"
+#include <openssl/ui.h>
int des_read_password(des_cblock *key, const char *prompt, int verify)
{
int ok;
char buf[BUFSIZ],buff[BUFSIZ];
int des_read_password(des_cblock *key, const char *prompt, int verify)
{
int ok;
char buf[BUFSIZ],buff[BUFSIZ];
+ UI *ui;
- if ((ok=des_read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
+ ui = UI_new();
+ UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1);
+ if (verify)
+ UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1,buf);
+ if ((ok=UI_process(ui)) == 0)
des_string_to_key(buf,key);
des_string_to_key(buf,key);
+ UI_free(ui);
memset(buf,0,BUFSIZ);
memset(buff,0,BUFSIZ);
return(ok);
memset(buf,0,BUFSIZ);
memset(buff,0,BUFSIZ);
return(ok);
@@
-75,9
+82,15
@@
int des_read_2passwords(des_cblock *key1, des_cblock *key2, const char *prompt,
{
int ok;
char buf[BUFSIZ],buff[BUFSIZ];
{
int ok;
char buf[BUFSIZ],buff[BUFSIZ];
+ UI *ui;
- if ((ok=des_read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
+ ui = UI_new();
+ UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1);
+ if (verify)
+ UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1,buf);
+ if ((ok=UI_process(ui)) == 0)
des_string_to_2keys(buf,key1,key2);
des_string_to_2keys(buf,key1,key2);
+ UI_free(ui);
memset(buf,0,BUFSIZ);
memset(buff,0,BUFSIZ);
return(ok);
memset(buf,0,BUFSIZ);
memset(buff,0,BUFSIZ);
return(ok);