Skip to content

Commit

Permalink
Deprecate the rand module (#1325)
Browse files Browse the repository at this point in the history
refs #1321
  • Loading branch information
alex authored Jul 27, 2024
1 parent 2ef4571 commit 26d8a3c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Changelog
Versions are year-based with a strict backward-compatibility policy.
The third digit is only for regressions.

24.3.0 (UNRELEASED)
-------------------

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

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

- Deprecated ``OpenSSL.rand`` - callers should use ``os.urandom()`` instead.

Changes:
^^^^^^^^


24.2.1 (2024-07-20)
-------------------

Expand Down
8 changes: 8 additions & 0 deletions src/OpenSSL/rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
PRNG management routines, thin wrappers.
"""

import warnings

from OpenSSL._util import lib as _lib

warnings.warn(
"OpenSSL.rand is deprecated - you should use os.urandom instead",
DeprecationWarning,
stacklevel=3,
)


def add(buffer: bytes, entropy: int) -> None:
"""
Expand Down

0 comments on commit 26d8a3c

Please sign in to comment.