forked from mtusi2026/mtusi2026lab7
fix(security): scope row locks and add explicit expiry recovery
This commit is contained in:
+5
-4
@@ -161,7 +161,7 @@ def reload_bao():
|
||||
raise TimeoutError("Verified Bao restart/unseal unavailable: " + str(last))
|
||||
|
||||
|
||||
def recover_bao():
|
||||
def recover_bao(*, all_roles=True):
|
||||
# Explicit operator recovery after the server leaf itself has expired.
|
||||
key, root = ca()
|
||||
leaf_key, leaf = sign_leaf(
|
||||
@@ -184,9 +184,10 @@ def recover_bao():
|
||||
operator = Operator()
|
||||
try:
|
||||
operator.unseal()
|
||||
for role in ROLES:
|
||||
if role != "migrate":
|
||||
repair(operator, role)
|
||||
if all_roles:
|
||||
for role in ROLES:
|
||||
if role != "migrate":
|
||||
repair(operator, role)
|
||||
finally:
|
||||
operator.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user