
#use wml::openssl-macros area=docs page=ui_compat

<title>Documents, ui_compat(3)</title>

<h1>ui_compat(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#AUTHOR">AUTHOR</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
des_read_password, des_read_2passwords, des_read_pw_string, des_read_pw -
Compatibility user interface functions

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/des_old.h&gt;
</PRE>
<PRE> int des_read_password(DES_cblock *key,const char *prompt,int verify);
 int des_read_2passwords(DES_cblock *key1,DES_cblock *key2,
        const char *prompt,int verify);
</PRE>
<PRE> int des_read_pw_string(char *buf,int length,const char *prompt,int verify);
 int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The DES library contained a few routines to prompt for passwords. These
aren't necessarely dependent on DES, and have therefore become part of the
UI compatibility library.

</P>
<P>
<CODE>des_read_pw()</CODE> writes the string specified by <EM>prompt</EM> to standard output turns echo off and reads an input string from the
terminal. The string is returned in <EM>buf</EM>, which must have spac for at least <EM>size</EM> bytes. If <EM>verify</EM> is set, the user is asked for the password twice and unless the two copies
match, an error is returned. The second password is stored in <EM>buff</EM>, which must therefore also be at least <EM>size</EM> bytes. A return code of -1 indicates a system error, 1 failure due to use
interaction, and 0 is success. All other functions described here use
<CODE>des_read_pw()</CODE> to do the work.

</P>
<P>
<CODE>des_read_pw_string()</CODE> is a variant of
<CODE>des_read_pw()</CODE> that provides a buffer for you if <EM>verify</EM> is set.

</P>
<P>
<CODE>des_read_password()</CODE> calls <CODE>des_read_pw()</CODE> and
converts the password to a DES key by calling
<CODE>DES_string_to_key();</CODE> <CODE>des_read_2password()</CODE>
operates in the same way as <CODE>des_read_password()</CODE> except that it
generates two keys by using the <CODE>DES_string_to_2key()</CODE> function.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
<CODE>des_read_pw_string()</CODE> is available in the MIT Kerberos library
as well, and is also available under the name
<CODE>EVP_read_pw_string().</CODE>

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/ui.html#">ui(3)</A>, <EM>ui_create(3)</EM>



</P>
<P>
<HR>
<H1><A NAME="AUTHOR">AUTHOR</A></H1>
<P>
Richard Levitte (<A
HREF="mailto:richard@levitte.org">richard@levitte.org</A>) for the OpenSSL
project (http://www.openssl.org).

</P>
:}


