mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 23:38:49 +00:00
Merge pull request #574 from PR0M3TH3AN/codex/update-validate_bip85_seed-validation-logic
Improve BIP‑85 seed validation
This commit is contained in:
@@ -87,6 +87,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from local_bip85.bip85 import BIP85, Bip85Error
|
from local_bip85.bip85 import BIP85, Bip85Error
|
||||||
from bip_utils import Bip39SeedGenerator, Bip39MnemonicGenerator, Bip39Languages
|
from bip_utils import Bip39SeedGenerator, Bip39MnemonicGenerator, Bip39Languages
|
||||||
|
from mnemonic import Mnemonic
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from utils.fingerprint_manager import FingerprintManager
|
from utils.fingerprint_manager import FingerprintManager
|
||||||
@@ -909,11 +910,11 @@ class PasswordManager:
|
|||||||
bool: True if valid, False otherwise.
|
bool: True if valid, False otherwise.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
words = seed.split()
|
checker = Mnemonic("english")
|
||||||
if len(words) != 12:
|
if checker.check(seed):
|
||||||
return False
|
return True
|
||||||
# Additional validation can be added here if needed (e.g., word list checks)
|
logging.error("Invalid BIP-85 seed provided")
|
||||||
return True
|
return False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error validating BIP-85 seed: {e}")
|
logging.error(f"Error validating BIP-85 seed: {e}")
|
||||||
return False
|
return False
|
||||||
|
Reference in New Issue
Block a user