-
- Downloads
New osrandom_engine in C (#3229)
* New osrandom_engine in C Inspired by Python/random.c and the old implementation. Signed-off-by:Christian Heimes <christian@python.org> * osrandom_engine * Fix naming bug caused by search 'n replace mistake * Make it easier to override osrandom auto-detection * Add engine ctrl and backend API to get implementation from ENGINE Signed-off-by:
Christian Heimes <christian@python.org> * Better test coverage, documentation, LICENSE Signed-off-by:
Christian Heimes <christian@python.org> * Coverage is hard. Signed-off-by:
Christian Heimes <christian@python.org> * * enable win32 check * read() returns size_t Signed-off-by:
Christian Heimes <christian@python.org> * Add macOS to spelling list. Remove dead code from header file. Signed-off-by:
Christian Heimes <christian@python.org> * remove CCRandomGenerateBytes path and update getentropy to work on macOS This change allows us to test all the engines in our CI: * getentropy (tested by macOS sierra) * getrandom (tested on several linux builders) * /dev/urandom (tested on FreeBSD, OS X 10.11 and below, & older linux) * CryptGenRandom (tested on windows builders) I also fixed bugs preventing compilation in the getentropy code * getentropy() returns int and is restricted to 256 bytes on macOS, too. Signed-off-by:
Christian Heimes <christian@python.org> * add versionadded * Re-add import of os module * Fixes related to Alex's recent review. Signed-off-by:
Christian Heimes <christian@python.org> * Add error reporting and fail for EAGAIN Add error reporting strings for various error cases. This gives us much nicer and understandable error messages. SYS_getrandom() EAGAIN is now an error. Cryptography refuses to initialize its osrandom engine when the Kernel's CPRNG hasn't been seeded yet. Signed-off-by:
Christian Heimes <christian@python.org>
Showing
- LICENSE 3 additions, 2 deletionsLICENSE
- docs/hazmat/backends/openssl.rst 21 additions, 0 deletionsdocs/hazmat/backends/openssl.rst
- docs/spelling_wordlist.txt 4 additions, 0 deletionsdocs/spelling_wordlist.txt
- src/_cffi_src/build_openssl.py 1 addition, 0 deletionssrc/_cffi_src/build_openssl.py
- src/_cffi_src/openssl/osrandom_engine.py 29 additions, 0 deletionssrc/_cffi_src/openssl/osrandom_engine.py
- src/_cffi_src/openssl/src/osrandom_engine.c 576 additions, 0 deletionssrc/_cffi_src/openssl/src/osrandom_engine.c
- src/_cffi_src/openssl/src/osrandom_engine.h 88 additions, 0 deletionssrc/_cffi_src/openssl/src/osrandom_engine.h
- src/cryptography/hazmat/backends/openssl/backend.py 30 additions, 12 deletionssrc/cryptography/hazmat/backends/openssl/backend.py
- src/cryptography/hazmat/bindings/openssl/binding.py 4 additions, 45 deletionssrc/cryptography/hazmat/bindings/openssl/binding.py
- tests/hazmat/backends/test_openssl.py 19 additions, 13 deletionstests/hazmat/backends/test_openssl.py
Loading
Please register or sign in to comment