#29594 closed defect (implemented)

Remove OpenSSL.rand.bytes from code

Reported by: dgoulet Owned by: dgoulet
Priority: Medium Milestone:
Component: Circumvention/BridgeDB Version:
Severity: Normal Keywords: bridgedb
Cc: cohosh, catalyst Actual Points:
Parent ID: #29276 Points:
Reviewer: sysrqb Sponsor:


It is now deprecated in favor of os.urandom():

OpenSSL.rand is deprecated - you should use os.urandom instead

This is needed if we want to upgrade the requirements.txt.

Child Tickets

Change History (5)

comment:1 Changed 19 months ago by dgoulet

Status: assignedneeds_review

Branch: ticket29594_01

comment:2 Changed 19 months ago by catalyst

Cc: catalyst added

comment:3 Changed 19 months ago by catalyst

Parent ID: #29276

comment:4 Changed 19 months ago by sysrqb

Status: needs_reviewmerge_ready

lgtm - but I didn't test it, but it should be a safe substitution:

        urandom(n) -> str
        Return n random bytes suitable for cryptographic use.


def bytes(num_bytes):
    Get some random bytes from the PRNG as a string.
    This is a wrapper for the C function ``RAND_bytes``.
    :param num_bytes: The number of bytes to fetch.
    :return: A string of random bytes.

comment:5 Changed 19 months ago by sysrqb

Resolution: implemented
Status: merge_readyclosed


Note: See TracTickets for help on using tickets.