dont allow replies to invalid signatures

master
Kevin Froman 2019-02-17 14:44:51 -06:00
parent 3638db4895
commit a05a391b7e
1 changed files with 9 additions and 4 deletions

View File

@ -144,16 +144,21 @@ class OnionrMail:
if not readBlock.validSig: if not readBlock.validSig:
logger.warn('This message has an INVALID/NO signature. ANYONE could have sent this message.') logger.warn('This message has an INVALID/NO signature. ANYONE could have sent this message.')
cancel = logger.readline('Press enter to continue to message, or -q to not open the message (recommended).') cancel = logger.readline('Press enter to continue to message, or -q to not open the message (recommended).')
print('')
if cancel != '-q': if cancel != '-q':
try: try:
print(draw_border(self.myCore._utils.escapeAnsi(readBlock.bcontent.decode().strip()))) print(draw_border(self.myCore._utils.escapeAnsi(readBlock.bcontent.decode().strip())))
except ValueError: except ValueError:
logger.warn('Error presenting message. This is usually due to a malformed or blank message.') logger.warn('Error presenting message. This is usually due to a malformed or blank message.')
pass pass
reply = logger.readline("Press enter to continue, or enter %s to reply" % ("-r",)) if readBlock.validSig:
print('') reply = logger.readline("Press enter to continue, or enter %s to reply" % ("-r",))
if reply == "-r": print('')
self.draft_message(self.myCore._utils.bytesToStr(readBlock.signer,)) if reply == "-r":
self.draft_message(self.myCore._utils.bytesToStr(readBlock.signer,))
else:
logger.readline("Press enter to continue")
print('')
return return
def sentbox(self): def sentbox(self):