From: Paul Park Date: Tue, 8 Aug 1995 22:02:57 +0000 (+0000) Subject: Add {add,del}_key_type commands X-Git-Tag: krb5-1.0-beta6~1359 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b35189900fcd86d5d5e399fd1c32bab98a15bf62;p=krb5.git Add {add,del}_key_type commands git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6467 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/v5client/ChangeLog b/src/kadmin/v5client/ChangeLog index 730f62c37..da3a8957a 100644 --- a/src/kadmin/v5client/ChangeLog +++ b/src/kadmin/v5client/ChangeLog @@ -1,4 +1,16 @@ +Tue Aug 8 17:27:04 EDT 1995 Paul Park (pjpark@mit.edu) + * kadmin5_ct.ct - Add add_key_type and del_key_type to add/delete a + particular key/salt pair. + * kadmin5.c - Add kadmin_{add,del}_key_type to support add_key_type + and del_key_type commands. Change -l processing to use + krb5_string_to_deltat(). + * kadmin5.h - Update prototypes and remove obsolete functions. + * network.c - Add new protocol error message support. + * kadmin5.M - Remove descriptions of obsolete syntax or syntax which + has been made common among utilities. + + Fri Aug 4 16:13:20 EDT 1995 Paul Park (pjpark@mit.edu) * kadmin5.c - Replace explicit hand-decoded integers with macros. diff --git a/src/kadmin/v5client/kadmin5.M b/src/kadmin/v5client/kadmin5.M index 527cc2722..3901a5ff6 100644 --- a/src/kadmin/v5client/kadmin5.M +++ b/src/kadmin/v5client/kadmin5.M @@ -36,7 +36,7 @@ kadmin5 \- administer a Kerberos principal database over the network. .I ccache ] [ .B \-l -.I [hours:]minutes +.I deltatime ] [ .B \-d ] [ @@ -60,7 +60,7 @@ specifies a principal name to use instead of the default .B ccache specifies a credentials cache to use instead of the default. .IP \-l -.B [hours:]minutes +.B deltatime specifies the lifetime for an administrative ticket, if one needs to be acquired. .IP \-d @@ -129,6 +129,14 @@ Add new entry to Kerberos database, using a random key. .IP change_rnd_key,crk Change key of an entry in the Kerberos database (selecting a new random key). +.IP add_key_type,akt +Add new key type to an existing Kerberos principal (prompting for old +password). + +.IP del_key_type,dkt +Delete key type from an existing Kerberos principal (prompting for old +password). + .IP delete_entry,delent,del Delete an entry from the database. @@ -167,26 +175,17 @@ and commands, an optional list of principal options may be specified. The following options may be specified: .TP i -.I kvno= -Specifies the key version number for the principal. -.TP i -.I maxlife= -Specifies the maximum ticket life for the principal in seconds. +.I maxlife= +Specifies the maximum ticket life for the principal. .TP i -.I maxrenewlife= -Specifies the maximum renewable ticket life for the principal in seconds. +.I maxrenewlife= +Specifies the maximum renewable ticket life for the principal. .TP i .I expiration= -Specifies the expiration date and time of the principal. See below for the -format of -.I . +Specifies the expiration date and time of the principal. .TP i .I pwexpiration= -Specifies the expiration date and time of the principal's password. See below for the format of -.I . -.TP i -.I salttype=[v5|v4|norealm|onlyrealm|special] -Indicates the salt type. +Specifies the expiration date and time of the principal's password. .TP i .I [+/-]postdateable Specifies that tickets for this principal [are/are not] postdateable. @@ -194,7 +193,7 @@ Specifies that tickets for this principal [are/are not] postdateable. .I [+/-]forwardable Specifies that tickets for this principal [are/are not] forwardable. .TP i -.I [+/-]tgt_req +.I [+/-]tgt-based Specifies that TGT-based requests for this principal [are/are not] allowed. .TP i .I [+/-]renewable @@ -203,11 +202,11 @@ Specifies that tickets for this principal [are/are not] renewable. .I [+/-]proxiable Specifies that tickets for this principal [are/are not] proxiable. .TP i -.I [+/-]dup_skey +.I [+/-]dup-skey Specifies that tickets issued by this service [may/may not] be encrypted using the session key instead of the private key. .TP i -.I [+/-]allow_tickets +.I [+/-]allow-tickets Specifies that tickets for this principal [are/are not] allowed. .TP i .I [+/-]preauth @@ -217,10 +216,10 @@ Specifies that preauthorization [is/is not] required for this principal. Specifies that hardware preauthorization [is/is not] required for this principal. .TP i -.I [+/-]pwchange_req +.I [+/-]pwchange Specifies that a password change [is/is not] required for this principal. .TP i -.I [+/-]server +.I [+/-]service Specifies that this principal [is/is not] allowed to be a service. .TP i .I [+/-]pwservice @@ -228,57 +227,6 @@ Specifies that this principal [is/is not] the password changing service. .TP i .I [+/-]md5 Specifies that DES MD5 [is/is not] supported for this principal. - -.SH Date Format -The format of -may be one of the following, where -.I yy -is the last two digits of the year; -.I mm -is the month number (with a leading zero if less than 10); -.I dd -is the day number in the month (with a leading zero if less than 10); -.I HH -is the hour number (24-hour clock); -.I MM -is the minute number; and -.I SS -is the second number: -.TP i -.I yy.mm.dd.HH.MM.SS -e.g. 95.09.01.00.00.00 for midnight on September 1, 1995. -.TP i -.I yymmddHHMMSS -e.g. 950901000000 for midnight on September 1, 1995. -.PP -If the -.B strptime(3) -function is available, then the following formats are also supported. -.PP -.TP i -.I yymmddHHMM -e.g. 9509010000 for midnight on September 1, 1995. -.TP i -.I HHMMSS -e.g. 200000 for 8pm tonight. -.TP i -.I HHMM -e.g. 2100 for 9pm tonight. -.TP i -.I HH:MM:SS -e.g. 20:00:00 for 8pm tonight. -.TP i -.I HH:MM -e.g. 21:00 for 9pm tonight. -.TP i -.I locale-dependent short format (mm/dd/yy:HH:MM:SS) in U.S. -.e.g 01/09/95:00:00:00 for midnight on September 1, 1995. -.TP i -.I dd--yyyy:HH:MM:SS -e.g. 01-Sep-1995:00:00:00 for midnight on September 1, 1995. -.TP i -.I dd--yyyy:HH:MM -e.g. 01-Sep-1995:00:00 for midnight on September 1, 1995. .PP .SH SEE ALSO -kadmind5(8), kpasswd(1), strptime(3) +kadmind5(8), kpasswd(1) diff --git a/src/kadmin/v5client/kadmin5.c b/src/kadmin/v5client/kadmin5.c index 627a894e3..8f533d7ca 100644 --- a/src/kadmin/v5client/kadmin5.c +++ b/src/kadmin/v5client/kadmin5.c @@ -120,6 +120,16 @@ static const char *cpw_prompt1_fmt = " Enter new password for %s: "; static const char *cpw_prompt2_fmt = "Re-enter new password for %s: "; static const char *cpw_succ_fmt = "password changed for %s"; static const char *cpw_nochange_fmt = "password not changed for %s"; +static const char *akt_usage_fmt = "usage is %s principal [key:salt]+"; +static const char *akt_prompt1_fmt = " Enter current password for %s: "; +static const char *akt_prompt2_fmt = "Re-enter current password for %s: "; +static const char *akt_succ_fmt = "keytypes successfully added for %s"; +static const char *akt_nochange_fmt = "keytypes not added for %s"; +static const char *dkt_usage_fmt = "usage is %s principal [key:salt[:kvno]]+"; +static const char *dkt_prompt1_fmt = " Enter current password for %s: "; +static const char *dkt_prompt2_fmt = "Re-enter current password for %s: "; +static const char *dkt_succ_fmt = "keytypes successfully deleted for %s"; +static const char *dkt_nochange_fmt = "keytypes not deleted for %s"; static const char *dprinc_usage_fmt = "usage is %s [%s] principal [...]"; static const char *del_conf_fmt = "Enter '%c' to delete principal %s: "; static const char del_conf_char = 'y'; @@ -669,6 +679,178 @@ kadmin_change_rnd(argc, argv) } } +/* + * kadmin_add_key_type() - Add key/salt types. + */ +void +kadmin_add_key_type(argc, argv) + int argc; + char *argv[]; +{ + int i; + krb5_int32 proto_stat; + krb5_int32 ncomps; + krb5_data *complist; + krb5_error_code kret; + krb5_data *arglist; + char *p1; + char *p2; + char *opass; + int oplen; + + /* + * Command syntax is: akt principal [keysalt]+ + */ + if (argc < 3) { + com_err(argv[0], 0, akt_usage_fmt, argv[0]); + return; + } + + requestname = argv[0]; + kret = 0; + arglist = (krb5_data *) malloc((size_t)(sizeof(krb5_data)*(argc-2))); + p1 = (char *) malloc(strlen(akt_prompt1_fmt)+strlen(argv[argc-1])+1); + p2 = (char *) malloc(strlen(akt_prompt2_fmt)+strlen(argv[argc-1])+1); + opass = (char *) malloc(KRB5_ADM_MAX_PASSWORD_LEN); + if (arglist && p1 && p2 && opass) { + memset(arglist, 0, (size_t) (sizeof(krb5_data)*(argc-2))); + sprintf(p1, akt_prompt1_fmt, argv[1]); + sprintf(p2, akt_prompt2_fmt, argv[1]); + for (i=2; i