Skip to content

Commit

Permalink
When we display enctypes, display the input name rather than the
Browse files Browse the repository at this point in the history
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
  • Loading branch information
greghudson committed Jun 8, 2010
1 parent c38c242 commit 27388a6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/clients/klist/klist.c
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/kadmin/cli/kadmin.c
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/kadmin/cli/keytab.c
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/kadmin/dbutil/kdb5_mkey.c
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/kadmin/dbutil/kdb5_stash.c
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/kadmin/ktutil/ktutil.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 27388a6

Please sign in to comment.