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

restore a subset of the rand module #708

Merged
merged 4 commits into from
Nov 20, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lighten and add power
  • Loading branch information
reaperhulk committed Nov 20, 2017
commit 6afda823d8ce3a3c5b9764bff6556bcf070b96a2
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ Deprecations:
Changes:
^^^^^^^^


- Re-added a subset of the ``OpenSSL.rand`` module.
This subset allows conscientious users to reseed the OpenSSL CSPRNG after fork.
`#708 <https://github.com/pyca/pyopenssl/pull/708>`_
- Corrected a use-after-free when reusing an issuer or subject from an ``X509`` object after the underlying object has been mutated.
`#709 <https://github.com/pyca/pyopenssl/pull/709>`_

----


17.3.0 (2017-09-14)
-------------------
Expand Down
5 changes: 1 addition & 4 deletions src/OpenSSL/rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from OpenSSL._util import lib as _lib


_builtin_bytes = bytes


def add(buffer, entropy):
"""
Mix bytes from *string* into the PRNG state.
Expand All @@ -25,7 +22,7 @@ def add(buffer, entropy):

:return: :obj:`None`
"""
if not isinstance(buffer, _builtin_bytes):
if not isinstance(buffer, bytes):
raise TypeError("buffer must be a byte string")

if not isinstance(entropy, int):
Expand Down