wbond / oscrypto

Compiler-free Python crypto library backed by the OS, supporting CPython and PyPy
MIT License
321 stars 71 forks source link

MJ: Fix #75 bug with openssl 3.0.10 #76

Closed BibMartin closed 1 year ago

BibMartin commented 1 year ago

This PR fixes the regex that breaks oscrypto with openssl 3.0.10 (#75 ). In adding a + in the regex, we allow version numbers of the form D.D.DD. Tested at home, it seems enough to solve the problem.

This would be the clean solution to snowpark-python's problem (https://github.com/snowflakedb/snowpark-python/issues/992)

vcunat commented 1 year ago

Unfortunately, this does not seem to be the only place in need of fixes.

vcunat commented 1 year ago

Tests pass for me if I also add

--- a/oscrypto/_openssl/_libcrypto_ctypes.py
+++ b/oscrypto/_openssl/_libcrypto_ctypes.py
@@ -40,7 +40,7 @@ except (AttributeError):

 is_libressl = 'LibreSSL' in version_string

-version_match = re.search('\\b(\\d\\.\\d\\.\\d[a-z]*)\\b', version_string)
+version_match = re.search('\\b(\\d\\.\\d\\.\\d+[a-z]*)\\b', version_string)
 if not version_match:
     version_match = re.search('(?<=LibreSSL )(\\d\\.\\d(\\.\\d)?)\\b', version_string)
 if not version_match:
rubickcz commented 1 year ago

@wbond Hello, this is blocker issue, can we get this merged soon please? :pray:

wbond commented 1 year ago

Can you rebase this on master please @BibMartin? I've done a bit of CI work over the past couple of days, so things should be in a good place now.

wbond commented 1 year ago

I've merged this for now and added some fixes on master since I didn't have permission to push to your branch @BibMartin