Skip to content
Permalink
Browse files

Little changes to work with recent OpenSSL

  • Loading branch information...
cliffalbert committed Mar 28, 2019
1 parent 82851dd commit 47661e310acb2dfa14cd9f837ee2ea4128787774
Showing with 8 additions and 11 deletions.
  1. +8 −11 decrypt-foscam.py
@@ -187,18 +187,15 @@
TEMP = TEMP.replace("OPENSSL_KEY",ENC_KEYS[key])

p = subprocess.Popen(TEMP, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
p_stderr = p.stderr.readlines()
if not len(p_stderr):
p = subprocess.Popen("gzip -t " + outfile + "", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
p_stderr = p.stderr.read()
if not (p_stderr):
print "Decrypted with: {}".format(TEMP)
sys.exit(0)
else:
print "Decryption NOT OK: {}".format(TEMP)
os.remove(outfile)
p = subprocess.Popen("gzip -t " + outfile + "", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
p_stderr = p.stderr.read()
if not (p_stderr):
print "Decrypted with: {}".format(TEMP)
sys.exit(0)
else:
print p_stderr[0],
print "Decryption NOT OK: {}".format(TEMP)
if (os.path.isfile(outfile)):
os.remove(outfile)
print "Cleaning up..."
os.remove(outfile)
sys.exit(1)

0 comments on commit 47661e3

Please sign in to comment.
You can’t perform that action at this time.