Skip to content
Snippets Groups Projects
Verified Commit 8689995b authored by Levente Polyak's avatar Levente Polyak :rocket:
Browse files

feature(keyringctl): yell and abort if processing private key data

parent 5a83a7b6
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ from collections import defaultdict
from collections.abc import Iterable
from itertools import chain
from logging import debug
from logging import error
from pathlib import Path
from re import match
from shutil import copytree
......@@ -173,6 +174,14 @@ def convert_certificate( # noqa: ignore=C901
current_packet_uid = None
subkeys[current_packet_fingerprint] = packet
elif packet.name.endswith("--SecretKey"):
error(
"\n###################################################################\n"
"Do not ever process your private key file!\n"
"Consider using a hardware token instead of local private key files!\n"
"###################################################################"
)
raise Exception("Secret key detected, aborting")
elif packet.name.endswith("--Signature"):
# ignore user attributes and related signatures
if current_packet_mode == "uattr":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment