summaryrefslogtreecommitdiffstats
path: root/src/kadmin
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2008-08-13 19:49:50 +0000
committerAlexandra Ellwood <lxs@mit.edu>2008-08-13 19:49:50 +0000
commit8bf03064e30cc9d01a3c2177e8cd13a65b248a6c (patch)
tree6a586ea7dab028d127d35d1199ca5124f9cbb0e1 /src/kadmin
parentfa17450ee30a79fef6b0f5dbba0b25eb3c0438d2 (diff)
downloadkrb5-8bf03064e30cc9d01a3c2177e8cd13a65b248a6c.tar.gz
krb5-8bf03064e30cc9d01a3c2177e8cd13a65b248a6c.tar.xz
krb5-8bf03064e30cc9d01a3c2177e8cd13a65b248a6c.zip
Use a valid UTF8 password for randkey password
KfM RC4 string to key function expects password to be valid UTF8 ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20650 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin')
-rw-r--r--src/kadmin/cli/kadmin.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c
index 02394e7f0..897787255 100644
--- a/src/kadmin/cli/kadmin.c
+++ b/src/kadmin/cli/kadmin.c
@@ -1170,16 +1170,20 @@ void kadmin_addprinc(argc, argv)
krb5_key_salt_tuple *ks_tuple;
char *pass, *canon;
krb5_error_code retval;
- static char newpw[1024], dummybuf[256];
+ char newpw[1024], dummybuf[256];
static char prompt1[1024], prompt2[1024];
#if APPLE_PKINIT
char *cert_hash = NULL;
#endif /* APPLE_PKINIT */
- if (dummybuf[0] == 0) {
- for (i = 0; i < 256; i++)
- dummybuf[i] = (i+1) % 256;
- }
+ /*
+ dummybuf is used to give random key a password,
+ random key entires are created with DISALLOW_ALL_TIX
+ so lets give them a known password utf8 valid pasword
+ */
+ for (i = 0; i < sizeof(dummybuf) - 1; i++)
+ dummybuf[i] = 'a' + (random() % 25);
+ dummybuf[sizeof(dummybuf) - 1] = '\0';
/* Zero all fields in request structure */
memset(&princ, 0, sizeof(princ));