Port missing things from wolfSSL Python wrapper
wolfSSL's source tree had a stale version of the Python wolfCrypt wrapper. There were a couple of bits in it that weren't here, so this ports them accross. Mostly notably a minor issue where `Random.__del__` can throw a race condition exception during shutdown.pull/47/head
parent
1b6d6d76a1
commit
a142619dd5
23
README.rst
23
README.rst
|
@ -82,3 +82,26 @@ Testing
|
||||||
>>> from wolfcrypt.hashes import Sha256
|
>>> from wolfcrypt.hashes import Sha256
|
||||||
>>> Sha256('wolfcrypt').hexdigest()
|
>>> Sha256('wolfcrypt').hexdigest()
|
||||||
b'96e02e7b1cbcd6f104fe1fdb4652027a5505b68652b70095c6318f9dce0d1844'
|
b'96e02e7b1cbcd6f104fe1fdb4652027a5505b68652b70095c6318f9dce0d1844'
|
||||||
|
|
||||||
|
Testing ``wolfcrypt``'s source code with ``tox``
|
||||||
|
------------------------------------------------
|
||||||
|
|
||||||
|
To run the unit tests in the source code, you'll need ``tox`` and a few other
|
||||||
|
requirements.
|
||||||
|
|
||||||
|
1. Make sure that the testing requirements are installed:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ sudo -H pip install -r requirements/test.txt
|
||||||
|
|
||||||
|
|
||||||
|
2. Run ``tox``:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ tox
|
||||||
|
...
|
||||||
|
_________________________________ summary _________________________________
|
||||||
|
py3: commands succeeded
|
||||||
|
congratulations :)
|
||||||
|
|
|
@ -44,7 +44,11 @@ class Random(object):
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self.native_object:
|
if self.native_object:
|
||||||
self._delete(self.native_object)
|
try:
|
||||||
|
self._delete(self.native_object)
|
||||||
|
except AttributeError:
|
||||||
|
# Can occur during interpreter shutdown
|
||||||
|
pass
|
||||||
|
|
||||||
def byte(self):
|
def byte(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue