aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/certffi.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-06-26 13:26:35 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-06-26 13:26:35 +0200
commit2723a0e5739412953f60c37d0dab81d684ba5f26 (patch)
treef4f103162580f8ae1c82f80937460c1c006ecff0 /netlib/certffi.py
parent41925b01f71831c33424d5cd9e612d003b99a69d (diff)
downloadmitmproxy-2723a0e5739412953f60c37d0dab81d684ba5f26.tar.gz
mitmproxy-2723a0e5739412953f60c37d0dab81d684ba5f26.tar.bz2
mitmproxy-2723a0e5739412953f60c37d0dab81d684ba5f26.zip
remove certffi
Diffstat (limited to 'netlib/certffi.py')
-rw-r--r--netlib/certffi.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/netlib/certffi.py b/netlib/certffi.py
deleted file mode 100644
index 451f4493..00000000
--- a/netlib/certffi.py
+++ /dev/null
@@ -1,41 +0,0 @@
-from __future__ import (absolute_import, print_function, division)
-from cffi import FFI
-import OpenSSL
-
-xffi = FFI()
-xffi.cdef("""
- struct rsa_meth_st {
- int flags;
- ...;
- };
- struct rsa_st {
- int pad;
- long version;
- struct rsa_meth_st *meth;
- ...;
- };
-""")
-xffi.verify(
- """#include <openssl/rsa.h>""",
- extra_compile_args=['-w']
-)
-
-
-def handle(privkey):
- new = xffi.new("struct rsa_st*")
- newbuf = xffi.buffer(new)
- rsa = OpenSSL.SSL._lib.EVP_PKEY_get1_RSA(privkey._pkey)
- oldbuf = OpenSSL.SSL._ffi.buffer(rsa)
- newbuf[:] = oldbuf[:]
- return new
-
-
-def set_flags(privkey, val):
- hdl = handle(privkey)
- hdl.meth.flags = val
- return privkey
-
-
-def get_flags(privkey):
- hdl = handle(privkey)
- return hdl.meth.flags