'Void' object has no attribute 'human_friendly'
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the self-contained example against revoked.badssl.com, then inspect certvalidator/validate.py at verify_ocsp_response(), where the traceback accesses revocation_info['revocation_reason'].human_friendly. The done condition is for this revoked certificate to produce the documented RevokedError instead of AttributeError.
Written by the indexing model from the issue text.
Description
When run on revoked.badssl.com
ctx = ValidationContext(allow_fetching=True, revocation_mode='hard-fail', weak_hash_algos=set(["md2", "md5", "sha1"]))
validator = CertificateValidator(pem, validation_context=ctx, intermediate_certs=intermediate_certs)
validator.validate_usage(
key_usage=set(validator_key_usage),
extended_key_usage=set(validator_extended_key_usage),
)
full self-enclosed test:
from socket import socket, AF_INET, SOCK_STREAM
from certvalidator import CertificateValidator, ValidationContext
import idna
from OpenSSL import SSL
from OpenSSL.crypto import dump_certificate, FILETYPE_PEM
host = 'revoked.badssl.com'
ctx = SSL.Context(method=SSL.TLSv1_2_METHOD)
ctx.check_hostname = False
ctx.verify_mode = SSL.VERIFY_NONE
conn = SSL.Connection(ctx, socket(AF_INET, SOCK_STREAM))
conn.connect((host, 443))
conn.settimeout(3)
conn.set_tlsext_host_name(idna.encode(host))
conn.setblocking(1)
conn.do_handshake()
x509 = conn.get_peer_certificate()
intermediate_certs = []
for (_, cert) in enumerate(conn.get_peer_cert_chain()):
intermediate_certs.append(dump_certificate(FILETYPE_PEM, cert))
conn.close()
pem = dump_certificate(FILETYPE_PEM, x509)
ctx = ValidationContext(allow_fetching=True, revocation_mode='hard-fail', weak_hash_algos=set(["md2", "md5", "sha1"]))
validator = CertificateValidator(pem, validation_context=ctx, intermediate_certs=intermediate_certs)
validator.validate_usage(
key_usage=set(['digital_signature', 'key_encipherment']),
extended_key_usage=set(['server_auth']),
)
full trace
Traceback (most recent call last):
File "<redacted>/src/main.py", line 39, in <module>
validator.validate_usage(
File "<redacted>/.venv/lib/python3.9/site-packages/certvalidator/__init__.py", line 193, in validate_usage
self._validate_path()
File "<redacted>/.venv/lib/python3.9/site-packages/certvalidator/__init__.py", line 121, in _validate_path
validate_path(self._context, candidate_path)
File "<redacted>/.venv/lib/python3.9/site-packages/certvalidator/validate.py", line 50, in validate_path
return _validate_path(validation_context, path)
File "<redacted>/.venv/lib/python3.9/site-packages/certvalidator/validate.py", line 376, in _validate_path
verify_ocsp_response(
File "<redacted>/.venv/lib/python3.9/site-packages/certvalidator/validate.py", line 1101, in verify_ocsp_response
reason = revocation_info['revocation_reason'].human_friendly
AttributeError: 'Void' object has no attribute 'human_friendly'
Via pip certvalidator==0.11.1
** Expected
Your docs explain I should see RevokedError not AttributeError which seems more about a source code bug within CertificateValidator then an actual error realted to OCSP revocation.
You may want to do some testing against badssl.com if you don't have something better
- Dominant language
- Python
- Stars
- 117
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wbond/certvalidator
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wbond/certvalidator#46 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
wbond/certvalidator#44 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
wbond/certvalidator#22 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
wbond/certvalidator#11 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
wbond/certvalidator#56 · 1 comment ·
All issues in wbond/certvalidator
Similar issues
-
bug: conversation context selects the oldest thread messages instead of recent repliesPossibly taken @BLVCK-MAMBA-6 claimed this today. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/SkillBot#74 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bad-antics/lateralus-lang#1438 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
area: control app
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
glossyio/traffic-monitor#415 ·
Maintainers usually reply within 1 day
-
apply_matrix_rect takes 6-9% of extract_text timePossibly taken @g4lb claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pdfminer/pdfminer.six#1333 ·
Maintainers usually reply within 1 day