mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
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.
(cherry-picked from fe73ac62fb
)
Change-Id: I59fc1702dc1b201340dc033adeb8aa57251feee6
This commit is contained in:
parent
7dea66612a
commit
1cd7e3cff5
@ -197,10 +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 <kvno> <keyfile> "
|
||||
|
Loading…
Reference in New Issue
Block a user