File tree Expand file tree Collapse file tree
cpp/ql/lib/experimental/Quantum/OpenSSL Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module OpenSSLModel {
77 import experimental.Quantum.OpenSSL.EVPHashOperation
88 import experimental.Quantum.OpenSSL.EVPCipherAlgorithmSource
99 import experimental.Quantum.OpenSSL.EVPHashAlgorithmSource
10+ import experimental.Quantum.OpenSSL.Random
1011
1112
1213// // TODO: trace CTX from init variants to the context arg of EVP update calls
Original file line number Diff line number Diff line change 1+ import cpp
2+ private import experimental.Quantum.Language
3+ private import codeql.cryptography.Model
4+ private import LibraryDetector
5+ private import semmle.code.cpp.dataflow.new.DataFlow
6+
7+ class OpenSSLRandomNumberGeneratorInstance extends Crypto:: RandomNumberGenerationInstance instanceof Call
8+ {
9+ OpenSSLRandomNumberGeneratorInstance ( ) {
10+ this .( Call ) .getTarget ( ) .getName ( ) in [ "RAND_bytes" , "RAND_pseudo_bytes" ] and
11+ isPossibleOpenSSLFunction ( this .( Call ) .getTarget ( ) )
12+ }
13+
14+ override Crypto:: DataFlowNode getOutputNode ( ) {
15+ result .asDefiningArgument ( ) = this .( Call ) .getArgument ( 0 )
16+ }
17+
18+ override predicate flowsTo ( Crypto:: FlowAwareElement other ) {
19+ ArtifactUniversalFlow:: flow ( this .getOutputNode ( ) , other .getInputNode ( ) )
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments