[issue22432] function crypt not working on OSX

2014-09-17 Thread Mark Wieczorek

New submission from Mark Wieczorek:

Hi, 

I just wanted to let you know of a bug that is related to the function crypt 
in osx (10.9.4). I have tried the default osx version of python (2.75), the 
brew version (2.7.8), and the macports version (2.7.7).

In short, the command

python -c 'import crypt; print crypt.crypt(test12345, $6$salt)'

produces the output : $6n8sgZJBMh4U

The correct output should be 

$6$salt$omHbK1V1Alwa0VKXqLaW38vdS1uUhfx8GTj7XXCJcNUJxABwmYe8Vhpyt2tnnaAFC6UTI7PNk9sTtSGWGnYop.

I have no idea what the problem is.

--
assignee: ronaldoussoren
components: Macintosh
messages: 227002
nosy: lunokhod, ronaldoussoren
priority: normal
severity: normal
status: open
title: function crypt not working on OSX
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22432
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22432] function crypt not working on OSX

2014-09-17 Thread Geoffrey Spear

Geoffrey Spear added the comment:

The same behavior exists in Python 3, however, I'm not sure it's a bug. The 
documentation says The characters in salt must be in the set [./a-zA-Z0-9]. 
Presumably the behavior when there is a $ in the salt is undefined by Python, 
and different on different platforms.

--
nosy: +geoffreyspear

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22432
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22432] function crypt not working on OSX

2014-09-17 Thread Mark Wieczorek

Mark Wieczorek added the comment:

It actually doesn't even matter what you use for salt. If you change salt, 
you get the same hash. That is bug #2 !

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22432
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22432] function crypt not working on OSX

2014-09-17 Thread Geoffrey Spear

Geoffrey Spear added the comment:

This is actually the expected behavior of crypt(3) on OS X. It doesn't support 
the $id$ modular format, and if the salt does not begin with an underscore only 
the first 2 bytes are used (presumably in your bug #2 you're changing parts 
of the salt beyond the first 2 bytes.)

Python's behavior differing based on the underlying C library on the system is 
documented; this is neither a bug in Python or in OS X crypt (although it could 
be argued that OS X crypt is kind of useless and insecure...)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22432
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22432] function crypt not working on OSX

2014-09-17 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22432
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com