Changeset 108


Ignore:
Timestamp:
07/22/16 21:03:45 (8 years ago)
Author:
tim
Message:

added workaround for annoying openssl library resolution limitation on many platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bletchley/ssltls.py

    r88 r108  
    161161    ffi = cffi.FFI()
    162162    ffi.cdef('''void* X509_delete_ext(void* x, int loc);''')
    163     libssl = ffi.dlopen('libssl.so')
     163
     164    # Try to load libssl using several recent names because package
     165    # maintainers have the blinders on and don't have a universal
     166    # symlink to the most recent version.
     167    libssl = None
     168    for libname in ('libssl.so','libssl.1.0.2', 'libssl.so.1.0.1', 'libssl.so.1.0.0','libssl.so.0.9.8'):
     169        try:
     170            libssl = ffi.dlopen(libname)
     171            break
     172        except OSError as e:
     173            pass
     174   
    164175    ext = libssl.X509_delete_ext(certificate._x509, index)
    165176    #XXX: memory leak.  supposed to free ext here
Note: See TracChangeset for help on using the changeset viewer.