Minor removal of redundant code

This commit is contained in:
Miroslav Stampar 2013-01-18 10:44:57 +01:00
parent 1599b5e37f
commit caae773b2d
2 changed files with 2 additions and 10 deletions

View File

@ -768,13 +768,6 @@ def dataToOutFile(filename, data):
return retVal
def strToHex(value):
"""
Converts string value to it's hexadecimal representation
"""
return (value if not isinstance(value, unicode) else value.encode(UNICODE_ENCODING)).encode("hex").upper()
def readInput(message, default=None, checkBatch=True):
"""
Reads input from terminal

View File

@ -21,8 +21,8 @@ from lib.core.common import isTechniqueAvailable
from lib.core.common import parsePasswordHash
from lib.core.common import randomStr
from lib.core.common import readInput
from lib.core.common import strToHex
from lib.core.common import unArrayizeValue
from lib.core.convert import hexencode
from lib.core.data import conf
from lib.core.data import kb
from lib.core.data import logger
@ -187,7 +187,6 @@ class Users:
if retVal:
for user, password in filterPairValues(zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.password" % randStr])):
# password = "0x%s" % strToHex(password)
if user not in kb.data.cachedUsersPasswords:
kb.data.cachedUsersPasswords[user] = [password]
else:
@ -229,7 +228,7 @@ class Users:
if retVal:
for user, password in filterPairValues(zip(retVal[0]["%s.name" % randStr], retVal[0]["%s.password" % randStr])):
password = "0x%s" % strToHex(password)
password = "0x%s" % hexencode(password).upper()
if user not in kb.data.cachedUsersPasswords:
kb.data.cachedUsersPasswords[user] = [password]