Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lexecon/security/signature_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.backends import default_backend
from cryptography.exceptions import InvalidSignature
import logging

logger = logging.getLogger(__name__)


class SignatureService:
Expand Down Expand Up @@ -192,7 +195,9 @@ def verify_signature(
except InvalidSignature:
return False, "Signature verification failed - packet may have been tampered with"
except Exception as e:
return False, f"Verification error: {str(e)}"
# Log detailed error on the server, but return a generic message to the client
logger.exception("Unexpected error during signature verification")
return False, "Internal verification error"

def get_public_key_pem(self) -> str:
"""Get public key in PEM format for distribution."""
Expand Down
Loading