sao: add decoder helpers, hash checks

This commit is contained in:
2023-11-09 18:11:58 -05:00
parent 95234a421c
commit 3c06f46644
6 changed files with 117 additions and 8 deletions

View File

@ -51,8 +51,25 @@ class SaoCryptConfig:
self.__config, "sao", "crypt", "iv", default=""
)
class SaoHashConfig:
def __init__(self, parent_config: "SaoConfig"):
self.__config = parent_config
@property
def verify_hash(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "sao", "hash", "verify_hash", default=False
)
@property
def hash_base(self) -> str:
return CoreConfig.get_config_field(
self.__config, "sao", "hash", "hash_base", default=""
)
class SaoConfig(dict):
def __init__(self) -> None:
self.server = SaoServerConfig(self)
self.crypt = SaoCryptConfig(self)
self.hash = SaoHashConfig(self)