(krb5_password_key_proc): check return value from des_read_pw_string

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6969 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-09-14 21:50:02 +00:00
parent 8f8b7c05c8
commit bcd030454c

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997 - 1999 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -55,7 +55,10 @@ krb5_password_key_proc (krb5_context context,
if (*key == NULL) if (*key == NULL)
return ENOMEM; return ENOMEM;
if (password == NULL) { if (password == NULL) {
des_read_pw_string (buf, sizeof(buf), "Password: ", 0); if(des_read_pw_string (buf, sizeof(buf), "Password: ", 0)) {
free (*key);
return KRB5_LIBOS_PWDINTR;
}
password = buf; password = buf;
} }
ret = krb5_string_to_key_salt (context, type, password, salt, *key); ret = krb5_string_to_key_salt (context, type, password, salt, *key);