aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/certffi.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/certffi.py')
-rw-r--r--netlib/certffi.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/netlib/certffi.py b/netlib/certffi.py
index c5d7c95e..81dc72e8 100644
--- a/netlib/certffi.py
+++ b/netlib/certffi.py
@@ -1,7 +1,9 @@
+from __future__ import (absolute_import, print_function, division)
import cffi
import OpenSSL
+
xffi = cffi.FFI()
-xffi.cdef ("""
+xffi.cdef("""
struct rsa_meth_st {
int flags;
...;
@@ -18,6 +20,7 @@ xffi.verify(
extra_compile_args=['-w']
)
+
def handle(privkey):
new = xffi.new("struct rsa_st*")
newbuf = xffi.buffer(new)
@@ -26,11 +29,13 @@ def handle(privkey):
newbuf[:] = oldbuf[:]
return new
+
def set_flags(privkey, val):
hdl = handle(privkey)
- hdl.meth.flags = val
+ hdl.meth.flags = val
return privkey
+
def get_flags(privkey):
hdl = handle(privkey)
return hdl.meth.flags