diff options
| author | Chris Provenzano <proven@mit.edu> | 1995-02-09 22:45:35 +0000 |
|---|---|---|
| committer | Chris Provenzano <proven@mit.edu> | 1995-02-09 22:45:35 +0000 |
| commit | 384f6df93ecf37ccb1e9857202b28474494cedee (patch) | |
| tree | f4f0f66629b878002eafaed22e8a8cf1dc0fb377 /src/clients | |
| parent | e17865e36057be4dd07bc080982d25700f1b4b93 (diff) | |
| download | krb5-384f6df93ecf37ccb1e9857202b28474494cedee.tar.gz krb5-384f6df93ecf37ccb1e9857202b28474494cedee.tar.xz krb5-384f6df93ecf37ccb1e9857202b28474494cedee.zip | |
Added -e option to print out encryption types
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4932 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/clients')
| -rw-r--r-- | src/clients/klist/ChangeLog | 3 | ||||
| -rw-r--r-- | src/clients/klist/klist.c | 36 |
2 files changed, 38 insertions, 1 deletions
diff --git a/src/clients/klist/ChangeLog b/src/clients/klist/ChangeLog index 36cd01447..14135d24f 100644 --- a/src/clients/klist/ChangeLog +++ b/src/clients/klist/ChangeLog @@ -1,3 +1,6 @@ +Thu Feb 09 17:43:47 1995 Chris Provenzano (proven@mit.edu) + + * klist.c Added -e option to print out encryption types. Fri Feb 03 22:14:26 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 9c9b3802f..bfc8df7a9 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -33,6 +33,7 @@ extern int optind; extern char *optarg; +int show_etype = 0; int show_flags = 0; char *progname; char *defname; @@ -69,8 +70,11 @@ main(argc, argv) else progname = argv[0]; - while ((c = getopt(argc, argv, "fc:")) != EOF) { + while ((c = getopt(argc, argv, "efc:")) != EOF) { switch (c) { + case 'e': + show_etype = 1; + break; case 'f': show_flags = 1; break; @@ -209,6 +213,16 @@ printtime(tv) stime->tm_sec); } +/* Make sure this list matches the ETYPE order in encryption.h */ +#define ETYPE_MAX 6 +char * etype_string[ETYPE_MAX] = { + "ETYPE_NULL", + "ETYPE_DES_CBC_CRC", + "ETYPE_DES_CBC_MD4", + "ETYPE_DES_CBC_MD5", + "ETYPE_RAW_DES_CBC", + NULL }; + void show_credential(kcontext, cred) krb5_context kcontext; @@ -252,6 +266,25 @@ show_credential(kcontext, cred) fputs("renew until ", stdout); printtime(cred->times.renew_till); } + + if (show_etype) { + krb5_enctype etype = cred->keyblock.etype; + + if (!first) + putchar('\n'); + + printf("\tEncryption type: "); + if (etype != ETYPE_UNKNOWN) { + if ((etype < ETYPE_MAX) && etype_string[etype]) { + printf("%s", etype_string[etype]); + } else { + printf("UNRECOGNIZED"); + } + } else { + printf("ETYPE_UNKNOWN"); + } + } + if (show_flags) { flags = flags_string(cred); if (flags && *flags) { @@ -263,6 +296,7 @@ show_credential(kcontext, cred) first = 0; } } + putchar('\n'); free(name); free(sname); |
