Skip to content

Commit 0f592b4

Browse files
sfc-gh-stakedaankit-bhatnagar167
authored andcommitted
SNOW-101573: Support asn1crypto 1.0.x
1 parent ace9372 commit 0f592b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ocsp_asn1crypto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from asn1crypto.ocsp import CertId, OCSPRequest, TBSRequest, Requests, \
1818
Request, OCSPResponse, Version
1919
from asn1crypto.x509 import Certificate
20+
from oscrypto import asymmetric
2021

2122
from snowflake.connector.errorcode import (
2223
ER_INVALID_OCSP_RESPONSE,
@@ -313,7 +314,7 @@ def process_ocsp_response(self, issuer, cert_id, ocsp_response):
313314
raise RevocationCheckError(msg=debug_msg, errno=op_er.errno)
314315

315316
def verify_signature(self, signature_algorithm, signature, cert, data):
316-
pubkey = cert.public_key['public_key'].parsed.dump()
317+
pubkey = asymmetric.load_public_key(cert.public_key).unwrap().dump()
317318
rsakey = RSA.importKey(pubkey)
318319
signer = PKCS1_v1_5.new(rsakey)
319320
if signature_algorithm in SnowflakeOCSPAsn1Crypto.SIGNATURE_ALGORITHM_TO_DIGEST_CLASS:

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ def _get_pyarrow_lib_pattern(self, lib_name):
172172
'ijson',
173173
'pyjwt',
174174
'idna',
175-
'asn1crypto<1.0.0',
175+
'oscrypto<1.1.0',
176+
'asn1crypto<1.1.0',
176177
'pyasn1>=0.4.0,<0.5.0;python_version<"3.0"',
177178
'pyasn1-modules>=0.2.0,<0.3.0;python_version<"3.0"',
178179
'enum34;python_version<"3.4"',

0 commit comments

Comments
 (0)