AttackManager { public DetectionReport getDetectionReport() { return m_DetectionReport; } AttackManager( DetectionReport detectRep, AttackConfig attackCfg, AOracle oracle ); DetectionReport getDetectionReport(); Document getInputFile(); Document getAvoidedFile(); XMLEncryptionAttackBase getXMLEncryptionAttack(); byte[] executeAttack(); AOracle getOracleofCCAAttacker(); Algorithm getEncryptionMethod();  }
@Test public void testGetDetectionReport() { }
@Test public void testAttackOnEncKeyWithSignedEncData() throws Exception { Document doc = DomUtilities.readDocument( "src/test/resources/schema_encKey_encData_sig.xml" ); Document possAvoidedDoc = null; EncSigWrappingOracle encSigWrappOracle = null; EncryptionWrappingOracle encWrappOracle = null; AbstractDetectionInfo errorInfo = null; AbstractDetectionFilter errorFilter = null; AttackConfig attackCfg = new AttackConfig(); AOracle oracle = null; DetectionManager detectManager = new DetectionManager( m_PipeLine, doc ); detectManager.startDetection(); DetectionReport detectReport = detectManager.getDetectionReport(); EncryptionInfo encInfo = (EncryptionInfo) detectReport.getDetectionInfo( DetectFilterEnum.ENCRYPTIONFILTER ); SignatureInfo sigInfo = (SignatureInfo) detectReport.getDetectionInfo( DetectFilterEnum.SIGNATUREFILTER ); assertTrue( sigInfo.isSignature() ); m_SigManager = sigInfo.getSignatureManager(); assertEquals( 1, m_SigManager.getPayloads().size() ); assertEquals( "Body", m_SigManager.getPayloads().get( 0 ).getSignedElement().getLocalName() ); EncryptedKeyElement encKey = encInfo.getEncryptedKeyElements().get( 0 ); AbstractEncryptionElement encEl = ( (DataReferenceElement) encInfo.getEncryptedKeyElements().get( 0 ).getReferenceElementList().get( 0 ) ).getRefEncData(); errorFilter = FactoryFilter.createFilter( DetectFilterEnum.AVOIDDOCFILTER ); ( (AvoidedDocErrorFilter) errorFilter ).setPayloadInput( encEl ); setPayload( detectReport, encEl ); configureAttack( attackCfg ); encSigWrappOracle = new EncSigWrappingOracle( encKey, detectReport, m_SchemaAnalyser ); encWrappOracle = new EncryptionWrappingOracle( encKey, detectReport, m_SchemaAnalyser ); if ( attackCfg.getWrappingMode() == WrappingAttackMode.SIGNATURE ) { errorInfo = startEncSigWrapping( encSigWrappOracle, errorFilter ); } if ( attackCfg.getWrappingMode() == WrappingAttackMode.ENCRYPTION ) { errorInfo = startEncryptionWrapping( encWrappOracle, errorFilter ); } detectReport.setErrorResponseTab( null ); }