diff options
author | ps57422 <none@none> | 2007-08-21 12:28:27 -0700 |
---|---|---|
committer | ps57422 <none@none> | 2007-08-21 12:28:27 -0700 |
commit | a49a392f179e40c74ea8903bf2793b2aa49efdf1 (patch) | |
tree | 60ffb27343919f571cf35a21a4e73a5a1e871d1c | |
parent | 07ea95b60d67b304d76a5e8bc17580c913db97ac (diff) | |
download | illumos-joyent-a49a392f179e40c74ea8903bf2793b2aa49efdf1.tar.gz |
6538725 ktutil can't list keys with unknown (unsupported) encryption types.
6558280 klist and ktutil should be more detailed about message displayed for unsupported encryption type
-rw-r--r-- | usr/src/cmd/krb5/kadmin/ktutil/ktutil.c | 15 | ||||
-rw-r--r-- | usr/src/cmd/krb5/klist/klist.c | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/usr/src/cmd/krb5/kadmin/ktutil/ktutil.c b/usr/src/cmd/krb5/kadmin/ktutil/ktutil.c index 848a14da62..317e1f3155 100644 --- a/usr/src/cmd/krb5/kadmin/ktutil/ktutil.c +++ b/usr/src/cmd/krb5/kadmin/ktutil/ktutil.c @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -318,10 +318,15 @@ void ktutil_list(argc, argv) static char buf[256]; if ((retval = krb5_enctype_to_string( lp->entry->key.enctype, buf, 256))) { - com_err(argv[0], retval, - gettext("While converting " - "enctype to string")); - return; + if (retval == EINVAL) + snprintf(buf, sizeof(buf), gettext("unsupported encryption type %d"), + lp->entry->key.enctype); + else { + com_err(argv[0], retval, + gettext("While converting " + "enctype to string")); + return; + } } printf(" (%s) ", buf); } diff --git a/usr/src/cmd/krb5/klist/klist.c b/usr/src/cmd/krb5/klist/klist.c index f564e6790b..22c9a152ef 100644 --- a/usr/src/cmd/krb5/klist/klist.c +++ b/usr/src/cmd/krb5/klist/klist.c @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -526,12 +526,12 @@ char * etype_string(enctype) krb5_enctype enctype; { - static char buf[100]; + static char buf[256]; krb5_error_code retval; if ((retval = krb5_enctype_to_string(enctype, buf, sizeof(buf)))) { /* XXX if there's an error != EINVAL, I should probably report it */ - sprintf(buf, gettext("etype %d"), enctype); + snprintf(buf, sizeof(buf), gettext("unsupported encryption type %d"), enctype); } return buf; |