summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/Make.common.rules10
-rw-r--r--config/Make.common.rules.mak15
-rwxr-xr-xcpp/allTests.py2
-rw-r--r--cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp45
-rwxr-xr-xcpp/test/Glacier2/attack/run.py2
-rwxr-xr-xcpp/test/Glacier2/hashpassword/run.py (renamed from cpp/test/Glacier2/cryptpasswd/run.py)51
-rwxr-xr-xcpp/test/Glacier2/router/run.py2
-rwxr-xr-xcpp/test/Glacier2/sessionHelper/run.py2
-rwxr-xr-xcpp/test/Glacier2/staticFiltering/run.py2
-rwxr-xr-xcsharp/test/Glacier2/router/run.py2
-rwxr-xr-xcsharp/test/Glacier2/sessionHelper/run.py2
-rwxr-xr-xjava/test/src/main/java/test/Glacier2/router/run.py2
-rwxr-xr-xjava/test/src/main/java/test/Glacier2/sessionHelper/run.py2
-rwxr-xr-xjs/test/Glacier2/router/run.py2
-rwxr-xr-xscripts/TestUtil.py8
-rw-r--r--scripts/hashpassword.py (renamed from scripts/cryptpasswd.py)26
16 files changed, 81 insertions, 94 deletions
diff --git a/config/Make.common.rules b/config/Make.common.rules
index 74e5d1b6a2d..4290f2760f5 100644
--- a/config/Make.common.rules
+++ b/config/Make.common.rules
@@ -497,3 +497,13 @@ install-common::
then \
$(call installdata,$(top_srcdir)/../CHANGES$(TEXT_EXTENSION),$(DESTDIR)$(install_docdir)) ; \
fi
+
+ @if test ! -f $(DESTDIR)$(install_bindir)/hashpassword.py ; \
+ then \
+ if test ! -d $(DESTDIR)$(install_bindir) ; \
+ then \
+ echo "Creating $(DESTDIR)$(install_bindir)..." ; \
+ $(call mkdir, $(DESTDIR)$(install_bindir), -p) ; \
+ fi ; \
+ $(call installprogram,$(top_srcdir)/../scripts/hashpassword.py,$(DESTDIR)$(install_bindir)) ; \
+ fi
diff --git a/config/Make.common.rules.mak b/config/Make.common.rules.mak
index 2d0c2c6f19e..29ac97bc582 100644
--- a/config/Make.common.rules.mak
+++ b/config/Make.common.rules.mak
@@ -197,10 +197,17 @@ install-common::
!if "$(WINRT)" != "yes" && "$(install_slicedir)" != ""
@if not exist "$(install_slicedir)" \
- @echo "Creating $(install_slicedir)..." && \
- mkdir "$(install_slicedir)" && \
- @echo "Copying slice files..." && \
- cmd /c "xcopy /s /y $(top_srcdir)\..\slice "$(install_slicedir)"" || exit 1
+ @echo "Creating $(install_slicedir)..." && \
+ mkdir "$(install_slicedir)" && \
+ @echo "Copying slice files..." && \
+ cmd /c "xcopy /s /y $(top_srcdir)\..\slice "$(install_slicedir)"" || exit 1
+
+ @if not exist "$(install_bindir)" \
+ @echo "Creating $(install_bindir)..." && \
+ mkdir "$(install_bindir)"
+
+ @if not exist "$(install_bindir)\hashpassword.py" \
+ copy $(top_srcdir)\..\scripts\hashpassword.py "$(install_bindir)""
@if not exist "$(prefix)\ICE_LICENSE$(TEXT_EXT)" \
@copy $(top_srcdir)\..\ICE_LICENSE$(TEXT_EXT) "$(prefix)"
diff --git a/cpp/allTests.py b/cpp/allTests.py
index 860fc464940..0450e42b3fc 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -115,7 +115,7 @@ tests = [
("Glacier2/dynamicFiltering", ["service", "novc100", "nomingw"]),
("Glacier2/staticFiltering", ["service", "noipv6", "novc100", "nomingw", "nomx"]),
("Glacier2/sessionHelper", ["core", "novc100", "nomingw"]),
- ("Glacier2/cryptpasswd", ["once", "nomingw", "novalgrind", "noappverifier"])
+ ("Glacier2/hashpassword", ["once", "nomingw", "novalgrind", "noappverifier"])
]
#
diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp
index 811107635ac..b80de97087e 100644
--- a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp
+++ b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp
@@ -24,8 +24,6 @@
#elif defined(_WIN32)
# include <Bcrypt.h>
# include <Wincrypt.h>
-#else
-# include <openssl/des.h>
#endif
using namespace std;
@@ -35,7 +33,7 @@ using namespace Glacier2;
namespace
{
-class CryptPermissionsVerifierI : public PermissionsVerifier, public IceUtil::Mutex
+class CryptPermissionsVerifierI : public PermissionsVerifier
{
public:
@@ -112,9 +110,9 @@ const string padBytes1 = "=";
const string padBytes2 = "==";
inline string
-paddingBytes(int lenght)
+paddingBytes(int length)
{
- switch(lenght % 4)
+ switch(length % 4)
{
case 2:
{
@@ -136,8 +134,6 @@ paddingBytes(int lenght)
bool
CryptPermissionsVerifierI::checkPermissions(const string& userId, const string& password, string&, const Current&) const
{
- IceUtil::Mutex::Lock sync(*this);
-
map<string, string>::const_iterator p = _passwords.find(userId);
if(p == _passwords.end())
@@ -145,27 +141,21 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
return false;
}
#if defined(__GLIBC__)
- string salt;
size_t i = p->second.rfind('$');
if(i == string::npos)
{
//
- // Crypt DES
+ // Crypt DES not supported
//
- if(p->second.size() != 13) // Crypt DES passwords are 13 characters long.
- {
- return false;
- }
- salt = p->second.substr(0, 2);
+ return false;
}
- else
+
+ string salt = p->second.substr(0, i + 1);
+ if(salt.empty())
{
- salt = p->second.substr(0, i + 1);
- if(salt.empty())
- {
- return false;
- }
+ return false;
}
+
struct crypt_data data;
data.initialized = 0;
return p->second == crypt_r(password.c_str(), salt.c_str(), &data);
@@ -399,20 +389,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
return checksumBuffer1 == checksumBuffer2;
# endif
#else
-
- if(p->second.size() != 13) // Crypt passwords are 13 characters long.
- {
- return false;
- }
-
- char buff[14];
- string salt = p->second.substr(0, 2);
-# if OPENSSL_VERSION_NUMBER >= 0x0090700fL
- DES_fcrypt(password.c_str(), salt.c_str(), buff);
-# else
- des_fcrypt(password.c_str(), salt.c_str(), buff);
-# endif
- return p->second == buff;
+# error CryptPermissionsVerifierI not supported
#endif
}
diff --git a/cpp/test/Glacier2/attack/run.py b/cpp/test/Glacier2/attack/run.py
index 36540456af9..a0b32380085 100755
--- a/cpp/test/Glacier2/attack/run.py
+++ b/cpp/test/Glacier2/attack/run.py
@@ -29,7 +29,7 @@ if TestUtil.appverifier:
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
args = ' --Glacier2.RoutingTable.MaxSize=10' + \
' --Glacier2.Client.Endpoints="default -p 12347"' + \
diff --git a/cpp/test/Glacier2/cryptpasswd/run.py b/cpp/test/Glacier2/hashpassword/run.py
index 26a44f1d2ba..221477b43dd 100755
--- a/cpp/test/Glacier2/cryptpasswd/run.py
+++ b/cpp/test/Glacier2/hashpassword/run.py
@@ -20,20 +20,20 @@ if len(path) == 0:
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil
-cryptpasswd = os.path.join(path[0], "scripts", "cryptpasswd.py")
+hashpassword = os.path.join(path[0], "scripts", "hashpassword.py")
def test(b):
if not b:
raise RuntimeError('test assertion failed')
-def cryptPasswords(password, args = ""):
- p = subprocess.Popen("%s %s %s" % (sys.executable, cryptpasswd, args), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+def hashPasswords(password, args = ""):
+ p = subprocess.Popen("%s %s %s" % (sys.executable, hashpassword, args), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
stdin=subprocess.PIPE)
p.stdin.write(password.encode('UTF-8'))
p.stdin.write('\r\n'.encode('UTF-8'))
p.stdin.flush()
if(p.wait() != 0):
- print("cryptpasswd.py failed:\n" + p.stdout.read().decode('UTF-8').strip())
+ print("hashpassword.py failed:\n" + p.stdout.read().decode('UTF-8').strip())
sys.exit(1)
hash = p.stdout.readline().decode('UTF-8').strip()
return hash
@@ -47,29 +47,29 @@ if usePBKDF2:
sys.stdout.write("Testing PBKDF2 crypt passwords...")
sys.stdout.flush()
- test(passlib.hash.pbkdf2_sha256.verify("abc123", cryptPasswords("abc123")))
- test(not passlib.hash.pbkdf2_sha256.verify("abc123", cryptPasswords("abc")))
+ test(passlib.hash.pbkdf2_sha256.verify("abc123", hashPasswords("abc123")))
+ test(not passlib.hash.pbkdf2_sha256.verify("abc123", hashPasswords("abc")))
- test(passlib.hash.pbkdf2_sha1.verify("abc123", cryptPasswords("abc123", "-d sha1")))
- test(not passlib.hash.pbkdf2_sha1.verify("abc123", cryptPasswords("abc", "-d sha1")))
+ test(passlib.hash.pbkdf2_sha1.verify("abc123", hashPasswords("abc123", "-d sha1")))
+ test(not passlib.hash.pbkdf2_sha1.verify("abc123", hashPasswords("abc", "-d sha1")))
- test(passlib.hash.pbkdf2_sha512.verify("abc123", cryptPasswords("abc123", "-d sha512")))
- test(not passlib.hash.pbkdf2_sha512.verify("abc123", cryptPasswords("abc", "-d sha512")))
+ test(passlib.hash.pbkdf2_sha512.verify("abc123", hashPasswords("abc123", "-d sha512")))
+ test(not passlib.hash.pbkdf2_sha512.verify("abc123", hashPasswords("abc", "-d sha512")))
#
# Now use custom rounds, md5 digest doesn't support
#
- hash = cryptPasswords("abc123", "-r 1000")
+ hash = hashPasswords("abc123", "-r 1000")
if hash.find("$pbkdf2-sha256$1000$") == -1:
test(False)
test(passlib.hash.pbkdf2_sha256.verify("abc123", hash))
- hash = cryptPasswords("abc123", "-r 1000 -d sha1")
+ hash = hashPasswords("abc123", "-r 1000 -d sha1")
if hash.find("$pbkdf2$1000$") == -1:
test(False)
test(passlib.hash.pbkdf2_sha1.verify("abc123", hash))
- hash = cryptPasswords("abc123", "-r 1000 -d sha512")
+ hash = hashPasswords("abc123", "-r 1000 -d sha512")
if hash.find("$pbkdf2-sha512$1000$") == -1:
test(False)
test(passlib.hash.pbkdf2_sha512.verify("abc123", hash))
@@ -81,35 +81,32 @@ elif useCryptExt:
sys.stdout.write("Testing Linux crypt passwords...")
sys.stdout.flush()
- test(passlib.hash.sha512_crypt.verify("abc123", cryptPasswords("abc123")))
- test(not passlib.hash.sha512_crypt.verify("abc123", cryptPasswords("abc")))
+ test(passlib.hash.sha512_crypt.verify("abc123", hashPasswords("abc123")))
+ test(not passlib.hash.sha512_crypt.verify("abc123", hashPasswords("abc")))
- test(passlib.hash.sha256_crypt.verify("abc123", cryptPasswords("abc123", "-d sha256")))
- test(not passlib.hash.sha256_crypt.verify("abc123", cryptPasswords("abc", "-d sha256")))
+ test(passlib.hash.sha256_crypt.verify("abc123", hashPasswords("abc123", "-d sha256")))
+ test(not passlib.hash.sha256_crypt.verify("abc123", hashPasswords("abc", "-d sha256")))
- test(passlib.hash.md5_crypt.verify("abc123", cryptPasswords("abc123", "-d md5")))
- test(not passlib.hash.md5_crypt.verify("abc123", cryptPasswords("abc", "-d md5")))
-
- test(passlib.hash.des_crypt.verify("abc123", cryptPasswords("abc123", "-d des")))
- test(not passlib.hash.des_crypt.verify("abc123", cryptPasswords("abc", "-d des")))
+ test(passlib.hash.md5_crypt.verify("abc123", hashPasswords("abc123", "-d md5")))
+ test(not passlib.hash.md5_crypt.verify("abc123", hashPasswords("abc", "-d md5")))
#
- # Now use custom rounds, des and md5 digest doesn't support custom rounds
+ # Now use custom rounds, md5 digest doesn't support custom rounds
#
- hash = cryptPasswords("abc123", "-r 5000")
+ hash = hashPasswords("abc123", "-r 5000")
if hash.find("rounds=") != -1:
test(False)
test(passlib.hash.sha512_crypt.verify("abc123", hash))
- hash = cryptPasswords("abc123", "-d sha256 -r 5000")
+ hash = hashPasswords("abc123", "-d sha256 -r 5000")
if hash.find("rounds=") != -1:
test(False)
test(passlib.hash.sha256_crypt.verify("abc123", hash))
- hash = cryptPasswords("abc123", "-r 10000")
+ hash = hashPasswords("abc123", "-r 10000")
if hash.find("$rounds=10000$") == -1:
test(False)
test(passlib.hash.sha512_crypt.verify("abc123", hash))
- hash = cryptPasswords("abc123", "-d sha256 -r 10000")
+ hash = hashPasswords("abc123", "-d sha256 -r 10000")
if hash.find("$rounds=10000$") == -1:
test(False)
test(passlib.hash.sha256_crypt.verify("abc123", hash))
diff --git a/cpp/test/Glacier2/router/run.py b/cpp/test/Glacier2/router/run.py
index 60e5d448164..37ef96acad2 100755
--- a/cpp/test/Glacier2/router/run.py
+++ b/cpp/test/Glacier2/router/run.py
@@ -57,7 +57,7 @@ name = os.path.join("Glacier2", "router")
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"),
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"),
{"userid": "abc123", "userid-0": "abc123", "userid-1": "abc123",
"userid-2": "abc123", "userid-3": "abc123","userid-4": "abc123"})
#
diff --git a/cpp/test/Glacier2/sessionHelper/run.py b/cpp/test/Glacier2/sessionHelper/run.py
index 14e74172df1..88b823e3f04 100755
--- a/cpp/test/Glacier2/sessionHelper/run.py
+++ b/cpp/test/Glacier2/sessionHelper/run.py
@@ -25,7 +25,7 @@ router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
args = ' --Ice.Warn.Dispatch=0' + \
' --Ice.Warn.Connections=0' + \
diff --git a/cpp/test/Glacier2/staticFiltering/run.py b/cpp/test/Glacier2/staticFiltering/run.py
index de52ea47942..3536afc843d 100755
--- a/cpp/test/Glacier2/staticFiltering/run.py
+++ b/cpp/test/Glacier2/staticFiltering/run.py
@@ -32,7 +32,7 @@ serverCmd = os.path.join(os.getcwd(), 'server')
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
targets = []
if TestUtil.appverifier:
diff --git a/csharp/test/Glacier2/router/run.py b/csharp/test/Glacier2/router/run.py
index c32b3873c0c..3cb85c382e9 100755
--- a/csharp/test/Glacier2/router/run.py
+++ b/csharp/test/Glacier2/router/run.py
@@ -25,7 +25,7 @@ router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
args = ' --Ice.Warn.Dispatch=0' + \
' --Ice.Warn.Connections=0' + \
diff --git a/csharp/test/Glacier2/sessionHelper/run.py b/csharp/test/Glacier2/sessionHelper/run.py
index 4bfc2a41224..1757891f88d 100755
--- a/csharp/test/Glacier2/sessionHelper/run.py
+++ b/csharp/test/Glacier2/sessionHelper/run.py
@@ -23,7 +23,7 @@ import TestUtil
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
diff --git a/java/test/src/main/java/test/Glacier2/router/run.py b/java/test/src/main/java/test/Glacier2/router/run.py
index 7baa3ac3c5c..91bc297b18a 100755
--- a/java/test/src/main/java/test/Glacier2/router/run.py
+++ b/java/test/src/main/java/test/Glacier2/router/run.py
@@ -26,7 +26,7 @@ router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
args = ' --Ice.Warn.Dispatch=0' + \
' --Ice.Warn.Connections=0' + \
diff --git a/java/test/src/main/java/test/Glacier2/sessionHelper/run.py b/java/test/src/main/java/test/Glacier2/sessionHelper/run.py
index 4146018f313..66f7b2b6f3e 100755
--- a/java/test/src/main/java/test/Glacier2/sessionHelper/run.py
+++ b/java/test/src/main/java/test/Glacier2/sessionHelper/run.py
@@ -26,7 +26,7 @@ router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
args = ' --Ice.Warn.Dispatch=0' + \
' --Ice.Warn.Connections=0' + \
diff --git a/js/test/Glacier2/router/run.py b/js/test/Glacier2/router/run.py
index e1ba5205563..7e53eb97f20 100755
--- a/js/test/Glacier2/router/run.py
+++ b/js/test/Glacier2/router/run.py
@@ -25,7 +25,7 @@ router = os.path.join(TestUtil.getCppBinDir(), "glacier2router")
#
# Generate the crypt passwords file
#
-TestUtil.cryptPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
+TestUtil.hashPasswords(os.path.join(os.getcwd(), "passwords"), {"userid": "abc123"})
args = ' --Ice.Warn.Dispatch=0' + \
' --Ice.Warn.Connections=0' + \
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index 0ee9a0b73af..f0c1d56a3eb 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -828,21 +828,21 @@ def getNodeCommand():
return nodeCmd
#
-# Create a passwords file that contains the given users/passwords using cryptpasswd.py
+# Create a passwords file that contains the given users/passwords using hashpassword.py
#
-def cryptPasswords(filePath, entries):
+def hashPasswords(filePath, entries):
if os.path.exists(filePath):
os.remove(filePath)
passwords = open(filePath, "a")
for user, password in entries.items():
p = subprocess.Popen(
- "%s %s" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "cryptpasswd.py"))),
+ "%s %s" % (sys.executable, os.path.abspath(os.path.join(os.path.dirname(__file__), "hashpassword.py"))),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE)
p.stdin.write(password.encode('UTF-8'))
p.stdin.write('\r\n'.encode('UTF-8'))
p.stdin.flush()
if(p.wait() != 0):
- print("cryptpasswd.py failed:\n" + p.stdout.read().decode('UTF-8').strip())
+ print("hashpassword.py failed:\n" + p.stdout.read().decode('UTF-8').strip())
passwords.close()
sys.exit(1)
passwords.write("%s %s\n" % (user, p.stdout.readline().decode('UTF-8').strip()))
diff --git a/scripts/cryptpasswd.py b/scripts/hashpassword.py
index 561751c92d8..9b7b2e47c06 100644
--- a/scripts/cryptpasswd.py
+++ b/scripts/hashpassword.py
@@ -13,22 +13,26 @@ import sys, getopt, passlib.hash, 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("cryptpasswd [options]")
+ print("hashpassword [options]")
print("")
print("OPTIONS")
print("")
if usePBKDF2:
print("")
- print(" -d DIGEST_ALGORITHM, --digest=DIGEST_ALGORITHM")
- print(" The digest algorithm to use with PBKDF2, valid values are (sha1, sha256, sha512).")
+ print(" -d MESSAGE_DIGEST_ALGORITHM, --digest=MESSAGE_DIGEST_ALGORITHM")
+ print(" The message digest algorithm to use with PBKDF2, valid values are (sha1, sha256, sha512).")
print("")
print(" -s SALT_SIZE, --salt=SALT_SIZE")
print(" Optional number of bytes to use when generating new salts.")
print("")
elif useCryptExt:
- print(" -d DIGEST_ALGORITHM, --digest=DIGEST_ALGORITHM")
- print(" The digest algorithm to use with crypt function, valid values are (des, md5, sha256, sha512).")
+ print(" -d MESSAGE_DIGEST_ALGORITHM, --digest=MESSAGE_DIGEST_ALGORITHM")
+ print(" The message digest algorithm to use with crypt function, valid values are (md5, sha256, sha512).")
print("")
if usePBKDF2 or useCryptExt:
print(" -r ROUNDS, --rounds=ROUNDS")
@@ -50,7 +54,7 @@ def encrypt():
elif useCryptExt:
shortArgs += "d:r:"
longArgs += ["digest=", "rounds="]
- digestAlgorithms = ("des", "md5", "sha256", "sha512")
+ digestAlgorithms = ("md5", "sha256", "sha512")
try:
opts, args = getopt.getopt(sys.argv[1:], shortArgs, longArgs)
@@ -106,13 +110,7 @@ def encrypt():
encryptfn = passlib.hash.pbkdf2_sha512.encrypt
elif useCryptExt:
encryptfn = passlib.hash.sha512_crypt.encrypt
- if digest == "des":
- if rounds:
- print("Custom rounds not allowed with des digest")
- usage()
- sys.exit(2)
- encryptfn = passlib.hash.des_crypt.encrypt
- elif digest == "md5":
+ if digest == "md5":
if rounds:
print("Custom rounds not allowed with md5 digest")
usage()
@@ -120,8 +118,6 @@ def encrypt():
encryptfn = passlib.hash.md5_crypt.encrypt
elif digest == "sha256":
encryptfn = passlib.hash.sha256_crypt.encrypt
- else:
- encryptfn = passlib.hash.des_crypt.encrypt
args = []
if sys.stdout.isatty():