From 843c5fc2f46a9b3148bd987d68b191a3987a8f19 Mon Sep 17 00:00:00 2001 From: SlashMe Date: Thu, 10 Oct 2013 15:51:27 +0200 Subject: [PATCH] modification de key pour windob --- key/key.py | 38 ++++++++++++++++++++++---------------- key/kk | 28 ---------------------------- 2 files changed, 22 insertions(+), 44 deletions(-) delete mode 100755 key/kk diff --git a/key/key.py b/key/key.py index c465881..db4d177 100755 --- a/key/key.py +++ b/key/key.py @@ -2,26 +2,32 @@ import os, re print "This isn't even the pre-pre-alpha phase, please don't attack this server." -print "Provide your ssh publikey (RSA 2048 bits):" -entry = str(raw_input()) -if entry[0:7] == "ssh-rsa": - entry = entry[8:] -key = entry[:372] - -if len(key) != 372: - print "Bad key." - quit() - -if re.match("^[A-Za-z0-9+/]*$", key): - line = "sudo /sschat/key/keycat.sh '"+key+"'" - os.system(line) -else: - print "Bad key." - quit() +ok=False +while ok == False : + print "Paste your one-line ssh publikey (RSA 2048 bits):" + entry = str(raw_input()) + if entry[0:7] == "ssh-rsa": + entry = entry[8:] + key = entry[:372] + + if len(key) != 372: + print "Bad key." + continue + + if re.match("^[A-Za-z0-9+/]*$", key): + line = "sudo /sschat/key/keycat.sh '"+key+"'" + os.system(line) + ok=True + else: + print "Bad key." + continue print "\n\n Congratulations!" print "You can now connect to the user sschat." print "For now, you'll most likely find people in the channel : plop " print "\n\nPlease note that this server will not keep any trace of anything but your publikey." print "Please remember that this service comes with NO FUCKING GUARANTEE" +print "\nEnter to quit." +raw_input() +quit() diff --git a/key/kk b/key/kk deleted file mode 100755 index f564fae..0000000 --- a/key/kk +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python -import os, re - -print "This isn't even the pre-pre-alpha phase, please don't attack this server." - -while 1 : - print "Provide your ssh publikey (RSA 2048 bits):" - entry = str(raw_input()) - if entry[0:7] == "ssh-rsa": - entry = entry[8:] - key = entry[:372] - - if len(key) != 372: - print "Bad key." - continue - - if re.match("^[A-Za-z0-9+/]*$", key): - line = "sudo /sschat/key/keycat.sh '"+key+"'" - os.system(line) - break - else: - print "Bad key." - continue - -print "\n\n Congratulations!" -print "You can now connect to the user sschat." -print "For now, you'll most likely find people in the channel : plop " -print "\n\nRemeber that this service comes with NO FUCKING GUARANTEE"