22 * https://docs.openssl.org/3.0/man3/EVP_DigestInit/#synopsis
33 */
44
5- private import experimental.quantum.Language
6- private import experimental.quantum.OpenSSL.CtxFlow as CTXFlow
7- private import OpenSSLOperationBase
8- private import EVPHashInitializer
9- private import experimental.quantum.OpenSSL.AlgorithmValueConsumers.OpenSSLAlgorithmValueConsumers
10-
11- class EVP_Digest_Update_Call extends EVPUpdate {
12- EVP_Digest_Update_Call ( ) { this .( Call ) .getTarget ( ) .getName ( ) = "EVP_DigestUpdate" }
13-
14- override Expr getInputArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
15- }
16-
17- //https://docs.openssl.org/3.0/man3/EVP_DigestInit/#synopsis
18- class EVP_Q_Digest_Operation extends EVPOperation , Crypto:: HashOperationInstance {
19- EVP_Q_Digest_Operation ( ) { this .( Call ) .getTarget ( ) .getName ( ) = "EVP_Q_digest" }
20-
21- override Expr getAlgorithmArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
22-
23- override EVP_Hash_Initializer getInitCall ( ) {
24- // This variant of digest does not use an init
25- // and even if it were used, the init would be ignored/undefined
26- none ( )
27- }
28-
29- override Expr getInputArg ( ) { result = this .( Call ) .getArgument ( 3 ) }
30-
31- override Expr getOutputArg ( ) { result = this .( Call ) .getArgument ( 5 ) }
32-
33- override Crypto:: ArtifactOutputDataFlowNode getOutputArtifact ( ) {
34- result = EVPOperation .super .getOutputArtifact ( )
35- }
36-
37- override Crypto:: ConsumerInputDataFlowNode getInputConsumer ( ) {
38- result = EVPOperation .super .getInputConsumer ( )
39- }
40- }
41-
42- class EVP_Digest_Operation extends EVPOperation , Crypto:: HashOperationInstance {
43- EVP_Digest_Operation ( ) { this .( Call ) .getTarget ( ) .getName ( ) = "EVP_Digest" }
44-
45- // There is no context argument for this function
46- override Expr getContextArg ( ) { none ( ) }
47-
48- override Expr getAlgorithmArg ( ) { result = this .( Call ) .getArgument ( 4 ) }
49-
50- override EVP_Hash_Initializer getInitCall ( ) {
51- // This variant of digest does not use an init
52- // and even if it were used, the init would be ignored/undefined
53- none ( )
54- }
55-
56- override Expr getInputArg ( ) { result = this .( Call ) .getArgument ( 0 ) }
57-
58- override Expr getOutputArg ( ) { result = this .( Call ) .getArgument ( 2 ) }
59-
60- override Crypto:: ArtifactOutputDataFlowNode getOutputArtifact ( ) {
61- result = EVPOperation .super .getOutputArtifact ( )
62- }
63-
64- override Crypto:: ConsumerInputDataFlowNode getInputConsumer ( ) {
65- result = EVPOperation .super .getInputConsumer ( )
66- }
67- }
68-
69- class EVP_Digest_Final_Call extends EVPFinal , Crypto:: HashOperationInstance {
70- EVP_Digest_Final_Call ( ) {
71- this .( Call ) .getTarget ( ) .getName ( ) in [
72- "EVP_DigestFinal" , "EVP_DigestFinal_ex" , "EVP_DigestFinalXOF"
73- ]
74- }
75-
76- override Expr getOutputArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
77-
78- override Crypto:: ArtifactOutputDataFlowNode getOutputArtifact ( ) {
79- result = EVPFinal .super .getOutputArtifact ( )
80- }
81-
82- override Crypto:: ConsumerInputDataFlowNode getInputConsumer ( ) {
83- result = EVPFinal .super .getInputConsumer ( )
84- }
85- }
5+ private import experimental.quantum.Language
6+ private import experimental.quantum.OpenSSL.CtxFlow as CTXFlow
7+ private import OpenSSLOperationBase
8+ private import EVPHashInitializer
9+ private import experimental.quantum.OpenSSL.AlgorithmValueConsumers.OpenSSLAlgorithmValueConsumers
10+
11+ class EVP_Digest_Update_Call extends EVPUpdate {
12+ EVP_Digest_Update_Call ( ) { this .( Call ) .getTarget ( ) .getName ( ) = "EVP_DigestUpdate" }
13+
14+ override Expr getInputArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
15+ }
16+
17+ //https://docs.openssl.org/3.0/man3/EVP_DigestInit/#synopsis
18+ class EVP_Q_Digest_Operation extends EVPOperation , Crypto:: HashOperationInstance {
19+ EVP_Q_Digest_Operation ( ) { this .( Call ) .getTarget ( ) .getName ( ) = "EVP_Q_digest" }
20+
21+ override Expr getAlgorithmArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
22+
23+ override EVP_Hash_Initializer getInitCall ( ) {
24+ // This variant of digest does not use an init
25+ // and even if it were used, the init would be ignored/undefined
26+ none ( )
27+ }
28+
29+ override Expr getInputArg ( ) { result = this .( Call ) .getArgument ( 3 ) }
30+
31+ override Expr getOutputArg ( ) { result = this .( Call ) .getArgument ( 5 ) }
32+
33+ override Crypto:: ArtifactOutputDataFlowNode getOutputArtifact ( ) {
34+ result = EVPOperation .super .getOutputArtifact ( )
35+ }
36+
37+ override Crypto:: ConsumerInputDataFlowNode getInputConsumer ( ) {
38+ result = EVPOperation .super .getInputConsumer ( )
39+ }
40+ }
41+
42+ class EVP_Digest_Operation extends EVPOperation , Crypto:: HashOperationInstance {
43+ EVP_Digest_Operation ( ) { this .( Call ) .getTarget ( ) .getName ( ) = "EVP_Digest" }
44+
45+ // There is no context argument for this function
46+ override Expr getContextArg ( ) { none ( ) }
47+
48+ override Expr getAlgorithmArg ( ) { result = this .( Call ) .getArgument ( 4 ) }
49+
50+ override EVP_Hash_Initializer getInitCall ( ) {
51+ // This variant of digest does not use an init
52+ // and even if it were used, the init would be ignored/undefined
53+ none ( )
54+ }
55+
56+ override Expr getInputArg ( ) { result = this .( Call ) .getArgument ( 0 ) }
57+
58+ override Expr getOutputArg ( ) { result = this .( Call ) .getArgument ( 2 ) }
59+
60+ override Crypto:: ArtifactOutputDataFlowNode getOutputArtifact ( ) {
61+ result = EVPOperation .super .getOutputArtifact ( )
62+ }
63+
64+ override Crypto:: ConsumerInputDataFlowNode getInputConsumer ( ) {
65+ result = EVPOperation .super .getInputConsumer ( )
66+ }
67+ }
68+
69+ class EVP_Digest_Final_Call extends EVPFinal , Crypto:: HashOperationInstance {
70+ EVP_Digest_Final_Call ( ) {
71+ this .( Call ) .getTarget ( ) .getName ( ) in [
72+ "EVP_DigestFinal" , "EVP_DigestFinal_ex" , "EVP_DigestFinalXOF"
73+ ]
74+ }
75+
76+ override Expr getOutputArg ( ) { result = this .( Call ) .getArgument ( 1 ) }
77+
78+ override Crypto:: ArtifactOutputDataFlowNode getOutputArtifact ( ) {
79+ result = EVPFinal .super .getOutputArtifact ( )
80+ }
81+
82+ override Crypto:: ConsumerInputDataFlowNode getInputConsumer ( ) {
83+ result = EVPFinal .super .getInputConsumer ( )
84+ }
85+ }
0 commit comments