Skip to content

Commit f4477f4

Browse files
Add signature verification
1 parent 2f1707e commit f4477f4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/snowflake/connector/crl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ def _verify_signature(
669669
data,
670670
hash_algorithm,
671671
)
672+
print("> verification successful")
672673
return True
673674
except Exception as e:
674675
logger.warning("%s verification failed: %s", signature_type.capitalize(), e)

test/unit/test_crl.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,10 @@ def test_crl_signature_verification_exception_handling(cert_gen, session_manager
17301730
crl = x509.load_der_x509_crl(crl_bytes, backend=default_backend())
17311731

17321732
# Mock CA certificate that will cause an exception
1733+
mock_public_key = Mock()
1734+
mock_public_key.verify.side_effect = Exception("Test exception")
17331735
mock_ca_cert = Mock(spec=x509.Certificate)
1734-
mock_ca_cert.public_key.side_effect = Exception("Test exception")
1736+
mock_ca_cert.public_key.return_value = mock_public_key
17351737

17361738
validator = CRLValidator(session_manager, trusted_certificates=[])
17371739

@@ -1869,12 +1871,6 @@ def test_crl_signature_verification_with_issuer_mismatch_warning(
18691871
@pytest.mark.parametrize(
18701872
"issue_date,validity_days,expected",
18711873
[
1872-
(
1873-
# Issued before March 15, 2024 - not short-lived
1874-
datetime(2023, 3, 14, tzinfo=timezone.utc),
1875-
3,
1876-
False,
1877-
),
18781874
(
18791875
# Issued on March 15, 2024, should use 10-day rule
18801876
datetime(2024, 3, 15, tzinfo=timezone.utc),

0 commit comments

Comments
 (0)