[wizard] Use secrets module for fallback AP password generation (#13864)

This commit is contained in:
J. Nick Koston
2026-02-09 03:25:41 -06:00
committed by GitHub
parent 6ee185c58a
commit 5370687001
2 changed files with 13 additions and 3 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
import base64
from pathlib import Path
import random
import secrets
import string
from typing import Literal, NotRequired, TypedDict, Unpack
@@ -130,7 +129,7 @@ def wizard_file(**kwargs: Unpack[WizardFileKwargs]) -> str:
if len(ap_name) > 32:
ap_name = ap_name_base
kwargs["fallback_name"] = ap_name
kwargs["fallback_psk"] = "".join(random.choice(letters) for _ in range(12))
kwargs["fallback_psk"] = "".join(secrets.choice(letters) for _ in range(12))
base = BASE_CONFIG_FRIENDLY if kwargs.get("friendly_name") else BASE_CONFIG