mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-14 01:59:36 +00:00
@@ -328,7 +328,9 @@ Back in the Settings menu you can:
|
|||||||
* Select `11` to change the inactivity timeout.
|
* Select `11` to change the inactivity timeout.
|
||||||
* Choose `12` to lock the vault and require re-entry of your password.
|
* Choose `12` to lock the vault and require re-entry of your password.
|
||||||
* Select `13` to view seed profile stats. The summary lists counts for
|
* Select `13` to view seed profile stats. The summary lists counts for
|
||||||
passwords, TOTP codes, SSH keys, seed phrases, and PGP keys.
|
passwords, TOTP codes, SSH keys, seed phrases, and PGP keys. It also shows
|
||||||
|
whether both the encrypted database and the script itself pass checksum
|
||||||
|
validation.
|
||||||
* Choose `14` to toggle Secret Mode and set the clipboard clear delay.
|
* Choose `14` to toggle Secret Mode and set the clipboard clear delay.
|
||||||
* Select `15` to return to the main menu.
|
* Select `15` to return to the main menu.
|
||||||
|
|
||||||
|
@@ -521,7 +521,7 @@ class EntryManager:
|
|||||||
:param url: (Optional) The new URL (password entries).
|
:param url: (Optional) The new URL (password entries).
|
||||||
:param blacklisted: (Optional) The new blacklist status.
|
:param blacklisted: (Optional) The new blacklist status.
|
||||||
:param notes: (Optional) New notes to attach to the entry.
|
:param notes: (Optional) New notes to attach to the entry.
|
||||||
:param label: (Optional) The new label for TOTP entries.
|
:param label: (Optional) The new label for the entry.
|
||||||
:param period: (Optional) The new TOTP period in seconds.
|
:param period: (Optional) The new TOTP period in seconds.
|
||||||
:param digits: (Optional) The new number of digits for TOTP codes.
|
:param digits: (Optional) The new number of digits for TOTP codes.
|
||||||
"""
|
"""
|
||||||
@@ -554,6 +554,9 @@ class EntryManager:
|
|||||||
entry["digits"] = digits
|
entry["digits"] = digits
|
||||||
logger.debug(f"Updated digits to '{digits}' for index {index}.")
|
logger.debug(f"Updated digits to '{digits}' for index {index}.")
|
||||||
else:
|
else:
|
||||||
|
if label is not None:
|
||||||
|
entry["label"] = label
|
||||||
|
logger.debug(f"Updated label to '{label}' for index {index}.")
|
||||||
if username is not None:
|
if username is not None:
|
||||||
entry["username"] = username
|
entry["username"] = username
|
||||||
logger.debug(f"Updated username to '{username}' for index {index}.")
|
logger.debug(f"Updated username to '{username}' for index {index}.")
|
||||||
|
@@ -1665,7 +1665,7 @@ class PasswordManager:
|
|||||||
custom_fields=custom_fields,
|
custom_fields=custom_fields,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
website_name = entry.get("website")
|
website_name = entry.get("label", entry.get("website"))
|
||||||
username = entry.get("username")
|
username = entry.get("username")
|
||||||
url = entry.get("url")
|
url = entry.get("url")
|
||||||
blacklisted = entry.get("blacklisted")
|
blacklisted = entry.get("blacklisted")
|
||||||
@@ -1677,6 +1677,7 @@ class PasswordManager:
|
|||||||
"cyan",
|
"cyan",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
print(colored(f"Current Label: {website_name}", "cyan"))
|
||||||
print(colored(f"Current Username: {username or 'N/A'}", "cyan"))
|
print(colored(f"Current Username: {username or 'N/A'}", "cyan"))
|
||||||
print(colored(f"Current URL: {url or 'N/A'}", "cyan"))
|
print(colored(f"Current URL: {url or 'N/A'}", "cyan"))
|
||||||
print(
|
print(
|
||||||
@@ -1686,6 +1687,13 @@ class PasswordManager:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
new_label = (
|
||||||
|
input(
|
||||||
|
f'Enter new label (leave blank to keep "{website_name}"): '
|
||||||
|
).strip()
|
||||||
|
or website_name
|
||||||
|
)
|
||||||
|
|
||||||
new_username = (
|
new_username = (
|
||||||
input(
|
input(
|
||||||
f'Enter new username (leave blank to keep "{username or "N/A"}"): '
|
f'Enter new username (leave blank to keep "{username or "N/A"}"): '
|
||||||
@@ -1747,6 +1755,7 @@ class PasswordManager:
|
|||||||
new_url,
|
new_url,
|
||||||
new_blacklisted,
|
new_blacklisted,
|
||||||
new_notes,
|
new_notes,
|
||||||
|
label=new_label,
|
||||||
custom_fields=custom_fields,
|
custom_fields=custom_fields,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -2488,7 +2497,7 @@ class PasswordManager:
|
|||||||
stats["entries"] = counts
|
stats["entries"] = counts
|
||||||
stats["total_entries"] = len(entries)
|
stats["total_entries"] = len(entries)
|
||||||
|
|
||||||
# Schema version and checksum status
|
# Schema version and database checksum status
|
||||||
stats["schema_version"] = data.get("schema_version")
|
stats["schema_version"] = data.get("schema_version")
|
||||||
json_content = json.dumps(data, indent=4)
|
json_content = json.dumps(data, indent=4)
|
||||||
current_checksum = hashlib.sha256(json_content.encode("utf-8")).hexdigest()
|
current_checksum = hashlib.sha256(json_content.encode("utf-8")).hexdigest()
|
||||||
@@ -2501,6 +2510,19 @@ class PasswordManager:
|
|||||||
stats["checksum_ok"] = False
|
stats["checksum_ok"] = False
|
||||||
stats["checksum"] = stored
|
stats["checksum"] = stored
|
||||||
|
|
||||||
|
# Script checksum status
|
||||||
|
script_path = Path(__file__).resolve()
|
||||||
|
try:
|
||||||
|
script_checksum = calculate_checksum(str(script_path))
|
||||||
|
except Exception:
|
||||||
|
script_checksum = None
|
||||||
|
|
||||||
|
if SCRIPT_CHECKSUM_FILE.exists() and script_checksum:
|
||||||
|
stored_script = SCRIPT_CHECKSUM_FILE.read_text().strip()
|
||||||
|
stats["script_checksum_ok"] = stored_script == script_checksum
|
||||||
|
else:
|
||||||
|
stats["script_checksum_ok"] = False
|
||||||
|
|
||||||
# Relay info
|
# Relay info
|
||||||
cfg = self.config_manager.load_config(require_pin=False)
|
cfg = self.config_manager.load_config(require_pin=False)
|
||||||
relays = cfg.get("relays", [])
|
relays = cfg.get("relays", [])
|
||||||
@@ -2573,7 +2595,13 @@ class PasswordManager:
|
|||||||
print(colored(f"Schema version: {stats['schema_version']}", "cyan"))
|
print(colored(f"Schema version: {stats['schema_version']}", "cyan"))
|
||||||
print(
|
print(
|
||||||
colored(
|
colored(
|
||||||
f"Checksum ok: {'yes' if stats['checksum_ok'] else 'no'}",
|
f"Database checksum ok: {'yes' if stats['checksum_ok'] else 'no'}",
|
||||||
|
"cyan",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
colored(
|
||||||
|
f"Script checksum ok: {'yes' if stats['script_checksum_ok'] else 'no'}",
|
||||||
"cyan",
|
"cyan",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@@ -469,5 +469,6 @@ def derive_pgp_key(
|
|||||||
hashes=[HashAlgorithm.SHA256],
|
hashes=[HashAlgorithm.SHA256],
|
||||||
ciphers=[SymmetricKeyAlgorithm.AES256],
|
ciphers=[SymmetricKeyAlgorithm.AES256],
|
||||||
compression=[CompressionAlgorithm.ZLIB],
|
compression=[CompressionAlgorithm.ZLIB],
|
||||||
|
created=created,
|
||||||
)
|
)
|
||||||
return str(key), key.fingerprint
|
return str(key), key.fingerprint
|
||||||
|
@@ -57,6 +57,7 @@ def test_manager_workflow(monkeypatch):
|
|||||||
"", # length (default)
|
"", # length (default)
|
||||||
"0", # retrieve index
|
"0", # retrieve index
|
||||||
"0", # modify index
|
"0", # modify index
|
||||||
|
"", # new label
|
||||||
"user", # new username
|
"user", # new username
|
||||||
"", # new url
|
"", # new url
|
||||||
"", # blacklist status
|
"", # blacklist status
|
||||||
|
Reference in New Issue
Block a user