From 069c4270a442456f1294d7218c3d1b34fa931ab5 Mon Sep 17 00:00:00 2001 From: Lassulus Date: Tue, 24 May 2011 14:48:28 +0200 Subject: fixed remote shell execution --- hosts/.scripts/tinc_multicast/retiolum.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hosts/.scripts/tinc_multicast') diff --git a/hosts/.scripts/tinc_multicast/retiolum.py b/hosts/.scripts/tinc_multicast/retiolum.py index 6f1064e2..a89b3594 100755 --- a/hosts/.scripts/tinc_multicast/retiolum.py +++ b/hosts/.scripts/tinc_multicast/retiolum.py @@ -4,13 +4,15 @@ from optparse import OptionParser def pub_encrypt(netname, hostname_t, text): #encrypt data with public key logging.debug("encrypt: " + text) + if hostname_t.find("`") != -1: return(-1) try: - enc_text = subprocess.os.popen("echo '" + text + "' | openssl rsautl -pubin -inkey /etc/tinc/" + netname + "/hosts/.pubkeys/" + hostname_t + " -encrypt | base64") + enc_text = subprocess.os.popen("echo '" + text + "' | openssl rsautl -pubin -inkey /etc/tinc/" + netname + "/hosts/.pubkeys/" + hostname_t + " -encrypt | base64 -w0") return(enc_text.read()) except: return(-1) def priv_decrypt(netname, enc_data): #decrypt data with private key + if enc_data.find("`") != -1: return(-1) dec_text = subprocess.os.popen("echo '" + enc_data + "' | base64 -d | openssl rsautl -inkey /etc/tinc/" + netname + "/rsa_key.priv -decrypt") return(dec_text.read()) -- cgit v1.2.3