Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X509Store.add_cert no longer raises an error on duplicate cert #787

Merged
merged 2 commits into from
Aug 23, 2018

Conversation

reaperhulk
Copy link
Member

OpenSSL 1.1.0i changed X509_STORE_add_cert such that it no longer raises an error if a duplicate cert is added. This patch makes it so we behave consistently (and do not error) on all versions.

code = _lib.ERR_get_error()
err_reason = _lib.ERR_GET_REASON(code)
_openssl_assert(
err_reason == _lib.X509_R_CERT_ALREADY_IN_HASH_TABLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other errors that can happen?

CHANGELOG.rst Outdated
@@ -23,7 +23,8 @@ Deprecations:
Changes:
^^^^^^^^

*none*
- ``X509Store.add_cert`` no longer raises an error if you add a duplicate cert.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the backwards incompat section

@alex alex merged commit 0e6c553 into pyca:master Aug 23, 2018
@reaperhulk reaperhulk deleted the fix-110i branch August 23, 2018 15:55
peterbe pushed a commit to peterbe/django-peterbecom that referenced this pull request Jan 22, 2019
This PR updates [pyOpenSSL](https://pypi.org/project/pyOpenSSL) from **18.0.0** to **19.0.0**.



<details>
  <summary>Changelog</summary>
  
  
   ### 19.0.0
   ```
   -------------------


Backward-incompatible changes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``X509Store.add_cert`` no longer raises an error if you add a duplicate cert.
  `787 &lt;https://github.com/pyca/pyopenssl/pull/787&gt;`_


Deprecations:
^^^^^^^^^^^^^

*none*


Changes:
^^^^^^^^

- pyOpenSSL now works with OpenSSL 1.1.1.
  `805 &lt;https://github.com/pyca/pyopenssl/pull/805&gt;`_
- pyOpenSSL now handles NUL bytes in ``X509Name.get_components()``
  `804 &lt;https://github.com/pyca/pyopenssl/pull/804&gt;`_



----
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyopenssl
  - Changelog: https://pyup.io/changelogs/pyopenssl/
  - Homepage: https://pyopenssl.org/
  - Docs: https://pythonhosted.org/pyOpenSSL/
</details>
peterbe pushed a commit to mozilla-services/tecken that referenced this pull request Jan 22, 2019
This PR updates [pyOpenSSL](https://pypi.org/project/pyOpenSSL) from **18.0.0** to **19.0.0**.



<details>
  <summary>Changelog</summary>
  
  
   ### 19.0.0
   ```
   -------------------


Backward-incompatible changes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``X509Store.add_cert`` no longer raises an error if you add a duplicate cert.
  `787 &lt;https://github.com/pyca/pyopenssl/pull/787&gt;`_


Deprecations:
^^^^^^^^^^^^^

*none*


Changes:
^^^^^^^^

- pyOpenSSL now works with OpenSSL 1.1.1.
  `805 &lt;https://github.com/pyca/pyopenssl/pull/805&gt;`_
- pyOpenSSL now handles NUL bytes in ``X509Name.get_components()``
  `804 &lt;https://github.com/pyca/pyopenssl/pull/804&gt;`_



----
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyopenssl
  - Changelog: https://pyup.io/changelogs/pyopenssl/
  - Homepage: https://pyopenssl.org/
  - Docs: https://pythonhosted.org/pyOpenSSL/
</details>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants