diff options
author | Glyph <glyph@twistedmatrix.com> | 2015-06-27 18:50:34 -0700 |
---|---|---|
committer | Glyph <glyph@twistedmatrix.com> | 2015-06-27 18:50:34 -0700 |
commit | 678e5e336efa0acc4c69854439c804b9c7a6fcdc (patch) | |
tree | 107ca5e48ae7c91328328b99e6f67b5ab651adc9 /src | |
parent | 3c7164a9528b0058721d139adc4da89c2efe2936 (diff) | |
download | cryptography-678e5e336efa0acc4c69854439c804b9c7a6fcdc.tar.gz cryptography-678e5e336efa0acc4c69854439c804b9c7a6fcdc.tar.bz2 cryptography-678e5e336efa0acc4c69854439c804b9c7a6fcdc.zip |
consistency about underscores and prefixes
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/binding.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cryptography/hazmat/bindings/openssl/binding.py b/src/cryptography/hazmat/bindings/openssl/binding.py index 9ceabf48..b885017a 100644 --- a/src/cryptography/hazmat/bindings/openssl/binding.py +++ b/src/cryptography/hazmat/bindings/openssl/binding.py @@ -14,7 +14,7 @@ _osrandom_engine_name = ffi.new("const char[]", b"osrandom_engine") @ffi.callback("int (*)(unsigned char *, int)", error=-1) -def osrandom_rand_bytes(buf, size): +def _osrandom_rand_bytes(buf, size): signed = ffi.cast("char *", buf) result = os.urandom(size) signed[0:size] = result @@ -22,14 +22,14 @@ def osrandom_rand_bytes(buf, size): @ffi.callback("int (*)(void)") -def osrandom_rand_status(): +def _osrandom_rand_status(): return 1 -method = ffi.new( +_osrandom_method = ffi.new( "RAND_METHOD *", - dict(bytes=osrandom_rand_bytes, pseudorand=osrandom_rand_bytes, - status=osrandom_rand_status) + dict(bytes=_osrandom_rand_bytes, pseudorand=_osrandom_rand_bytes, + status=_osrandom_rand_status) ) @@ -47,7 +47,7 @@ def _register_osrandom_engine(): assert result == 1 result = lib.ENGINE_set_name(engine, _osrandom_engine_name) assert result == 1 - result = lib.ENGINE_set_RAND(engine, method) + result = lib.ENGINE_set_RAND(engine, _osrandom_method) assert result == 1 result = lib.ENGINE_add(engine) assert result == 1 |