diff options
| author | Paul Park <pjpark@mit.edu> | 1995-07-31 20:03:54 +0000 |
|---|---|---|
| committer | Paul Park <pjpark@mit.edu> | 1995-07-31 20:03:54 +0000 |
| commit | 556aaf10700f3e327eb5375b424bca268d8edeaf (patch) | |
| tree | 3be24a86e9310bbebdbb306aca5af1146b8df7eb /src/admin/create | |
| parent | 9a12a0af6c65e74fc4437bc19d54cff46bedd960 (diff) | |
| download | krb5-556aaf10700f3e327eb5375b424bca268d8edeaf.tar.gz krb5-556aaf10700f3e327eb5375b424bca268d8edeaf.tar.xz krb5-556aaf10700f3e327eb5375b424bca268d8edeaf.zip | |
Use new admin string conversion routines
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6366 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/admin/create')
| -rw-r--r-- | src/admin/create/ChangeLog | 6 | ||||
| -rw-r--r-- | src/admin/create/kdb5_create.M | 8 | ||||
| -rw-r--r-- | src/admin/create/kdb5_create.c | 26 |
3 files changed, 28 insertions, 12 deletions
diff --git a/src/admin/create/ChangeLog b/src/admin/create/ChangeLog index 3f2447ea6..9dae421a6 100644 --- a/src/admin/create/ChangeLog +++ b/src/admin/create/ChangeLog @@ -1,4 +1,10 @@ +Mon Jul 31 15:45:49 EDT 1995 Paul Park (pjpark@mit.edu) + * kdb5_create.c - Use new admin string conversion routines. + * kdb5_create.M - Remove "string representation of integer" for keytype + and etype. + + Thu Jul 27 02:59:05 1995 Chris Provenzano (proven@mit.edu) * kdb5_create.c : Use new kdb format. diff --git a/src/admin/create/kdb5_create.M b/src/admin/create/kdb5_create.M index 109e2e07b..4a4fc4b29 100644 --- a/src/admin/create/kdb5_create.M +++ b/src/admin/create/kdb5_create.M @@ -67,8 +67,7 @@ created; by default the database is in DEFAULT_DBM_FILE (normally The .B \-k .I keytype -option specifies the key type (as an ascii representation of a decimal -number) of the master key in the database; the default is KEYTYPE_DES. +option specifies the key type of the master key in the database. .PP The .B \-M @@ -79,9 +78,8 @@ the default is KRB5_KDB_M_NAME (usually "K/M" in the KDC's realm). The .B \-e .I enctype -option specifies the encryption type (as an ascii representation of a decimal -number) to be used when placing entries in -the database; the default is the default encryption type for the master +option specifies the encryption type to be used when placing entries in +the database. keytype. .SH SEE ALSO krb5(3), krb5kdc(8) diff --git a/src/admin/create/kdb5_create.c b/src/admin/create/kdb5_create.c index ef243c6d6..9eed9c956 100644 --- a/src/admin/create/kdb5_create.c +++ b/src/admin/create/kdb5_create.c @@ -147,8 +147,10 @@ char *argv[]; realm = optarg; break; case 'k': - master_keyblock.keytype = atoi(optarg); - keytypedone++; + if (!krb5_string_to_keytype(optarg, &master_keyblock.keytype)) + keytypedone++; + else + com_err(argv[0], 0, "%s is an invalid keytype", optarg); break; case 'M': /* master key name in DB */ mkey_name = optarg; @@ -157,7 +159,9 @@ char *argv[]; mkey_password = optarg; break; case 'e': - etype = atoi(optarg); + if (krb5_string_to_enctype(optarg, &etype)) + com_err(argv[0], 0, "%s is an invalid encryption type", + optarg); break; case '?': default: @@ -219,8 +223,12 @@ char *argv[]; master_keyblock.keytype = DEFAULT_KDC_KEYTYPE; if (!valid_keytype(master_keyblock.keytype)) { - com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, - "while setting up keytype %d", master_keyblock.keytype); + char tmp[32]; + if (krb5_keytype_to_string(master_keyblock.keytype, tmp, sizeof(tmp))) + com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, + "while setting up keytype %d", master_keyblock.keytype); + else + com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, tmp); exit(1); } @@ -228,8 +236,12 @@ char *argv[]; etype = DEFAULT_KDC_ETYPE; if (!valid_etype(etype)) { - com_err(argv[0], KRB5_PROG_ETYPE_NOSUPP, - "while setting up etype %d", etype); + char tmp[32]; + if (krb5_enctype_to_string(etype, tmp, sizeof(tmp))) + com_err(argv[0], KRB5_PROG_ETYPE_NOSUPP, + "while setting up etype %d", etype); + else + com_err(argv[0], KRB5_PROG_ETYPE_NOSUPP, tmp); exit(1); } krb5_use_cstype(context, &master_encblock, etype); |
