Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
putro
autonym
Commits
833e1a48
Commit
833e1a48
authored
Apr 02, 2014
by
putro
Browse files
removed unused function to choose random remailer and fixed/cleaned menu
parent
e23d226d
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
833e1a48
...
...
@@ -50,11 +50,10 @@ def menu():
selection
=
raw_input
(
"Enter
\n\
1 to choose/select active nym
\n\
2 to write a message (as active nym)
\n\
3 to delete a nym
\n\
5 to choose remailers chain
\n\
6 to create or update a nym
\n\
8 to create a new secret key
\n\
9 to delete a secret key
\n\
3 to create or update a nym
\n\
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
"
)
...
...
@@ -66,19 +65,12 @@ def menu():
writeMessage
()
menu
()
elif
selection
==
"3"
:
#sendMixMsg()
deleteNym
()
menu
()
elif
selection
==
"5"
:
sendMixMsg
(
dest
=
"drugo@autistici.org"
,
msg
=
"test"
)
menu
()
elif
selection
==
"6"
:
createNym
()
menu
()
elif
selection
==
"
7
"
:
modifyConfig
()
elif
selection
==
"
4
"
:
deleteNym
()
menu
()
elif
selection
==
"
8
"
:
elif
selection
==
"
5
"
:
print
"
\n
secret keys in your keyring:"
gpgfuncts
.
listSecKeys
()
print
"
\n
"
...
...
@@ -87,19 +79,17 @@ def menu():
gpgfuncts
.
listSecKeys
()
pressKey
()
menu
()
elif
selection
==
"
9
"
:
elif
selection
==
"
6
"
:
sk
=
gpgfuncts
.
defineSecKey
()
fp
=
sk
[
"fingerprint"
]
deleteKey
(
fp
)
msg
=
"key of %s deleted"
%
sk
[
"uids"
][
1
]
config
[
'last_message'
]
=
msg
menu
()
elif
selection
==
"
10
"
:
sendMs
g
()
elif
selection
==
"
7
"
:
modifyConfi
g
()
menu
()
elif
selection
==
"q"
:
#f = open(options.message_out, "w")
# shred messages_out ??
sys
.
exit
(
"bye bye"
)
else
:
print
"wrong selection"
...
...
@@ -142,7 +132,6 @@ def createNym():
config
[
'last_message'
]
=
"Something went wrong while preparing the message, recipient key missing ???"
menu
()
sendMixMsg
(
dest
,
emsg
)
#return
def
deleteNym
():
config
[
'last_message'
]
=
"Function not yet implemented"
...
...
@@ -212,8 +201,7 @@ def writeMessage():
print
"message already encrypted"
pressKey
()
elif
gpgfuncts
.
encrypt
(
"test"
,
recipient
,
test
=
True
).
status
==
"encryption ok"
:
# barbatrucco veramente infimo per risolvere il problema per cui
# la prima riga del messaggio viene scartata
# really bad fix to solve a ridicoulus problem, first line get removed... to be investigated
text
=
"Message:
\n
"
+
text
text
=
gpgfuncts
.
encrypt
(
text
,
recipient
)
print
"message has been encrypted with %s public key"
%
recipient
...
...
@@ -271,29 +259,6 @@ def chooseChain():
validateChain
(
chain
)
#def chooseRandomChain():
# """ Choose a 3 random remailer chain """
# import random
# remailers = uptime_sort_m()
# remailers[:] = [r for r in remailers if stats_m[r].uptime > float(config['stats']['remailer_min_uptime'])]
# n = len(remailers)
#
# r1 = str(random.randrange(1, n + 1))
# r2 = str(random.randrange(1, n + 1))
# while r2 == r1:
# r2 = str(random.randrange(1, n + 1))
# r3 = str(random.randrange(1, n + 1))
# while r3 == r2:
# r3 = str(random.randrange(1, n + 1))
# while True:
# if checkMiddle(remailers[int(r3) - 1]):
# r3 = str(random.randrange(1, n + 1))
# else:
# break
# chain = r1 + "," + r2 + "," + r3
# validateChain(chain, random=True)
def
validateChain
(
chain
):
"""
Validate remailer chain, check the availability of public key of remailers
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment