@@ -322,19 +322,29 @@ module Encryption {
322322 * https://cryptography.io/en/latest/hazmat/primitives/aead/#module-cryptography.hazmat.primitives.ciphers.aead
323323 */
324324 module AuthenticatedEncryption {
325- API:: Node genericAEADAPINode ( string algName ) {
325+ API:: Node genericAEADAPINode ( string memberName , string algName ) {
326326 result =
327327 API:: moduleImport ( "cryptography" )
328328 .getMember ( "hazmat" )
329329 .getMember ( "primitives" )
330330 .getMember ( "ciphers" )
331331 .getMember ( "aead" )
332- .getMember ( algName ) and
333- algName in [ "AESGCM" , "AESCCM" , "AESOCB3" , "AESSIV" , "ChaCha20Poly1305" ]
332+ .getMember ( memberName ) and
333+ (
334+ ( memberName = "AESGCM" and algName = "AES-GCM" )
335+ or
336+ ( memberName = "AESCCM" and algName = "AES-CCM" )
337+ or
338+ ( memberName = "AESOCB3" and algName = "AES-OCB3" )
339+ or
340+ ( memberName = "AESSIV" and algName = "AESSIV" )
341+ or
342+ ( memberName = "ChaCha20Poly1305" and algName = "ChaCha20-Poly1305" )
343+ )
334344 }
335345
336346 DataFlow:: Node genericAEADArtifact ( API:: Node algModule , string algName ) {
337- algModule = genericAEADAPINode ( algName ) and
347+ algModule = genericAEADAPINode ( _ , algName ) and
338348 result = algModule .asSource ( )
339349 }
340350
@@ -364,16 +374,16 @@ module Encryption {
364374 bindingset [ rawName]
365375 string normalizedBlockNames ( string rawName ) {
366376 // https://cryptography.io/en/latest/hazmat/primitives/aead/#module-cryptography.hazmat.primitives.ciphers.aead
367- if rawName = "AESGCM "
377+ if rawName = "AES-GCM "
368378 then result = super .normalizeName ( "GCM" )
369379 else
370- if rawName = "AESCCM "
380+ if rawName = "AES-CCM "
371381 then result = super .normalizeName ( "CCM" )
372382 else
373- if rawName = "AESOCB3 "
383+ if rawName = "AES-OCB3 "
374384 then result = super .normalizeName ( "OCB" )
375385 else
376- if rawName = "AESSIV "
386+ if rawName = "AES-SIV "
377387 then result = super .normalizeName ( "SIV" )
378388 else result = super .normalizeName ( rawName )
379389 }
0 commit comments