From 62870c73bdda16814ffe2c062b76679da5dbb164 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Wed, 28 Mar 2012 07:40:32 +0200 Subject: [PATCH] check if update flags are allowed. --- ykpers-args.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ykpers-args.c b/ykpers-args.c index 11a7499..5211f1f 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -531,6 +531,25 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, } } + if (update_seen) { + struct config_st *core_config = (struct config_st *) ykp_core_config(cfg); + if ((core_config->tktFlags & TKTFLAG_UPDATE_MASK) != core_config->tktFlags) { + fprintf(stderr, "Unallowed ticket flags with update.\n"); + *exit_code = 1; + return 0; + } + if ((core_config->cfgFlags & CFGFLAG_UPDATE_MASK) != core_config->cfgFlags) { + fprintf(stderr, "Unallowed cfg flags with update.\n"); + *exit_code = 1; + return 0; + } + if ((core_config->extFlags & EXTFLAG_UPDATE_MASK) != core_config->extFlags) { + fprintf(stderr, "Unallowed ext flags with update.\n"); + *exit_code = 1; + return 0; + } + } + if (*aesviahash) { bool long_key_valid = false; int res = 0; -- 2.39.5