@@ -187,10 +187,10 @@ def _sha256_streaming(io: IO[bytes]) -> bytes:
187
187
# of systems in terms of minimizing syscall overhead.
188
188
view = memoryview (bytearray (128 * 1024 ))
189
189
190
- nbytes = io .readinto (view ) # type: ignore
190
+ nbytes = io .readinto (view ) # type: ignore[attr-defined]
191
191
while nbytes :
192
192
sha256 .update (view [:nbytes ])
193
- nbytes = io .readinto (view ) # type: ignore
193
+ nbytes = io .readinto (view ) # type: ignore[attr-defined]
194
194
195
195
return sha256 .digest ()
196
196
@@ -242,15 +242,15 @@ def cert_is_ca(cert: Certificate) -> bool:
242
242
"invalid X.509 certificate: non-critical BasicConstraints in CA"
243
243
)
244
244
245
- ca = basic_constraints .value .ca # type: ignore
245
+ ca = basic_constraints .value .ca # type: ignore[attr-defined]
246
246
except ExtensionNotFound :
247
247
# No BasicConstrains means that this can't possibly be a CA.
248
248
return False
249
249
250
250
key_cert_sign = False
251
251
try :
252
252
key_usage = cert .extensions .get_extension_for_oid (ExtensionOID .KEY_USAGE )
253
- key_cert_sign = key_usage .value .key_cert_sign # type: ignore
253
+ key_cert_sign = key_usage .value .key_cert_sign # type: ignore[attr-defined]
254
254
except ExtensionNotFound :
255
255
raise VerificationError ("invalid X.509 certificate: missing KeyUsage" )
256
256
@@ -322,7 +322,7 @@ def cert_is_leaf(cert: Certificate) -> bool:
322
322
return False
323
323
324
324
key_usage = cert .extensions .get_extension_for_oid (ExtensionOID .KEY_USAGE )
325
- digital_signature = key_usage .value .digital_signature # type: ignore
325
+ digital_signature = key_usage .value .digital_signature # type: ignore[attr-defined]
326
326
327
327
if not digital_signature :
328
328
raise VerificationError (
@@ -337,6 +337,6 @@ def cert_is_leaf(cert: Certificate) -> bool:
337
337
ExtensionOID .EXTENDED_KEY_USAGE
338
338
)
339
339
340
- return ExtendedKeyUsageOID .CODE_SIGNING in extended_key_usage .value # type: ignore
340
+ return ExtendedKeyUsageOID .CODE_SIGNING in extended_key_usage .value # type: ignore[operator]
341
341
except ExtensionNotFound :
342
342
raise VerificationError ("invalid X.509 certificate: missing ExtendedKeyUsage" )
0 commit comments