Remove Legacy Credential Bootstrap Paths
Decouple user provisioning from HTTPS identity storage while retaining compatible v1 user records and migrating TLS material to the credential-free v2 format. Add focused security regression coverage and update operator documentation.
This commit is contained in:
@@ -26,7 +26,7 @@ typedef struct { int unused; } user_principal_t;
|
||||
'''
|
||||
fakes = r'''
|
||||
static bool remote, web;
|
||||
static unsigned stops, reboots, scheduled, waits, rotations;
|
||||
static unsigned stops, reboots, scheduled, waits, rotations, usages;
|
||||
static esp_err_t schedule_result, stop_result;
|
||||
static admin_ssh_deferred_action_type_t last_action;
|
||||
bool admin_ssh_console_dispatch_is_remote(void) { return remote; }
|
||||
@@ -42,13 +42,11 @@ static esp_err_t web_serial_transport_clear_counters(void) { assert(false); retu
|
||||
static void esp_restart(void) { ++reboots; }
|
||||
static void vTaskDelay(unsigned delay) { assert(delay==100); ++waits; }
|
||||
#define pdMS_TO_TICKS(ms) (ms)
|
||||
static void print_usage(void) { assert(false); }
|
||||
static void print_usage(void) { ++usages; }
|
||||
static int web_diagnostics_command(const char *action) { assert(!strcmp(action, "show")); return 0; }
|
||||
static int show_status(void) { assert(false); return 1; }
|
||||
static int show_counters(void) { assert(false); return 1; }
|
||||
static int show_credentials(void) { assert(false); return 1; }
|
||||
static int show_certificate(void) { assert(false); return 1; }
|
||||
static int rotate_credentials(void) { assert(false); return 1; }
|
||||
static int rotate_certificate(void) { ++rotations; return 0; }
|
||||
static int reset_material(void) { assert(false); return 1; }
|
||||
static bool force_is_present(int argc, char **argv, int expected) {
|
||||
@@ -57,6 +55,18 @@ static bool force_is_present(int argc, char **argv, int expected) {
|
||||
'''
|
||||
tests = r'''
|
||||
int main(void) {
|
||||
char *removed[]={"web", "credentials", "show", "--force"};
|
||||
for (unsigned origin=0; origin<3; ++origin) {
|
||||
remote=origin!=0; web=origin==2;
|
||||
removed[2]="show";
|
||||
assert(command_web(2,removed)==1);
|
||||
assert(command_web(3,removed)==1);
|
||||
removed[2]="rotate";
|
||||
assert(command_web(3,removed)==1);
|
||||
assert(command_web(4,removed)==1);
|
||||
}
|
||||
assert(usages==12 && !stops && !scheduled && !rotations);
|
||||
remote=web=false;
|
||||
char *diagnostics[]={"web", "diagnostics", "show"};
|
||||
assert(command_web(3, diagnostics)==0 && !stops && !scheduled);
|
||||
char *stop[]={"web", "stop"};
|
||||
|
||||
Reference in New Issue
Block a user