summaryrefslogtreecommitdiffstats
path: root/revoke_crt.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-07-09 18:13:29 -0400
committerrsiddharth <s@ricketyspace.net>2019-07-09 18:13:29 -0400
commita88781c2e1e75be0beb6cdad776e15ab1ab960ae (patch)
treeea57201dbcd104d76e02bc74a67ce3f04abb7cf5 /revoke_crt.py
parentfd4386c6b8bf2858da71d3e089528414ecd4a352 (diff)
revoke_crt.py: Write bytes to temporary file.
Files opened using `tempfile.NamedTemporaryFile` are opened by default in binary mode. Writing `str` to the temporary file causes it error out.
Diffstat (limited to 'revoke_crt.py')
-rw-r--r--revoke_crt.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/revoke_crt.py b/revoke_crt.py
index a5ce7e2..e976cb2 100644
--- a/revoke_crt.py
+++ b/revoke_crt.py
@@ -65,7 +65,7 @@ def revoke_crt(pubkey, crt):
crt_protected.update({"nonce": urlopen(nonce_req).headers['Replay-Nonce']})
crt_protected64 = _b64(json.dumps(crt_protected, sort_keys=True, indent=4))
crt_file = tempfile.NamedTemporaryFile(dir=".", prefix="revoke_", suffix=".json")
- crt_file.write("{0}.{1}".format(crt_protected64, crt_b64))
+ crt_file.write("{0}.{1}".format(crt_protected64, crt_b64).encode())
crt_file.flush()
crt_file_name = os.path.basename(crt_file.name)
crt_file_sig = tempfile.NamedTemporaryFile(dir=".", prefix="revoke_", suffix=".sig")