zephyr_mirror: Finish outgoing zcrypt.

(imported from commit dfef23feb8e0f6a0a8ba775b6cccd391cb307adb)
This commit is contained in:
Tim Abbott 2013-08-21 16:03:15 -04:00
parent 157fdb94d4
commit 81aebf897b

View file

@ -557,7 +557,7 @@ def send_unauthed_zephyr(zwrite_args, content):
def zcrypt_encrypt_content(zephyr_class, instance, content): def zcrypt_encrypt_content(zephyr_class, instance, content):
keypath = parse_crypt_table(zephyr_class, instance) keypath = parse_crypt_table(zephyr_class, instance)
if keypath is None: if keypath is None:
return content return None
# encrypt the message! # encrypt the message!
p = subprocess.Popen(["gpg", p = subprocess.Popen(["gpg",
@ -627,7 +627,10 @@ def forward_to_zephyr(message):
zwrite_args.extend(recipients) zwrite_args.extend(recipients)
if message['type'] == "stream": if message['type'] == "stream":
wrapped_content = zcrypt_encrypt_content(zephyr_class, instance, wrapped_content) result = zcrypt_encrypt_content(zephyr_class, instance, wrapped_content)
if result is not None:
wrapped_content = result
zwrite_args.extend(["-O", "crypt"])
if options.test_mode: if options.test_mode:
logger.debug("Would have forwarded: %s\n%s" % logger.debug("Would have forwarded: %s\n%s" %