@@ -381,6 +381,9 @@ private module Crypto {
381381 }
382382
383383 private class StreamReader extends EncryptionOperation {
384+ DataFlow:: Node encryptionFlowTarget ;
385+ DataFlow:: Node inputNode ;
386+
384387 StreamReader ( ) {
385388 lookThroughPointerType ( this .getType ( ) ) .hasQualifiedName ( "crypto/cipher" , "StreamReader" ) and
386389 exists ( DataFlow:: Write w , DataFlow:: Node base , Field f |
@@ -394,6 +397,10 @@ private module Crypto {
394397 DataFlow:: localFlow ( base , this )
395398 )
396399 }
400+
401+ override DataFlow:: Node getEncryptionFlowTarget ( ) { result = encryptionFlowTarget }
402+
403+ override DataFlow:: Node getInputNode ( ) { result = inputNode }
397404 }
398405
399406 /**
@@ -402,9 +409,10 @@ private module Crypto {
402409 * so it only works within one function.
403410 */
404411 private class StreamWriter extends EncryptionOperation {
412+ DataFlow:: Node encryptionFlowTarget ;
413+
405414 StreamWriter ( ) {
406415 lookThroughPointerType ( this .getType ( ) ) .hasQualifiedName ( "crypto/cipher" , "StreamWriter" ) and
407- inputNode = this and
408416 exists ( DataFlow:: Write w , DataFlow:: Node base , Field f |
409417 w .writesField ( base , f , encryptionFlowTarget ) and
410418 f .hasQualifiedName ( "crypto/cipher" , "StreamWriter" , "S" )
@@ -413,6 +421,10 @@ private module Crypto {
413421 TaintTracking:: localTaint ( base , this .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) )
414422 )
415423 }
424+
425+ override DataFlow:: Node getEncryptionFlowTarget ( ) { result = encryptionFlowTarget }
426+
427+ override DataFlow:: Node getInputNode ( ) { result = this }
416428 }
417429 }
418430}
0 commit comments