File tree 2 files changed +21
-0
lines changed
cryptography/hazmat/bindings/openssl
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 8
8
"""
9
9
10
10
TYPES = """
11
+ static const long Cryptography_HAS_BN_FLAGS;
12
+
11
13
typedef ... BN_CTX;
12
14
typedef ... BN_MONT_CTX;
13
15
typedef ... BIGNUM;
81
83
"""
82
84
83
85
CUSTOMIZATIONS = """
86
+ #if CRYPTOGRAPHY_IS_BORINGSSL
87
+ static const long Cryptography_HAS_BN_FLAGS = 0;
88
+
89
+ static const int BN_FLG_CONSTTIME = 0;
90
+ void (*BN_set_flags)(BIGNUM *, int) = NULL;
91
+ int (*BN_prime_checks_for_size)(int) = NULL;
92
+ #else
93
+ static const long Cryptography_HAS_BN_FLAGS = 1;
94
+ #endif
84
95
"""
Original file line number Diff line number Diff line change @@ -279,6 +279,15 @@ def cryptography_has_pkcs7_funcs():
279
279
"PKCS7_get0_signers" ,
280
280
]
281
281
282
+
283
+ def cryptography_has_bn_flags ():
284
+ return [
285
+ "BN_FLG_CONSTTIME" ,
286
+ "BN_set_flags" ,
287
+ "BN_prime_checks_for_size" ,
288
+ ]
289
+
290
+
282
291
# This is a mapping of
283
292
# {condition: function-returning-names-dependent-on-that-condition} so we can
284
293
# loop over them and delete unsupported names at runtime. It will be removed
@@ -333,4 +342,5 @@ def cryptography_has_pkcs7_funcs():
333
342
"Cryptography_HAS_300_FIPS" : cryptography_has_300_fips ,
334
343
"Cryptography_HAS_SSL_COOKIE" : cryptography_has_ssl_cookie ,
335
344
"Cryptography_HAS_PKCS7_FUNCS" : cryptography_has_pkcs7_funcs ,
345
+ "Cryptography_HAS_BN_FLAGS" : cryptography_has_bn_flags ,
336
346
}
You can’t perform that action at this time.
0 commit comments