Skip to content

Commit

Permalink
Merge pull request #44 from cruise-automation/collin/checksec_support…
Browse files Browse the repository at this point in the history
…_old_Version

support older version of checksec
  • Loading branch information
Collin Mulliner committed Aug 17, 2020
2 parents 355e27d + 468be82 commit 88c0551
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Always update Version in Makefile

## Unreleased

### Changed
- support older versions of checksec

## [v1.4.2] - 2020-08-17

### Added
Expand Down
16 changes: 14 additions & 2 deletions scripts/check_sec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,24 @@ res = os.getenv("RESULT")
fp = os.getenv("FILEPATH")
orig_name = os.getenv("ORIG_FILENAME")
expected = {}
try:
expected = json.loads(cfg.rstrip())
except Exception:
print("bad config: {}".format(cfg.rstrip()))
sys.exit(1)
try:
result = json.loads(res.rstrip())
if "skip" in expected:
if orig_name in expected["skip"]:
sys.exit(0)
if not fp in result:
fp = "file"
for k in expected["cfg"]:
if k in result[fp]:
passed = False
Expand All @@ -65,8 +75,10 @@ try:
if not passed:
print(json.dumps(result[fp]).rstrip())
sys.exit(0)
except Exception as e:
pass
if not "Not an ELF file:" in res:
print(e)
sys.exit(0)
'

0 comments on commit 88c0551

Please sign in to comment.