EncryptionAttributeIdWeakness extends AbstractWeaknessComposite { @Override public int getPossibleNumWeaks() { return m_PossibleWeaks; } EncryptionAttributeIdWeakness( AbstractEncryptionElement encPay, EncryptedKeyElement encKey ); @Override int getPossibleNumWeaks(); @Override void abuseWeakness( int index, Element encKey, Element payloadElement ); int getMaxPosAttr();  }
@Test public void testEncDataSignedWithoutId() throws FileNotFoundException, XPathExpressionException, SAXException, IOException, InvalidPayloadException, InvalidWeaknessException { Document doc = DomUtilities.readDocument( "src/test/resources/case_encData_signed_no_id.xml" ); 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() ); AbstractEncryptionElement encEl = encInfo.getEncryptedDataElements().get( 0 ); EncryptionAttributeIdWeakness encAttrWeak = (EncryptionAttributeIdWeakness) FactoryWeakness.generateWeakness( WeaknessType.ATTR_ID_WEAKNESS, encEl, null ); assertEquals( WrapModeEnum.WRAP_ENC_ELEMENT, encAttrWeak.getWrapMode() ); assertEquals( 0, encAttrWeak.getPossibleNumWeaks() ); }