Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Change vt_refs to refs #93

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/OSP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<e>creation_time</e>
<e>modification_time</e>
<e>vt_params</e>
<e>vt_refs</e>
<e>refs</e>
<e>dependencies</e>
<e>summary</e>
<e>impact</e>
Expand All @@ -802,7 +802,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<name>vt_params</name>
</ele>
<ele>
<name>vt_refs</name>
<name>refs</name>
<pattern>
<e>ref</e>
</pattern>
Expand Down Expand Up @@ -895,11 +895,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<vts>
<vt id="1.2.3.4.5">
<name>Check for presence of vulnerability X</name>
<vt_refs>
<refs>
<ref id="2014-16494" type="fedora" />
<ref id="https://lists.fedoraproject.org/" type="url" />
<ref id="CVE-2014-9116" type="cve" />
</vt_refs>
</refs>
<dependencies>
<dependency vt_id="1.3.6.1.4.1.25623.1.0.50282" />
</dependencies>
Expand Down Expand Up @@ -960,11 +960,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<default>1</default>
</vt_param>
</vt_params>
<vt_refs>
<refs>
<ref type="cve" id="CVE-2010-4480"/>
<ref type="url" id="http://www.exploit-db.com/exploits/15699/"/>
<ref type="url" id="http://www.vupen.com/english/advisories/2010/3133"/>
</vt_refs>
</refs>
<custom>
<my_element>First custom element</my_element>
<my_other_element>second custom element</my_other_element>
Expand Down
8 changes: 4 additions & 4 deletions ospd/ospd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,12 +1187,12 @@ def get_params_vt_as_xml_str(vt_id, vt_params):
@staticmethod
def get_refs_vt_as_xml_str(vt_id, vt_refs):
""" Create a string representation of the XML object from the
vt_refs data object.
refs data object.
This needs to be implemented by each ospd wrapper, in case
vt_refs elements for VTs are used.
refs elements for VTs are used.

The vt_refs XML object which is returned will be embedded
into a <vt_refs></vt_refs> element.
The refs XML object which is returned will be embedded
into a <refs></refs> element.

@return: XML object as string for vt references data.
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/testScanAndResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def get_params_vt_as_xml_str(vt_id, vt_params):

@staticmethod
def get_refs_vt_as_xml_str(vt_id, vt_refs):
response = '<vt_refs><ref type="cve" id="CVE-2010-4480"/>' \
'<ref type="url" id="http://example.com"/></vt_refs>'
response = '<refs><ref type="cve" id="CVE-2010-4480"/>' \
'<ref type="url" id="http://example.com"/></refs>'
return response

@staticmethod
Expand Down Expand Up @@ -263,7 +263,7 @@ def testGetVTs_VTs_with_refs(self):
self.assertEqual(1, len(vt_params))
custom = response[0][0].findall('custom')
self.assertEqual(1, len(custom))
refs = response.findall('vts/vt/vt_refs/ref')
refs = response.findall('vts/vt/refs/ref')
self.assertEqual(2, len(refs))

def testGetVTs_VTs_with_dependencies(self):
Expand Down