Skip to content

Commit aa43143

Browse files
committed
New osrandom_engine in C (WIP)
Inspired by Python/random.c and the old implementation. Signed-off-by: Christian Heimes <[email protected]>
1 parent fb0e719 commit aa43143

File tree

6 files changed

+498
-43
lines changed

6 files changed

+498
-43
lines changed

src/_cffi_src/build_openssl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def _osx_libraries(build_static):
6868
"objects",
6969
"ocsp",
7070
"opensslv",
71+
"osrandom_engine",
7172
"pem",
7273
"pkcs12",
7374
"rand",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file is dual licensed under the terms of the Apache License, Version
2+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
3+
# for complete details.
4+
5+
from __future__ import absolute_import, division, print_function
6+
7+
import os
8+
9+
HERE = os.path.dirname(os.path.abspath(__file__))
10+
11+
with open(os.path.join(HERE, "src/osrandom_engine.h")) as f:
12+
INCLUDES = f.read()
13+
14+
TYPES = """
15+
static const char *const Cryptography_osrandom_engine_name;
16+
static const char *const Cryptography_osrandom_engine_id;
17+
"""
18+
19+
FUNCTIONS = """
20+
int Cryptography_add_osrandom_engine(void);
21+
"""
22+
23+
MACROS = """
24+
"""
25+
26+
with open(os.path.join(HERE, "src/osrandom_engine.c")) as f:
27+
CUSTOMIZATIONS = f.read()
28+
29+
CONDITIONAL_NAMES = {}

0 commit comments

Comments
 (0)