aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFred Miller <fghzxm@outlook.com>2018-10-21 00:05:24 +0800
committerFred Miller <fghzxm@outlook.com>2018-10-22 22:53:58 +0800
commitf16621a38b17d53c76600c12d67031544c055d74 (patch)
treeba4599900895e439e81b4cf0bc1922b9ca36e073 /test
parente8d76d050d89820c08fac2c33a97ed3ae3fc8f26 (diff)
downloadmitmproxy-f16621a38b17d53c76600c12d67031544c055d74.tar.gz
mitmproxy-f16621a38b17d53c76600c12d67031544c055d74.tar.bz2
mitmproxy-f16621a38b17d53c76600c12d67031544c055d74.zip
Make private keys readable only by the owner
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_certs.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/mitmproxy/test_certs.py b/test/mitmproxy/test_certs.py
index 12d3dc96..82b9cdbb 100644
--- a/test/mitmproxy/test_certs.py
+++ b/test/mitmproxy/test_certs.py
@@ -111,6 +111,13 @@ class TestCertStore:
certs.CertStore.load_dhparam(filename)
assert os.path.exists(filename)
+ def test_umask_secret(self, tmpdir):
+ filename = str(tmpdir.join("secret"))
+ with certs.CertStore.umask_secret(), open(filename, "wb"):
+ pass
+ # TODO: How do we actually attempt to read that file as another user?
+ assert os.stat(filename).st_mode & 0o77 == 0
+
class TestDummyCert: