[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-06-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: Actually it should be: if method is not None and method not in methods: ... -- ___ Python tracker ___

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-06-20 Thread Andrei Kulakov
Andrei Kulakov added the comment: How about adding a check to `crypt.mksalt()`: if method and method not in methods: raise ValueError(f'method {method} is not supported') If a method is supplied to `crypt.crypt()`, mksalt() is called with it as an arg, so adding this check will take

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-05-25 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: -mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2021-05-21 Thread Ned Deily
Change by Ned Deily : -- components: +macOS versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2018-04-07 Thread Ron Reiter
Change by Ron Reiter : -- type: -> security ___ Python tracker ___ ___

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2018-04-04 Thread Ronald Oussoren
Ronald Oussoren added the comment: As far as I know macOS does not support different salt types at all. The manpage does mention an "extended crypt", but according to the documentation that just controls the number of DES rounds used. In particular: The salt is a

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2018-04-04 Thread Ned Deily
Ned Deily added the comment: $ ./bin/python3 Python 3.8.0a0 (heads/master:55966f3a0d, Apr 2 2018, 18:16:13) [Clang 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import crypt >>> crypt.methods [] -- nosy:

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2018-04-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: > What's the return value of crypt.crypt("test", crypt.METHOD_SHA512) This is from my Mac (10.13.3): $ python3.6 Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

[issue33213] crypt function not hashing properly on Mac (uses a specific salt)

2018-04-03 Thread Ron Reiter
Change by Ron Reiter : -- title: crypt function not hashing properly -> crypt function not hashing properly on Mac (uses a specific salt) ___ Python tracker

[issue33213] crypt function not hashing properly

2018-04-03 Thread Ron Reiter
Ron Reiter added the comment: Also: >>> crypt.crypt("test", "$5") '$5yVOkTkyRzn.' >>> crypt.crypt("test", "$6") '$6asQOJRqB1i2' >>> crypt.crypt("test", "$7") '$7tSOkvDyiL6U' So the salt is "$6" -- ___ Python tracker

[issue33213] crypt function not hashing properly

2018-04-03 Thread Ron Reiter
Ron Reiter added the comment: Python 3.6.4 (default, Mar 22 2018, 23:35:12) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import crypt >>> crypt.crypt("test",

[issue33213] crypt function not hashing properly

2018-04-03 Thread Christian Heimes
Christian Heimes added the comment: The crypt module is a thin wrapper around the OS' crypt(3) function. The function should return NULL for unsupported salt types. The module turns NULL into None. What's the return value of crypt.crypt("test", crypt.METHOD_SHA512) ?

[issue33213] crypt function not hashing properly

2018-04-03 Thread Ron Reiter
Ron Reiter added the comment: Apparently it's a Mac issue. My crypt.methods only contains [] which is probably why this fails. It's a silent failure of some sort that is causing this. -- ___ Python tracker

[issue33213] crypt function not hashing properly

2018-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I can't reproduce this result. Does your os.urandom() broken and return a short repeated sequence? -- nosy: +mark.dickinson, rhettinger, serhiy.storchaka ___ Python tracker

[issue33213] crypt function not hashing properly

2018-04-03 Thread Ron Reiter
Ron Reiter added the comment: You guessed it, the salt is "$6" -- ___ Python tracker ___

[issue33213] crypt function not hashing properly

2018-04-03 Thread Ron Reiter
Ron Reiter added the comment: import crypt Expected result: >>> crypt.crypt("test") == crypt.crypt("test") False >>> crypt.crypt("test", crypt.mksalt()) == crypt.crypt("test", crypt.mksalt()) False Unexpected results: >>> crypt.crypt("test", crypt.METHOD_SHA512) ==

[issue33213] crypt function not hashing properly

2018-04-03 Thread Ron Reiter
New submission from Ron Reiter : import crypt Expected result: >>> crypt.crypt("test") == crypt.crypt("test") False >>> crypt.crypt("test", crypt.mksalt()) == crypt.crypt("test", crypt.mksalt()) False Unexpected results: >>> crypt.crypt("test", crypt.METHOD_SHA512) ==