From: Sam Hartman Date: Fri, 26 Jan 1996 21:45:46 +0000 (+0000) Subject: Implement -e option to list that X-Git-Tag: krb5-1.0-beta6~556 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ede70a16e16f5f111b4c822532458b648b2a4108;p=krb5.git Implement -e option to list that shows enctypes associated with a key. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7396 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/ktutil/ChangeLog b/src/kadmin/ktutil/ChangeLog index 6bc63eb7a..01a2505b1 100644 --- a/src/kadmin/ktutil/ChangeLog +++ b/src/kadmin/ktutil/ChangeLog @@ -1,5 +1,7 @@ Fri Jan 26 00:06:50 1996 Sam Hartman + * ktutil.c (ktutil_list): Implement -e option to show enctypes. + * ktutil_funcs.c (ktutil_write_srvtab): Write v4 version properly. Previous code was endien dependent. diff --git a/src/kadmin/ktutil/ktutil.c b/src/kadmin/ktutil/ktutil.c index a295c8f22..e03764e90 100644 --- a/src/kadmin/ktutil/ktutil.c +++ b/src/kadmin/ktutil/ktutil.c @@ -1,7 +1,7 @@ /* * kadmin/ktutil/ktutil.c * - * Copyright 1995 by the Massachusetts Institute of Technology. + * Copyright 1995, 1996 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -170,7 +170,7 @@ void ktutil_list(argc, argv) krb5_error_code retval; krb5_kt_list lp; struct tm *stime; - int show_time = 0, show_keys = 0; + int show_time = 0, show_keys = 0, show_enctype = 0; int i, j; char *pname; @@ -183,6 +183,12 @@ void ktutil_list(argc, argv) show_keys++; continue; } +if ( (strlen(argv[i]) == 2)&& + (!strncmp(argv[i],"-e",2))) { + show_enctype = 1; + continue; +} + fprintf(stderr, "%s: illegal arguments\n", argv[0]); return; } @@ -214,6 +220,16 @@ void ktutil_list(argc, argv) printf(fmtbuf); } printf("%40s", pname); + if (show_enctype) { + static char buf[256]; + if ((retval = krb5_enctype_to_string( + lp->entry->key.enctype, buf, 256))) { + com_err(argv[0], retval, "While converting enctype to string"); + return; + } + printf(" (%s) ", buf); + } + if (show_keys) { printf(" (0x"); for (j = 0; j < lp->entry->key.length; j++)