From aae35789bfa57ef6cc8eda49b241a1daf72b9d6e Mon Sep 17 00:00:00 2001 From: Paul Park Date: Mon, 21 Aug 1995 21:12:06 +0000 Subject: [PATCH] Use symbolic names for keytype and enctype git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6555 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/convert/ChangeLog | 6 ++++++ src/admin/convert/kdb5_convert.M | 7 +++---- src/admin/convert/kdb5_convert.c | 10 +++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/admin/convert/ChangeLog b/src/admin/convert/ChangeLog index 29319bbe7..20d58958c 100644 --- a/src/admin/convert/ChangeLog +++ b/src/admin/convert/ChangeLog @@ -1,4 +1,10 @@ +Mon Aug 21 16:44:07 EDT 1995 Paul Park (pjpark@mit.edu) + * kdb5_convert.c - Interpret -k and -e arguments as strings instead of + string representations of integers (e.g. -e des-cbc-md5). + * kdb5_convert.M - Remove "ascii representation of a decimal number". + + Thu Jul 27 14:59:53 EDT 1995 Paul Park (pjpark@mit.edu) * configure.in - Add --with-dbm and check for already checking for dbm. diff --git a/src/admin/convert/kdb5_convert.M b/src/admin/convert/kdb5_convert.M index 22a32e473..522766a5f 100644 --- a/src/admin/convert/kdb5_convert.M +++ b/src/admin/convert/kdb5_convert.M @@ -115,8 +115,8 @@ dump file rather than from a principal database. 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; the default +is KEYTYPE_DES. .PP The .B \-M @@ -127,8 +127,7 @@ the default is KRB5_KDB_M_NAME (usually "K/M" in the local 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 +option specifies the encryption type to be used when placing entries in the database; the default is the default encryption type for the master keytype. .PP diff --git a/src/admin/convert/kdb5_convert.c b/src/admin/convert/kdb5_convert.c index b4c4b8e17..73e6f8a87 100644 --- a/src/admin/convert/kdb5_convert.c +++ b/src/admin/convert/kdb5_convert.c @@ -212,14 +212,18 @@ char *argv[]; verbose = 1; 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; 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 'n': v4manual++; -- 2.26.2