]> err.no Git - yubikey-personalization/commitdiff
defaults for updates
authorKlas Lindfors <klas@yubico.com>
Wed, 28 Mar 2012 11:21:03 +0000 (13:21 +0200)
committerKlas Lindfors <klas@yubico.com>
Wed, 28 Mar 2012 11:34:05 +0000 (13:34 +0200)
by default add ALLOW_UPDATE to updates.

ykpers.c

index e96140b24ee095e0d0fc84dfd0afc055b3731fd9..d18be632fb6e759741a36fe13e9bb6939e57e791 100644 (file)
--- a/ykpers.c
+++ b/ykpers.c
@@ -121,6 +121,10 @@ int ykp_configure_command(YKP_CONFIG *cfg, uint8_t command, YK_STATUS *st)
                break;
        case SLOT_UPDATE1:
        case SLOT_UPDATE2:
+               {
+                       struct config_st *core_config = (struct config_st *) ykp_core_config(cfg);
+                       core_config->extFlags |= EXTFLAG_ALLOW_UPDATE;
+               }
        case SLOT_SWAP:
                if (!((cfg->yk_major_version == 2 && cfg->yk_minor_version >= 3)
                          || cfg->yk_major_version > 2)) {
@@ -131,9 +135,9 @@ int ykp_configure_command(YKP_CONFIG *cfg, uint8_t command, YK_STATUS *st)
        default:
                ykp_errno = YKP_EINVCONFNUM;
                return 0;
-  }
-  cfg->command = command;
-  return 1;
+       }
+       cfg->command = command;
+       return 1;
 }
 
 int ykp_configure_for(YKP_CONFIG *cfg, int confnum, YK_STATUS *st)