From fe73ac62fbda1d4e563ef03114813f148c7d321e Mon Sep 17 00:00:00 2001 From: Ben Kaduk Date: Fri, 12 Jul 2013 12:53:46 -0400 Subject: [PATCH] Use the string form of key types in asetkey Check for rxkad-k5 keys in the six-argument form and warn they are unsupported. Do sanity-checking on the type. Change-Id: I571fcf88744dec271265e6a47f7d9831f867115b --- src/aklog/asetkey.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/aklog/asetkey.c b/src/aklog/asetkey.c index 7fe95df17..7cbcba5bd 100644 --- a/src/aklog/asetkey.c +++ b/src/aklog/asetkey.c @@ -197,13 +197,24 @@ addKey(struct afsconf_dir *dir, int argc, char **argv) { kvno = atoi(argv[3]); if (type == afsconf_rxkad) { typedKey = keyFromCommandLine(afsconf_rxkad, kvno, 0, argv[5], 8); + } else if (type == afsconf_rxkad_krb5){ + fprintf(stderr, "Raw keys for afsconf_rxkad_krb5 are unsupported"); + exit(1); } else { fprintf(stderr, "Unknown key type %s\n", argv[2]); exit(1); } break; case 7: - typedKey = keyFromKeytab(atoi(argv[3]), atoi(argv[2]), atoi(argv[4]), argv[5], argv[6]); + type = stringToType(argv[2]); + kvno = atoi(argv[3]); + if (type == afsconf_rxkad || type == afsconf_rxkad_krb5) { + typedKey = keyFromKeytab(kvno, type, atoi(argv[4]), argv[5], + argv[6]); + } else { + fprintf(stderr, "Unknown key type %s\n", argv[2]); + exit(1); + } break; default: fprintf(stderr, "%s add: usage is '%s add " -- 2.39.5