Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coko 'ArgumentOrigin' Evaluator #873

Merged
merged 9 commits into from
Sep 17, 2024
Merged

Coko 'ArgumentOrigin' Evaluator #873

merged 9 commits into from
Sep 17, 2024

Conversation

CodingDepot
Copy link
Collaborator

This PR adds an ArgumentOrigin evaluator to Coko that verifies the origin of an argument.
It finds instances of the target Op and checks whether the argument at the specified position was produced by a call of the origin Op.

It also makes sure that the value of the argument was not changed between the origin call and the target call.

This evaluator is useful when you have a trusted method whose return value should be used as input to another method in all cases. (e.g. always use SecureRandom.getInstanceStrong() as RNG source)

@CodingDepot CodingDepot added the enhancement New feature or request label Jun 12, 2024
@CodingDepot CodingDepot requested a review from fwendland June 12, 2024 08:23
@CodingDepot CodingDepot self-assigned this Jun 12, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 88.09524% with 5 lines in your changes missing coverage. Please review.

Project coverage is 77.58%. Comparing base (c14fbcd) to head (736ce13).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../backends/cpg/coko/evaluators/ArgumentEvaluator.kt 86.84% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #873      +/-   ##
============================================
+ Coverage     77.35%   77.58%   +0.22%     
- Complexity      259      273      +14     
============================================
  Files            60       61       +1     
  Lines          1930     1972      +42     
  Branches        272      280       +8     
============================================
+ Hits           1493     1530      +37     
- Misses          312      313       +1     
- Partials        125      129       +4     
Flag Coverage Δ
unittests 77.58% <88.09%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fwendland fwendland merged commit d0c45be into main Sep 17, 2024
6 checks passed
@fwendland fwendland deleted the rh/ArgumentEvaluator branch September 17, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants