summaryrefslogtreecommitdiffstats
path: root/src/kadmin/cli
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-03-21 18:07:41 -0400
committerGreg Hudson <ghudson@mit.edu>2014-03-26 18:12:31 -0400
commit54c97cd0c435f78880d80541a20cf7f08928705d (patch)
tree2487b4ccf15dcaaaec76fe5969fe28bbcbb274f1 /src/kadmin/cli
parent3890d1dff87a839efec38a77dcc88574ed65f4a9 (diff)
downloadkrb5-54c97cd0c435f78880d80541a20cf7f08928705d.tar.gz
krb5-54c97cd0c435f78880d80541a20cf7f08928705d.tar.xz
krb5-54c97cd0c435f78880d80541a20cf7f08928705d.zip
Improve salt type display in kadmin getprinc
In krb5_salttype_to_string, output the salt type name we would recognize as input. In the output of getprinc, display the enctype and salt type in a form we would accept--either enctype:salttype if the salt type is not the default, or just the enctype if it is. Update t_mkey.py and t_salt.py to expect the new output format. Update documentation examples to show the new format. ticket: 5958
Diffstat (limited to 'src/kadmin/cli')
-rw-r--r--src/kadmin/cli/kadmin.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c
index 733e784c9..1ce30ee1c 100644
--- a/src/kadmin/cli/kadmin.c
+++ b/src/kadmin/cli/kadmin.c
@@ -1445,15 +1445,16 @@ kadmin_getprinc(int argc, char *argv[])
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);
- if (key_data->key_data_ver > 1) {
+ printf("Key: vno %d, %s", key_data->key_data_kvno, enctype);
+ if (key_data->key_data_ver > 1 &&
+ key_data->key_data_type[1] != KRB5_KDB_SALTTYPE_NORMAL) {
if (krb5_salttype_to_string(key_data->key_data_type[1],
salttype, sizeof(salttype)))
snprintf(salttype, sizeof(salttype), _("<Salt type 0x%x>"),
key_data->key_data_type[1]);
- printf("%s\n", salttype);
- } else
- printf(_("no salt\n"));
+ printf(":%s", salttype);
+ }
+ printf("\n");
}
printf(_("MKey: vno %d\n"), dprinc.mkvno);