diff options
author | Lassulus <Lassulus@googlemail.com> | 2011-05-24 14:48:28 +0200 |
---|---|---|
committer | Lassulus <Lassulus@googlemail.com> | 2011-05-24 14:48:28 +0200 |
commit | 525f081a54230b1aafd2d1675bef21afbbfdf1b0 (patch) | |
tree | 860c9f9fc6fcdf5f2fe1b34a12a871304e8faf25 /.scripts | |
parent | e110354524568f4365078ca0a37d9b44d57596a6 (diff) |
fixed remote shell execution
Diffstat (limited to '.scripts')
-rwxr-xr-x | .scripts/tinc_multicast/retiolum.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.scripts/tinc_multicast/retiolum.py b/.scripts/tinc_multicast/retiolum.py index 6f1064e2..a89b3594 100755 --- a/.scripts/tinc_multicast/retiolum.py +++ b/.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()) |