Closed GoogleCodeExporter closed 8 years ago
Same here.
Lines 85-87 of bcrypt_python.c had to changed to:
memset(password_copy, 0, strlen(password_copy));
free(password_copy);
memset(salt_copy, 0, strlen(salt_copy));
Got further with that, but then got a "too many arguments to function
'encode_salt'" error. :-/
Original comment by rye...@gmail.com
on 21 Jun 2011 at 2:26
Okay, removed all instances of "#if defined(_MSC_VER)" from all the files. This
fixed it. Note I was using the MinGW32 GCC compiler, so that might have had
something to do with it.
Original comment by rye...@gmail.com
on 21 Jun 2011 at 2:35
According to http://groups.google.com/group/mpir-devel/msg/2c2d4cc7ec12adbb
(flags defined under the various windows OS'es ,cygwins,mingw's and other's)
its better to use _WIN32 instead of _MSC_VER, Together with the change from
bzero to memset this compiles both under MSVC and MingW32.
Attached a patch with the required changes.
Original comment by benghat...@gmail.com
on 12 Jul 2011 at 7:09
Attachments:
I had the same issue.
I'd suggest sidestepping all of the conditional defines, etc., and move from
bzero to memset, which is recommended anyway; bcopy was marked as LEGACY in
POSIX.1-2001.
This will make it more likely that py-bcrypt will compile on mingw32, vc++, and
who knows how many other non-Windows compilers.
Finally, can I request a new release? Keeping all of my runtime environments
up to date with HEAD (not to mention a locally patched HEAD due to this issue)
is laborious.
THANKS everyone!!!
Diff:
85c85
< memset(password_copy, 0, strlen(password_copy));
---
> bzero(password_copy, strlen(password_copy));
87c87
< memset(salt_copy, 0, strlen(salt_copy));
---
> bzero(salt_copy, strlen(salt_copy));
Original comment by adam-per...@adamsmith.cc
on 28 Jul 2011 at 6:11
I have made a release just for Windows here
http://pypi.python.org/pypi/py-bcrypt-w32
Original comment by djpnew...@gmail.com
on 30 Aug 2011 at 3:23
@djpnew...@gmail.com: I'm installing using the link you provided and I get the
following errors:
running install
running bdist_egg
running egg_info
writing py_bcrypt_w32.egg-info\PKG-INFO
writing top-level names to py_bcrypt_w32.egg-info\top_level.txt
writing dependency_links to py_bcrypt_w32.egg-info\dependency_links.txt
reading manifest file 'py_bcrypt_w32.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'test' under directory 'bcrypt'
writing manifest file 'py_bcrypt_w32.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
copying bcrypt\__init__.py -> build\lib.win32-2.7\bcrypt
running build_ext
building 'bcrypt._bcrypt' extension
C:\MinGW32-xy\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include
-IC:\Python27\PC -c bc
rypt/bcrypt_python.c -o build\temp.win32-2.7\Release\bcrypt\bcrypt_python.o
bcrypt/bcrypt_python.c: In function 'bcrypt_encode_salt':
bcrypt/bcrypt_python.c:56:2: warning: pointer targets in passing argument 2 of
'encode_salt' diff
er in signedness
bcrypt/bcrypt_python.c:29:6: note: expected 'u_int8_t *' but argument is of
type 'char *'
C:\MinGW32-xy\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include
-IC:\Python27\PC -c bc
rypt/blowfish.c -o build\temp.win32-2.7\Release\bcrypt\blowfish.o
In file included from bcrypt/blowfish.c:43:0:
bcrypt/pybc_blf.h:55:2: error: expected specifier-qualifier-list before
'u_int32_t'
bcrypt/pybc_blf.h:66:55: warning: type defaults to 'int' in declaration of
'u_int8_t'
bcrypt/pybc_blf.h:66:64: error: expected ';', ',' or ')' before '*' token
bcrypt/pybc_blf.h:67:54: warning: type defaults to 'int' in declaration of
'u_int8_t'
bcrypt/pybc_blf.h:67:63: error: expected ';', ',' or ')' before '*' token
bcrypt/pybc_blf.h:72:35: error: expected declaration specifiers or '...' before
'u_int32_t'
bcrypt/pybc_blf.h:72:48: error: expected declaration specifiers or '...' before
'u_int16_t'
bcrypt/pybc_blf.h:75:11: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'pybc_Blo
wfish_stream2word'
bcrypt/blowfish.c:55:41: error: expected declaration specifiers or '...' before
'u_int32_t'
bcrypt/blowfish.c:55:56: error: expected declaration specifiers or '...' before
'u_int32_t'
bcrypt/blowfish.c: In function 'pybc_Blowfish_encipher':
bcrypt/blowfish.c:57:2: error: 'u_int32_t' undeclared (first use in this
function)
bcrypt/blowfish.c:57:2: note: each undeclared identifier is reported only once
for each function
it appears in
bcrypt/blowfish.c:57:12: error: expected ';' before 'Xl'
bcrypt/blowfish.c:58:12: error: expected ';' before 'Xr'
bcrypt/blowfish.c:59:13: error: 's' undeclared (first use in this function)
bcrypt/blowfish.c:59:18: error: 'pybc_blf_ctx' has no member named 'S'
bcrypt/blowfish.c:60:13: error: 'p' undeclared (first use in this function)
bcrypt/blowfish.c:60:18: error: 'pybc_blf_ctx' has no member named 'P'
bcrypt/blowfish.c:62:2: error: 'Xl' undeclared (first use in this function)
bcrypt/blowfish.c:62:8: error: 'xl' undeclared (first use in this function)
bcrypt/blowfish.c:63:2: error: 'Xr' undeclared (first use in this function)
bcrypt/blowfish.c:63:8: error: 'xr' undeclared (first use in this function)
bcrypt/blowfish.c: In function 'pybc_Blowfish_initstate':
bcrypt/blowfish.c:85:2: error: extra brace group at end of initializer
bcrypt/blowfish.c:85:2: error: (near initialization for 'initstate')
bcrypt/blowfish.c:86:3: error: extra brace group at end of initializer
bcrypt/blowfish.c:86:3: error: (near initialization for 'initstate')
bcrypt/blowfish.c:151:3: error: extra brace group at end of initializer
bcrypt/blowfish.c:151:3: error: (near initialization for 'initstate')
bcrypt/blowfish.c:216:3: error: extra brace group at end of initializer
bcrypt/blowfish.c:216:3: error: (near initialization for 'initstate')
bcrypt/blowfish.c:281:3: error: extra brace group at end of initializer
bcrypt/blowfish.c:281:3: error: (near initialization for 'initstate')
bcrypt/blowfish.c:346:2: warning: excess elements in struct initializer
bcrypt/blowfish.c:346:2: warning: (near initialization for 'initstate')
bcrypt/blowfish.c:347:2: error: extra brace group at end of initializer
bcrypt/blowfish.c:347:2: error: (near initialization for 'initstate')
bcrypt/blowfish.c:353:2: warning: excess elements in struct initializer
bcrypt/blowfish.c:353:2: warning: (near initialization for 'initstate')
bcrypt/blowfish.c: At top level:
bcrypt/blowfish.c:359:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'pybc_Blo
wfish_stream2word'
bcrypt/blowfish.c:380:51: warning: type defaults to 'int' in declaration of
'u_int8_t'
bcrypt/blowfish.c:380:60: error: expected ';', ',' or ')' before '*' token
bcrypt/blowfish.c:419:50: warning: type defaults to 'int' in declaration of
'u_int8_t'
bcrypt/blowfish.c:419:59: error: expected ';', ',' or ')' before '*' token
bcrypt/blowfish.c:462:31: error: expected declaration specifiers or '...'
before 'u_int32_t'
bcrypt/blowfish.c:462:48: error: expected declaration specifiers or '...'
before 'u_int16_t'
bcrypt/blowfish.c: In function 'pybc_blf_enc':
bcrypt/blowfish.c:464:2: error: 'u_int32_t' undeclared (first use in this
function)
bcrypt/blowfish.c:464:13: error: 'd' undeclared (first use in this function)
bcrypt/blowfish.c:465:2: error: 'u_int16_t' undeclared (first use in this
function)
bcrypt/blowfish.c:465:12: error: expected ';' before 'i'
bcrypt/blowfish.c:467:6: error: 'data' undeclared (first use in this function)
bcrypt/blowfish.c:468:7: error: 'i' undeclared (first use in this function)
bcrypt/blowfish.c:468:18: error: 'blocks' undeclared (first use in this
function)
bcrypt/blowfish.c:469:3: error: too many arguments to function
'pybc_Blowfish_encipher'
bcrypt/blowfish.c:55:1: note: declared here
error: command 'gcc' failed with exit status 1
Any suggestions?
Original comment by rbfuente...@gmail.com
on 14 May 2012 at 4:56
The py-bcrypt_11.patch fixed it for me; I applied it manually.
Thanks a lot and do apply that patch to future releases for Windows, please.
Running it on a Windows 7 with the MinGW suite that comes with the Codeblocks
IDE
Original comment by ashwi...@gmail.com
on 12 Jun 2012 at 2:48
There is yet another issue with compiling on windows as cl cannot cope with
definition of variables mid-function and thus char* password/salt_copy will not
work.
I attached a patch that combines the above patch (which is awesome <3) with my
fixes.
One note though: The lines concerning bzero/memset dont seem to be present any
more so they are not in my patch, of course.
Original comment by florian....@gmail.com
on 18 Jun 2012 at 7:25
Attachments:
Following up on florian's patch, I would love to see that pushed through... It
is really needed!
Original comment by WCDolphin@gmail.com
on 20 Aug 2012 at 7:42
Combining Florian, rye and beng's changes, I went ahead and created a repo on
Github. I am hoping anyone with further changes will fork and pull on Github,
or else here. Seeing as there does not seem to be much activity on this
repository (sadly).
https://github.com/wcdolphin/py-bcrypt
Original comment by WCDolphin@gmail.com
on 27 Aug 2012 at 2:44
Hi,
I've pushed some changes in preparation of a py-bcrypt-0.4 release that include
a tweaked version of this patch. Please give the current hg tip a test and let
me know if it fixes the problems on Windows - I haven't had access to MSVC for
a few years to test myself.
-d
Original comment by d...@djm.net.au
on 27 Jul 2013 at 11:56
Original comment by d...@djm.net.au
on 27 Jul 2013 at 11:56
As mentioned by florian (#8), revision 32 again has a variable declaration
which is not at the beginning of the function. MSVC therefore cannot compile
the project.
The attached patch solves the issue for revision 32.
Original comment by basvdw...@gmail.com
on 12 Aug 2013 at 1:50
Attachments:
Patch applied - thanks!
Original comment by d...@djm.net.au
on 25 Aug 2013 at 12:27
Original issue reported on code.google.com by
ixma...@gmail.com
on 31 Mar 2011 at 5:55