Commit 4d09129a authored by putro's avatar putro
Browse files

added check for nymserver key

parent 5aa53b2c
...@@ -122,9 +122,14 @@ def createNym(): ...@@ -122,9 +122,14 @@ def createNym():
name = askSomething('Enter the name of the nym (without domain): ') name = askSomething('Enter the name of the nym (without domain): ')
server = selectServer(config) server = selectServer(config)
email = name + "@" + server email = name + "@" + server
dest = "config@" + server
if not gpgfuncts.selectKey(dest):
config['last_message'] = "Server %s key not available, abort" % server
menu()
if not gpgfuncts.selectKey(email): if not gpgfuncts.selectKey(email):
print "no key availabke, creating a new one for %s" % email print "no key available, creating a new one for %s" % email
gpgfuncts.createKey(email, name) gpgfuncts.createKey(email, name)
subj_type = chooseSubjType(config) subj_type = chooseSubjType(config)
...@@ -135,10 +140,11 @@ def createNym(): ...@@ -135,10 +140,11 @@ def createNym():
setActiveNym(email) setActiveNym(email)
msg = prepareSetupMsg(gpgfuncts.selectSecKey(email), subj_type, subject) msg = prepareSetupMsg(gpgfuncts.selectSecKey(email), subj_type, subject)
dest = "config@" + server print msg
pressKey()
emsg = signCryptMsg(msg, dest, sign=False) emsg = signCryptMsg(msg, dest, sign=False)
if not emsg: if not emsg:
config['last_message'] = "Something went wrong" config['last_message'] = "Something went wrong while preparing the message, recipient key missing ???"
menu() menu()
sendMixMsg(dest, emsg) sendMixMsg(dest, emsg)
#return #return
......
Supports Markdown
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