From 7accfc986e7e9a35cc4ac9562c20177b633fd063 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Fri, 18 Oct 1996 20:20:32 +0000 Subject: [PATCH] * kadmin.c (kadmin_addprinc): use a studly temporary password when creating a principal with a random key (no, the security of this operation does not depend on the secrecy of the password) [krb5-admin/115] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9210 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/cli/ChangeLog | 5 +++++ src/kadmin/cli/kadmin.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/kadmin/cli/ChangeLog b/src/kadmin/cli/ChangeLog index 0224f3ec5..4c6805c50 100644 --- a/src/kadmin/cli/ChangeLog +++ b/src/kadmin/cli/ChangeLog @@ -1,5 +1,10 @@ Fri Oct 18 13:47:01 1996 Barry Jaspan + * kadmin.c (kadmin_addprinc): use a studly temporary password when + creating a principal with a random key (no, the security of this + operation does not depend on the secrecy of the password) + [krb5-admin/115] + * getdate.y: remove military timezones and plain integeres as part of date specifications, to reduce confusion by redundancy [krb5-admin/15] diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index 9d12a4c79..c1275dad9 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -775,11 +775,16 @@ void kadmin_addprinc(argc, argv) kadm5_principal_ent_rec princ; kadm5_policy_ent_rec defpol; long mask; - int randkey = 0; + int randkey = 0, i; char *pass, *canon; krb5_error_code retval; - static char newpw[1024]; + static char newpw[1024], dummybuf[256]; static char prompt1[1024], prompt2[1024]; + + if (dummybuf[0] == 0) { + for (i = 0; i < 256; i++) + dummybuf[i] = (i+1) % 256; + } /* Zero all fields in request structure */ memset(&princ, 0, sizeof(princ)); @@ -818,7 +823,7 @@ void kadmin_addprinc(argc, argv) if (randkey) { /* do special stuff if -randkey specified */ princ.attributes |= KRB5_KDB_DISALLOW_ALL_TIX; /* set notix */ mask |= KADM5_ATTRIBUTES; - pass = "dummy"; + pass = dummybuf; } else if (pass == NULL) { int i = sizeof (newpw) - 1; -- 2.26.2