diff options
author | Samoilenko Roman <ttahabatt@gmail.com> | 2018-10-25 11:23:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 11:23:20 +0300 |
commit | 997a20e6524de215f201fbac648435208f0ec235 (patch) | |
tree | 0c582ebdf9970941bb06516f8cd712ff15228474 /test | |
parent | e8d76d050d89820c08fac2c33a97ed3ae3fc8f26 (diff) | |
parent | 28551e96552bc3077d772f8459ddb74e9c0f5253 (diff) | |
download | mitmproxy-997a20e6524de215f201fbac648435208f0ec235.tar.gz mitmproxy-997a20e6524de215f201fbac648435208f0ec235.tar.bz2 mitmproxy-997a20e6524de215f201fbac648435208f0ec235.zip |
Merge pull request #3356 from fghzxm/umask-keys
Make private keys readable only by the owner
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_certs.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mitmproxy/test_certs.py b/test/mitmproxy/test_certs.py index 12d3dc96..8421ec58 100644 --- a/test/mitmproxy/test_certs.py +++ b/test/mitmproxy/test_certs.py @@ -1,5 +1,6 @@ import os from mitmproxy import certs +from ..conftest import skip_windows # class TestDNTree: # def test_simple(self): @@ -111,6 +112,14 @@ class TestCertStore: certs.CertStore.load_dhparam(filename) assert os.path.exists(filename) + @skip_windows + 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: |