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

Add CodeQL query to enforce OpenSSL return code handling #1867

Open
SWilson4 opened this issue Jul 26, 2024 · 0 comments
Open

Add CodeQL query to enforce OpenSSL return code handling #1867

SWilson4 opened this issue Jul 26, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Issue for new contributors

Comments

@SWilson4
Copy link
Member

To prevent issues similar to #1862.

@trailofbits used the following query to detect #1862:

import  cpp

from  FunctionCall  call, Function f 
where
  f = call.getTarget()  and 
  // function name starts with EVP 
  f.getName().matches(  "EVP%"  )  and 
  // and the function does not return a pointer or void 
  not  f.getType() instanceof PointerType  and 
  not  f.getType() instanceof VoidType  and 
  // and the function is not guarded by the OQS_OPENSSL_GUARD macro 
  not  exists(MacroAccess m | 
    m.getLocation().subsumes(call.getLocation())  and 
    m.getMacroName() =  "OQS_OPENSSL_GUARD" 
  )
select call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Issue for new contributors
Projects
Status: Todo
Development

No branches or pull requests

2 participants