gdanezis / petlib

A python library that implements a number of Privacy Enhancing Technolgies
BSD 2-Clause "Simplified" License
133 stars 33 forks source link

Support for both OpenSSL 1.0.x and 1.1.x #19

Closed bogdan-kulynych closed 5 years ago

bogdan-kulynych commented 6 years ago

Fix #13

Core changes:

Side changes:

Feel free to rollback any of the side changes.

We did not increment the version.

Linter output for reference:

---> pavement.lint

----------Run pylint on the library----------

pylint --rcfile=pylintrc petlib
************* Module petlib.ecdsa
petlib/ecdsa.py:223:4: W0104: Statement seems to have no effect (pointless-statement)
petlib/ecdsa.py:228:8: W0612: Unused variable 'y' (unused-variable)
************* Module petlib.bn
petlib/bn.py:27:0: E0012: Bad option value 'star-args' (bad-option-value)
petlib/bn.py:87:4: W0231: __init__ method from base class 'BnCtx' is not called (super-init-not-called)
petlib/bn.py:100:4: W0603: Using the global statement (global-statement)
petlib/bn.py:784:8: W0603: Using the global statement (global-statement)
petlib/bn.py:1032:4: W0104: Statement seems to have no effect (pointless-statement)
petlib/bn.py:1034:4: W0612: Unused variable 'X' (unused-variable)
************* Module petlib.ec
petlib/ec.py:609:16: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
petlib/ec.py:617:11: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
petlib/ec.py:650:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:657:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:669:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:676:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:688:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:695:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:707:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:714:-1: W0105: String statement has no effect (pointless-string-statement)
petlib/ec.py:1:0: W0611: Unused Const imported from bindings (unused-import)
petlib/ec.py:2:0: W0611: Unused force_Bn imported from bn (unused-import)
************* Module petlib.pack
petlib/pack.py:99:4: W0603: Using the global statement (global-statement)
petlib/pack.py:299:19: W0613: Unused argument 'obj' (unused-argument)
petlib/pack.py:302:19: W0613: Unused argument 'data' (unused-argument)
************* Module petlib.bindings
petlib/bindings.py:9:4: E0611: No name 'ffi' in module 'petlib._petlib' (no-name-in-module)
petlib/bindings.py:9:4: E0611: No name 'lib' in module 'petlib._petlib' (no-name-in-module)
petlib/bindings.py:3:0: W0611: Unused import os (unused-import)
petlib/bindings.py:4:0: W0611: Unused import platform (unused-import)
petlib/bindings.py:5:0: W0611: Unused import cffi (unused-import)
petlib/bindings.py:6:0: W0611: Unused import sys (unused-import)

------------------------------------------------------------------
Your code has been rated at 9.72/10 (previous run: 9.69/10, +0.03)
jaromil commented 6 years ago

Knowing the work it took to update, this is an great contribution! congrats. About the outdated travis image: its also possible to build using docker images of more recent distros.

wouterl commented 6 years ago

Tweaked the code a bit to make version detection on MacOS more robust. It will now automatically pick openssl version 1.1 over version 1.0 if installed.

wouterl commented 5 years ago

Extra fix to include C source files for the binding so that bplib -- which hooks directly into them -- compiles against the new version of petlib.

Sorry, one of the Travis builds failed because of an apt-get update quirk (and I cannot request another build).

gdanezis commented 5 years ago

Merging the OpenSSL 1.1 compatibility.