What steps will reproduce the problem? 1. ~/pydistutils.cfg has compiler = mingw32 in [build] 2. pip install py-bcrypt 3. python test\test.py
What is the expected output? What do you see instead? Clean install. Compile errors for u_int8_t. After fixing those segfaults calling hashpw.
What version of the product are you using? On what operating system? py-bcrypt 0.2 on Windows 7. MinGW is gcc 4.6.2.
Please provide any additional information below. The two attached patches address a number of problems. 1. u_int8_t, etc. are not standard C. 2. strdup on Windows is deprecated since VS2005, using _strdup instead. 3. Explicit cast added calling encode_salt. 4. Move declarations to start of block. 5. memset to zero password and salt copies (duplicate of other patches).
This is only tested on mingw32 but the ifdefs should be good for other platforms.
- bcrypt_python.c.patch 1.85KB
- pybc_blf.h.patch 477
Comment #1
Posted on Jun 11, 2012 by Happy HippoThis duplicates issue 3 to a large extent.
The #ifdef for C99 failed when I retested, more work is needed.
Comment #2
Posted on Jul 28, 2013 by Massive WombatPatch applied with a small tweak (C99 types are preferred if they exist). This will be in the py-bcrypt-0.4 release and is in hg tip now.
Comment #3
Posted on Aug 30, 2013 by Happy HippoSuccessfully installed py-bcrypt 0.4 from PyPI. Passes all 5 py-bcrypt tests and my own tests.
Python 2.7.5 Windows 7 64 bit (but 32 bit versions of Python / py-bcrypt) MinGW 4.6.2
Status: Fixed
Labels:
Type-Defect
Priority-Medium