diff options
author | John Kohl <jtkohl@mit.edu> | 1991-03-14 09:48:10 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1991-03-14 09:48:10 +0000 |
commit | c42606a068556f2af65c0b0d8e6252d50ff1aac0 (patch) | |
tree | e4fbd536579105f16d9f21cbd786e8868bb40e40 | |
parent | f4ac575b3ce1a2cc323ce0f0a264787d763175b1 (diff) | |
download | krb5-c42606a068556f2af65c0b0d8e6252d50ff1aac0.tar.gz krb5-c42606a068556f2af65c0b0d8e6252d50ff1aac0.tar.xz krb5-c42606a068556f2af65c0b0d8e6252d50ff1aac0.zip |
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1888 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/des425/read_passwd.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/des425/read_passwd.c b/src/lib/des425/read_passwd.c new file mode 100644 index 000000000..409a8ea05 --- /dev/null +++ b/src/lib/des425/read_passwd.c @@ -0,0 +1,52 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1985,1986,1987,1988,1991 by the Massachusetts Institute + * of Technology. + * All Rights Reserved. + * + * For copying and distribution information, please see the file + * <krb5/copyright.h>. + * + * This routine prints the supplied string to standard + * output as a prompt, and reads a password string without + * echoing. + */ + +#ifndef lint +static char rcsid_read_password_c[] = +"$Id$"; +#endif /* lint */ + +#include <krb5/krb5.h> +#include <krb5/libos-proto.h> + +#include "des.h" + +/*** Routines ****************************************************** */ +int +des_read_password/*_v4_compat_crock*/(k,prompt,verify) + mit_des_cblock *k; + char *prompt; + int verify; +{ + int ok; + char key_string[BUFSIZ]; + char prompt2[BUFSIZ]; + int string_size = sizeof(key_string); + krb5_error_code retval; + + if (verify) { + strcpy(prompt2, "Verifying, please re-enter "); + strncat(prompt2, prompt, sizeof(prompt2)-(strlen(prompt2)+1)); + } + ok = krb5_read_password(prompt, verify ? prompt2 : 0, + key_string, &string_size); + + if (ok == 0) + mit_des_string_to_key(key_string, k); + + bzero(key_string, sizeof (key_string)); + return ok; +} |