pyca / pyca/pyopenssl

Empty list of errors from SSL.bio_read

Open
#766 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
944
Forks
440
Avg merge
1d 6h
Merged PRs (30d)
6

Description

So this happened (this is a tail of a stacktrace, you can see it full at https://github.com/golemfactory/golem/issues/2834):

  File "/Users/ederenn/golem/venv/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1672, in bio_read
    self._handle_bio_errors(self._from_ssl, result)
  File "/Users/ederenn/golem/venv/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1653, in _handle_bio_errors
    _raise_current_error()
  File "/Users/ederenn/golem/venv/lib/python3.6/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: []

I suspect it might be caused by this in SSL.bio_read:

        if result <= 0:
            self._handle_bio_errors(self._from_ssl, result)

According to https://www.openssl.org/docs/manmaster/man3/BIO_read.html :

A 0 or -1 return is not necessarily an indication of an error. In particular when the source/sink is non-blocking or of a certain type it may merely be an indication that no data is currently available and that the application should retry the operation later.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with OpenSSL/SSL.py's bio_read and _handle_bio_errors, then compare the BIO_read documentation linked in the report with the current error handling. Reproduce or add coverage for the empty OpenSSL.SSL.Error case and verify the completed behavior against the documented 0/-1 return semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.