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:
+6
-25
@@ -38,17 +38,9 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
USER_DATABASE_LOAD_STORED = 0,
|
||||
USER_DATABASE_LOAD_MIGRATED_LEGACY,
|
||||
USER_DATABASE_LOAD_EMPTY,
|
||||
} user_database_load_result_t;
|
||||
|
||||
typedef struct {
|
||||
const uint8_t *username;
|
||||
size_t username_length;
|
||||
const uint8_t *password;
|
||||
size_t password_length;
|
||||
} user_database_legacy_credentials_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t user_id;
|
||||
uint32_t auth_generation;
|
||||
@@ -84,25 +76,18 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
bool initialized;
|
||||
bool admin_bootstrapped;
|
||||
uint32_t generation;
|
||||
uint8_t user_count;
|
||||
uint8_t admin_count;
|
||||
user_database_user_snapshot_t users[USER_DATABASE_MAX_USERS];
|
||||
} user_database_snapshot_t;
|
||||
|
||||
esp_err_t user_database_init(const user_database_legacy_credentials_t *legacy,
|
||||
user_database_load_result_t *load_result);
|
||||
/*
|
||||
* Before the first administrator is established, keep the migrated account in
|
||||
* sync with the legacy recovery credential. Once bootstrapped, that credential
|
||||
* remains independent and no longer authenticates Phase 8B network services.
|
||||
*/
|
||||
esp_err_t user_database_sync_legacy_credentials(
|
||||
const user_database_legacy_credentials_t *legacy, bool *synchronized);
|
||||
/* Explicit UART0 recovery: replace unavailable user storage with one legacy user. */
|
||||
esp_err_t user_database_recover_from_legacy(
|
||||
const user_database_legacy_credentials_t *legacy);
|
||||
/* Missing storage is persisted empty; valid v1 records load unchanged.
|
||||
* Corrupt/unsupported storage fails closed and is never automatically replaced. */
|
||||
esp_err_t user_database_init(user_database_load_result_t *load_result);
|
||||
/* Explicit UART0 recovery only; refuses an initialized database. No credentials
|
||||
* are imported or created. Caller enforces physical-console authorization. */
|
||||
esp_err_t user_database_recover_empty(void);
|
||||
esp_err_t user_database_get_snapshot(user_database_snapshot_t *snapshot);
|
||||
|
||||
/* Compact secret-free list, zero-wait mutex acquisition; no key material. */
|
||||
@@ -149,10 +134,6 @@ esp_err_t user_database_authorize_ssh_public_key(
|
||||
esp_err_t user_database_principal_is_current(const user_principal_t *principal,
|
||||
bool *current);
|
||||
|
||||
esp_err_t user_database_bootstrap_admin(const uint8_t *password,
|
||||
size_t password_length);
|
||||
esp_err_t user_database_bootstrap_admin_generated(
|
||||
user_database_generated_password_t *generated_password);
|
||||
esp_err_t user_database_create(const uint8_t *username, size_t username_length,
|
||||
user_role_t role,
|
||||
const uint8_t *password, size_t password_length);
|
||||
|
||||
Reference in New Issue
Block a user