forked from openlp/openlp
bug 1593883 fix - switch from qmd5_hash to md5_hash
This commit is contained in:
parent
aaba690c97
commit
d1ff2385ae
@ -206,9 +206,9 @@ def md5_hash(salt, data=None):
|
|||||||
"""
|
"""
|
||||||
log.debug('md5_hash(salt="{text}")'.format(text=salt))
|
log.debug('md5_hash(salt="{text}")'.format(text=salt))
|
||||||
hash_obj = hashlib.new('md5')
|
hash_obj = hashlib.new('md5')
|
||||||
hash_obj.update(salt)
|
hash_obj.update(salt.encode('ascii'))
|
||||||
if data:
|
if data:
|
||||||
hash_obj.update(data)
|
hash_obj.update(data.encode('ascii'))
|
||||||
hash_value = hash_obj.hexdigest()
|
hash_value = hash_obj.hexdigest()
|
||||||
log.debug('md5_hash() returning "{text}"'.format(text=hash_value))
|
log.debug('md5_hash() returning "{text}"'.format(text=hash_value))
|
||||||
return hash_value
|
return hash_value
|
||||||
@ -225,11 +225,11 @@ def qmd5_hash(salt, data=None):
|
|||||||
"""
|
"""
|
||||||
log.debug('qmd5_hash(salt="{text}"'.format(text=salt))
|
log.debug('qmd5_hash(salt="{text}"'.format(text=salt))
|
||||||
hash_obj = QHash(QHash.Md5)
|
hash_obj = QHash(QHash.Md5)
|
||||||
hash_obj.addData(salt)
|
hash_obj.addData(salt.encode('ascii'))
|
||||||
hash_obj.addData(data)
|
hash_obj.addData(data.encode('ascii'))
|
||||||
hash_value = hash_obj.result().toHex()
|
hash_value = hash_obj.result().toHex()
|
||||||
log.debug('qmd5_hash() returning "{text}"'.format(text=hash_value))
|
log.debug('qmd5_hash() returning "{hash}"'.format(hash=hash_value))
|
||||||
return hash_value.data()
|
return hash_value
|
||||||
|
|
||||||
|
|
||||||
def clean_button_text(button_text):
|
def clean_button_text(button_text):
|
||||||
|
@ -49,7 +49,7 @@ from codecs import decode
|
|||||||
from PyQt5.QtCore import pyqtSignal, pyqtSlot
|
from PyQt5.QtCore import pyqtSignal, pyqtSlot
|
||||||
from PyQt5.QtNetwork import QAbstractSocket, QTcpSocket
|
from PyQt5.QtNetwork import QAbstractSocket, QTcpSocket
|
||||||
|
|
||||||
from openlp.core.common import translate, qmd5_hash
|
from openlp.core.common import translate, md5_hash
|
||||||
from openlp.core.lib.projector.constants import *
|
from openlp.core.lib.projector.constants import *
|
||||||
|
|
||||||
# Shortcuts
|
# Shortcuts
|
||||||
@ -362,7 +362,7 @@ class PJLink1(QTcpSocket):
|
|||||||
else:
|
else:
|
||||||
log.debug('({ip}) Setting hash with salt="{data}"'.format(ip=self.ip, data=data_check[2]))
|
log.debug('({ip}) Setting hash with salt="{data}"'.format(ip=self.ip, data=data_check[2]))
|
||||||
log.debug('({ip}) pin="{data}"'.format(ip=self.ip, data=self.pin))
|
log.debug('({ip}) pin="{data}"'.format(ip=self.ip, data=self.pin))
|
||||||
salt = qmd5_hash(salt=data_check[2].encode('ascii'), data=self.pin.encode('ascii')).encode('utf-8')
|
salt = md5_hash(salt=data_check[2], data=self.pin)
|
||||||
else:
|
else:
|
||||||
salt = None
|
salt = None
|
||||||
# We're connected at this point, so go ahead and do regular I/O
|
# We're connected at this point, so go ahead and do regular I/O
|
||||||
|
Loading…
Reference in New Issue
Block a user