offrep 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 812885ae67e6938950a73ddf3e9c5bf198ff8e5b
4
- data.tar.gz: 532b5eb4fa9203446996e983a3070084cba77afa
3
+ metadata.gz: 40b319807abbd647386c0e3c685472350c7e11c9
4
+ data.tar.gz: d3b7909d360a4e8c47a8d945cacfd6a4adff2dce
5
5
  SHA512:
6
- metadata.gz: 3ebdb6119179fc574622282d3768578d2dad8ca2dd54aa9d3bf3c73b0e56fe15b958c82b4ffb184f3057c006e52859d59d68f34f88c40f810b800b1d15ad24ab
7
- data.tar.gz: be0407ba192752e3542d69f313dfe1bc3f2a5133aa81d9996df10b44d33b6a4f1ab82892c99daad11ca209bfd0344fb5b447ddfa4f766ec34c48d323e7cc1d5c
6
+ metadata.gz: ea12e5bc7fd6d93e26a1193bb64c01c7e88d1bc39d3398179a8b2f64767abc2b5027d43d29a6d0e05c9acae9cae9716887ec2613153466109914b5a4f9991ae1
7
+ data.tar.gz: 2ab9cc5b5293ccec3946b66f3b3fff2218888e887571a43669f64170b8a0e11c0df715dbb171dfeaec6babb757af390081aff808e79321e7ec97c2452a17868b
data/exe/offrep CHANGED
@@ -61,6 +61,11 @@ OptionParser.new do |opts|
61
61
  exit
62
62
  end
63
63
 
64
+ opts.on("-V", "--version", "Prints the version") do
65
+ puts "#{$PRGNAME} #{Offrep::VERSION}"
66
+ exit
67
+ end
68
+
64
69
  opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
65
70
  $options['verbose'] = v
66
71
  @log.level = Logger::INFO
@@ -79,14 +79,14 @@ module Offrep
79
79
  @xmldoc
80
80
  end
81
81
 
82
- def anonymize(xmln)
82
+ def anonymize(xmln)
83
83
  xmln.xpath('/vulnerabilities/vulnerability/target').each do |target|
84
84
  target.remove
85
85
  end
86
86
  xmln.xpath('/vulnerabilities/vulnerability/data/common/output').each do |output|
87
87
  output.remove
88
- end
89
- return xmln
88
+ end
89
+ return xmln
90
90
  end
91
91
 
92
92
  def emptyxml
@@ -206,19 +206,19 @@ module Offrep
206
206
 
207
207
  def translate(trxml)
208
208
  misxml = emptyxml()
209
- @xmldoc.xpath('/vulnerabilities/vulnerability').each do |vuln|
209
+ @xmldoc.xpath('/vulnerabilities/vulnerability').each do |vuln|
210
210
  foundit=false
211
211
  # binding.pry
212
212
  vuln.at_xpath('./id').element_children.each do |ids|
213
213
  if ids.name=='cve' then
214
- next
214
+ next
215
215
  end
216
216
  # binding.pry
217
217
  trid=trxml.at_xpath("/vulnerabilities/vulnerability[./id/#{ids.name}='#{ids.content}']")
218
218
  if not trid.nil? then
219
219
  foundit=true
220
220
  # replace all XML elements inside /data/common to translated ones
221
- trid.at_xpath('./data/common').element_children.each do |ele|
221
+ trid.at_xpath('./data/common').element_children.each do |ele|
222
222
  # puts ele.name
223
223
  foundele=vuln.at_xpath("./data/common/#{ele.name}")
224
224
  # if element not found, add as a child in common
@@ -1,3 +1,3 @@
1
1
  module Offrep
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: offrep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlatko Kosturjak