diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-05-03 09:03:13 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-05-03 09:03:13 +0200 |
commit | ff20dd34f91fecfc351804605b822999cde0e593 (patch) | |
tree | 9abce46a1d5403ad64bf350f6d2b5509a91e7eb6 /scripts/icehashpassword.py | |
parent | Fix to no longer recursively try endpoints on connection establishment (diff) | |
download | ice-ff20dd34f91fecfc351804605b822999cde0e593.tar.bz2 ice-ff20dd34f91fecfc351804605b822999cde0e593.tar.xz ice-ff20dd34f91fecfc351804605b822999cde0e593.zip |
AIX port
Diffstat (limited to 'scripts/icehashpassword.py')
-rw-r--r-- | scripts/icehashpassword.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/icehashpassword.py b/scripts/icehashpassword.py index 7f85102f06d..6763143cab3 100644 --- a/scripts/icehashpassword.py +++ b/scripts/icehashpassword.py @@ -8,19 +8,16 @@ # # ********************************************************************** -import sys, getopt, passlib.hash, getpass +import sys, getopt, passlib.hash, passlib.hosts, getpass usePBKDF2 = sys.platform == "win32" or sys.platform == "darwin" useCryptExt = sys.platform.startswith("linux") -if not usePBKDF2 and not useCryptExt: - print("platform not supported") - sys.exit(1) - def usage(): print("Usage: icehashpassword [options]") print("") print("OPTIONS") + if usePBKDF2: print("") print(" -d MESSAGE_DIGEST_ALGORITHM, --digest=MESSAGE_DIGEST_ALGORITHM") @@ -103,7 +100,12 @@ def main(): passScheme = passlib.hash.sha512_crypt if digest == "sha256": passScheme = passlib.hash.sha256_crypt - + else: + # + # Fallback is the OS crypt function + # + passScheme = passlib.hosts.host_context + if rounds: if not passScheme.min_rounds <= rounds <= passScheme.max_rounds: print("Invalid number rounds for the digest algorithm. Value must be an integer between %s and %s" % |