Commit e2ee1a37 authored by putro's avatar putro

fixed bad management of wrong password in signing, fixed mail-to-news option

parent 11bc0e21
......@@ -53,10 +53,9 @@ def menu():
4 to delete a nym\n\
5 to create a new secret key\n\
6 to delete a secret key\n\
10 to send msg via smtp (NOT ANONYMOUS)\n\
q to quit\n\n\n")
#perform actions based on selection above
# perform actions based on selection above
if selection == "1":
askNym()
menu()
......@@ -164,6 +163,8 @@ def prepareSetupMsg(keyid, subj_type, subject):
def signCryptMsg(msg, dest, sign, passphrase):
msg = gpgfuncts.stripVersion(str(gpgfuncts.encrypt(msg, dest, sign=sign, passphrase=passphrase)))
if msg == "ERROR":
menu()
return msg
......@@ -229,7 +230,7 @@ def writeMessage():
if validateEmail(recipient):
msg = msg + "To: %s\n" % recipient
else:
msg = msg + "To: %s\n" % options['mail-to-news']
msg = msg + "To: %s\n" % [config['options']['mail-to-news']]
msg = msg + "Newsgroups: %s\n" % recipient
msg = msg + "Subject: %s\n\n" % subject
......@@ -241,9 +242,7 @@ def writeMessage():
msg = msg + text
dest = 'send@' + anym.domain
emsg = gpgfuncts.stripVersion(str(gpgfuncts.encrypt(msg, dest,
sign=anym.fp,
passphrase=pwd)))
signCryptMsg(msg, dest, sign=anym.fp, passphrase=pwd)
sendMixMsg(dest, emsg)
......
......@@ -155,7 +155,7 @@ def encrypt(message, recipient, sign=False, passphrase=False, test=False):
if not test:
if encrypted_ascii_data.status != "encryption ok":
config['last_message'] = "ERROR " + encrypted_ascii_data.status + " (recipient: %s)" % recipient
return False
return "ERROR"
else:
return stripVersion(str(encrypted_ascii_data))
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment