When we display enctypes, display the input name rather than the
authorGreg Hudson <ghudson@mit.edu>
Tue, 8 Jun 2010 17:53:19 +0000 (17:53 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 8 Jun 2010 17:53:19 +0000 (17:53 +0000)
description.  Affects klist -e, kdb5_util list_mkeys, kdb5_util stash
(error message), kadmin getprinc, kadmin ktadd, and ktutil list -e.

ticket: 5014

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24122 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/klist/klist.c
src/kadmin/cli/kadmin.c
src/kadmin/cli/keytab.c
src/kadmin/dbutil/kdb5_mkey.c
src/kadmin/dbutil/kdb5_stash.c
src/kadmin/ktutil/ktutil.c

index 32cf4d0a41d50209b9ff469d547d9224185b1241..f8d3cd87ac7f2d80ec8e60cfa4a790f55b20be67 100644 (file)
@@ -428,7 +428,7 @@ etype_string(enctype)
     static char buf[100];
     krb5_error_code retval;
 
-    if ((retval = krb5_enctype_to_string(enctype, buf, sizeof(buf)))) {
+    if ((retval = krb5_enctype_to_name(enctype, FALSE, buf, sizeof(buf)))) {
         /* XXX if there's an error != EINVAL, I should probably report it */
         snprintf(buf, sizeof(buf), "etype %d", enctype);
     }
index c8ef3eb200a0b37c7809d1cbda3e4ce29c545aa6..9e5bc44796367ddfd1d3045bcb5de6e55b51ce83 100644 (file)
@@ -1380,8 +1380,8 @@ kadmin_getprinc(int argc, char *argv[])
             krb5_key_data *key_data = &dprinc.key_data[i];
             char enctype[BUFSIZ], salttype[BUFSIZ];
 
-            if (krb5_enctype_to_string(key_data->key_data_type[0],
-                                       enctype, sizeof(enctype)))
+            if (krb5_enctype_to_name(key_data->key_data_type[0], FALSE,
+                                     enctype, sizeof(enctype)))
                 snprintf(enctype, sizeof(enctype), "<Encryption type 0x%x>",
                          key_data->key_data_type[0]);
             printf("Key: vno %d, %s, ", key_data->key_data_kvno, enctype);
index a2f8775fb48445efebf3f9aab368533187863d9a..8b291100ea6c41005ff310604827631a7f5a6477 100644 (file)
@@ -473,7 +473,7 @@ etype_string(krb5_enctype enctype)
     static char buf[100];
     krb5_error_code ret;
 
-    ret = krb5_enctype_to_string(enctype, buf, sizeof(buf));
+    ret = krb5_enctype_to_name(enctype, FALSE, buf, sizeof(buf));
     if (ret)
         snprintf(buf, sizeof(buf), "etype %d", enctype);
 
index 83a23ef792d7e43e13ec50849ba14cdc0aa2fa96..6abd796d966a64572219dea1caad664d678c6862 100644 (file)
@@ -668,8 +668,8 @@ kdb5_list_mkeys(int argc, char *argv[])
     for (cur_kb_node = master_keylist; cur_kb_node != NULL;
          cur_kb_node = cur_kb_node->next) {
 
-        if ((retval = krb5_enctype_to_string(cur_kb_node->keyblock.enctype,
-                                             enctype, sizeof(enctype)))) {
+        if ((retval = krb5_enctype_to_name(cur_kb_node->keyblock.enctype,
+                                           FALSE, enctype, sizeof(enctype)))) {
             com_err(progname, retval, "while getting enctype description");
             exit_status++;
             goto cleanup_return;
index 858cf58dc4db7f36233d80492a37dd98c20a3442..b639cd159600784f644d741677b6b0b8ebbe7021 100644 (file)
@@ -118,7 +118,8 @@ kdb5_stash(argc, argv)
 
     if (!krb5_c_valid_enctype(master_keyblock.enctype)) {
         char tmp[32];
-        if (krb5_enctype_to_string(master_keyblock.enctype, tmp, sizeof(tmp)))
+        if (krb5_enctype_to_name(master_keyblock.enctype, FALSE,
+                                 tmp, sizeof(tmp)))
             com_err(progname, KRB5_PROG_KEYTYPE_NOSUPP,
                     "while setting up enctype %d", master_keyblock.enctype);
         else
index 5de9779138533c6e743b8d79a3297490208a6b16..2f39fe764cb767494a70d3568a505a15deba0667 100644 (file)
@@ -252,8 +252,8 @@ void ktutil_list(argc, argv)
         printf("%40s", pname);
         if (show_enctype) {
             static char buf[256];
-            if ((retval = krb5_enctype_to_string(
-                     lp->entry->key.enctype, buf, 256))) {
+            if ((retval = krb5_enctype_to_name(lp->entry->key.enctype, FALSE,
+                                               buf, sizeof(buf)))) {
                 com_err(argv[0], retval, "While converting enctype to string");
                 return;
             }