diff options
author | fanquake <fanquake@gmail.com> | 2020-04-21 09:41:17 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-04-21 11:32:01 +0800 |
commit | 7b99c7454cdb74cd9cd7a5eedc2fb9d0a19df456 (patch) | |
tree | 9f7e558a656e9062197190fda308feac3291588f /contrib/devtools/test-security-check.py | |
parent | c4c3f110eb93243fc8f740070240f50b0008f206 (diff) | |
download | bitcoin-7b99c7454cdb74cd9cd7a5eedc2fb9d0a19df456.tar.xz |
scripts: add MACHO Canary check to security-check.py
Diffstat (limited to 'contrib/devtools/test-security-check.py')
-rwxr-xr-x | contrib/devtools/test-security-check.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/devtools/test-security-check.py b/contrib/devtools/test-security-check.py index db738fbbb8..a0b2f86ee2 100755 --- a/contrib/devtools/test-security-check.py +++ b/contrib/devtools/test-security-check.py @@ -64,13 +64,15 @@ class TestSecurityChecks(unittest.TestCase): cc = 'clang' write_testcode(source) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace', '-Wl,-allow_stack_execute']), + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector']), + (1, executable+': failed PIE NOUNDEFS NX Canary')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all']), (1, executable+': failed PIE NOUNDEFS NX')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace']), + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all']), (1, executable+': failed PIE NOUNDEFS')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie']), + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all']), (1, executable+': failed PIE')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie']), + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-fstack-protector-all']), (0, '')) if __name__ == '__main__': |