pwn 0.5.746 → 0.5.748

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
  SHA256:
3
- metadata.gz: aacb6a992222f92a5a198def002962a7f92105b68489ae2a9dd01fb9207332f9
4
- data.tar.gz: d48b7f1c97a7a18bba283685075d887d9e539280abe3cc41064a88374e9bf355
3
+ metadata.gz: 02f94f46fc7627fd28e1b815d61a9ff8988739c4394054e21fd7001e0cbedb1b
4
+ data.tar.gz: ee53f4520e4d847623db8918e3ece5c182939d17a0e8ba9984be8d98ed21237e
5
5
  SHA512:
6
- metadata.gz: 614149c9170c27dad853ec23b90f3990ae9182001bd6d2b7e4b919095a003bc2b85b949946c834e32052e37ba0f4b785c59adbaeb127a1f90298025ec657cfe6
7
- data.tar.gz: 40f3119856e9a6965b5977494fcb1afb4ea8ef13f226a7044353232be87a46dda4bd4970b6806677d327e18e53af6bb328852bd170fd4c9095821b8947222a5f
6
+ metadata.gz: 6c0ee2ce5915bebaea32f40413080d0c36ed34547911deee16f7dab729f238c0fc5e7352152c5764618925a882c7046bd5b1bb5f2ae35bb23d4be3ce847498f5
7
+ data.tar.gz: 032bb3d28b79afd00223158af6b2747d16fb7101b6a852dbe356ccf961d813906c44b1d0efb2972020c82f48a8518b3317f804a955a5a4f6682b153377b1161c
data/Gemfile CHANGED
@@ -50,7 +50,7 @@ gem 'libusb', '0.8.0'
50
50
  gem 'luhn', '3.0.0'
51
51
  gem 'mail', '2.9.1'
52
52
  gem 'mcp', '1.6.0'
53
- gem 'meshtastic', '0.0.184'
53
+ gem 'meshtastic', '0.0.186'
54
54
  gem 'metasm', '1.0.6'
55
55
  gem 'mongo', '2.26.0'
56
56
  gem 'msfrpc-client', '1.1.2'
@@ -77,7 +77,7 @@ gem 'rbvmomi2', '3.10.0'
77
77
  gem 'rdoc', '7.0.4'
78
78
  gem 'rest-client', '2.1.0'
79
79
  gem 'rex', '2.0.13'
80
- gem 'rmagick', '7.1.4'
80
+ gem 'rmagick', '7.1.5'
81
81
  gem 'rqrcode', '3.2.0'
82
82
  gem 'rspec', '3.13.2'
83
83
  gem 'rtesseract', '3.1.4'
@@ -149,11 +149,14 @@ module PWN
149
149
  end
150
150
  end
151
151
  PWN_MESH_TRANSPORTS = %i[serial bluetooth tcp mqtt].freeze
152
- # meshtastic 0.0.184 loses protobuf defaults in Data#to_h. Empty
153
- # decoded data is not an unsupported application payload.
152
+ # meshtastic 0.0.184 Data#to_h omits empty payload bytes, and an
153
+ # unknown PortNum stays an integer (51 is not in the enum). That is
154
+ # not an undecodable application payload. Bytes on an unsupported
155
+ # port still warn.
154
156
  EMPTY_DATA_DECODER = Module.new do
155
157
  define_method(:decode_payload) do |opts = {}|
156
- return nil if opts[:payload].nil? && opts[:msg_type].nil?
158
+ payload = opts[:payload]
159
+ return nil if payload.nil? || payload == ''
157
160
 
158
161
  super(opts)
159
162
  end
@@ -1140,6 +1143,9 @@ module PWN
1140
1143
  text = opts[:text].to_s.dup.force_encoding(Encoding::UTF_8).scrub
1141
1144
  text.gsub!(/\e\[[0-9;?]*[A-Za-z]/, '')
1142
1145
  text.gsub!(/[\x00-\x08\x0b\x0c\x0e-\x1f]/, '')
1146
+ # Serial.subscribe prints this on startup. It is not a diagnostic,
1147
+ # and capturing it opens a NOTICE before the TUI can be used.
1148
+ text.gsub!('Subscribing to serial FromRadio stream...', '')
1143
1149
  text.strip!
1144
1150
  text.empty? ? nil : text
1145
1151
  end
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.746'
4
+ VERSION = '0.5.748'
5
5
  end
@@ -18,8 +18,26 @@ describe PWN::Plugins::REPL, 'mesh compose history' do
18
18
  described_class.send(:mesh_subscribe, obj: { from_radio_queue: queue }, psks: {}, on_message: proc { |message| received << message })
19
19
  expect(received.size).to eq(2)
20
20
  expect(output.string).not_to include("Can't decode")
21
- Meshtastic::MeshInterface.new.decode_payload(payload: 'unsupported', msg_type: :PRIVATE_APP)
22
- expect(output.string).to include("Can't decode", 'unsupported')
21
+ # meshtastic 0.0.186 returns unknown application bytes instead of warning.
22
+ decoded = Meshtastic::MeshInterface.new.decode_payload(payload: 'unsupported', msg_type: :PRIVATE_APP)
23
+ expect(decoded).to eq('unsupported')
24
+ expect(output.string).not_to include("Can't decode")
25
+ ensure
26
+ $stdout = old
27
+ end
28
+
29
+ it 'does not warn when a packet has an unknown portnum and no payload' do
30
+ stub_const('PWN::MeshTransport', :serial)
31
+ queue = Queue.new
32
+ encoded = Meshtastic::FromRadio.new(packet: { decoded: Meshtastic::Data.new(portnum: 51) }).to_proto
33
+ queue << Meshtastic::FromRadio.decode(encoded)
34
+ queue.close
35
+ output = StringIO.new
36
+ old = $stdout
37
+ $stdout = output
38
+ described_class.send(:mesh_subscribe, obj: { from_radio_queue: queue }, psks: {}, on_message: proc { |_message| })
39
+ expect(output.string).not_to include("Can't decode")
40
+ expect(output.string).not_to include('portnum: 51')
23
41
  ensure
24
42
  $stdout = old
25
43
  end
@@ -69,6 +87,25 @@ describe PWN::Plugins::REPL, 'mesh compose history' do
69
87
  expect(events).to be_empty
70
88
  end
71
89
 
90
+ it 'does not open a notice for the serial subscribe banner' do
91
+ events = Queue.new
92
+ stub_const('PWN::MeshEvents', events)
93
+ described_class.send(:mesh_capture_output, run: proc {
94
+ puts 'Subscribing to serial FromRadio stream...'
95
+ })
96
+ expect(events).to be_empty
97
+ end
98
+
99
+ it 'keeps a warning that shares a chunk with the serial subscribe banner' do
100
+ events = Queue.new
101
+ stub_const('PWN::MeshEvents', events)
102
+ described_class.send(:mesh_capture_output, run: proc {
103
+ $stdout.write("Subscribing to serial FromRadio stream...\nWARNING: decoder fixture\n")
104
+ })
105
+ expect(events.pop(true)[:notice]).to eq('WARNING: decoder fixture')
106
+ expect(events).to be_empty
107
+ end
108
+
72
109
  it 'captures dependency stdout and stderr and restores both streams on failure' do
73
110
  events = Queue.new
74
111
  stub_const('PWN::MeshEvents', events)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.746
4
+ version: 0.5.748
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -519,14 +519,14 @@ dependencies:
519
519
  requirements:
520
520
  - - '='
521
521
  - !ruby/object:Gem::Version
522
- version: 0.0.184
522
+ version: 0.0.186
523
523
  type: :development
524
524
  prerelease: false
525
525
  version_requirements: !ruby/object:Gem::Requirement
526
526
  requirements:
527
527
  - - '='
528
528
  - !ruby/object:Gem::Version
529
- version: 0.0.184
529
+ version: 0.0.186
530
530
  - !ruby/object:Gem::Dependency
531
531
  name: metasm
532
532
  requirement: !ruby/object:Gem::Requirement
@@ -897,14 +897,14 @@ dependencies:
897
897
  requirements:
898
898
  - - '='
899
899
  - !ruby/object:Gem::Version
900
- version: 7.1.4
900
+ version: 7.1.5
901
901
  type: :development
902
902
  prerelease: false
903
903
  version_requirements: !ruby/object:Gem::Requirement
904
904
  requirements:
905
905
  - - '='
906
906
  - !ruby/object:Gem::Version
907
- version: 7.1.4
907
+ version: 7.1.5
908
908
  - !ruby/object:Gem::Dependency
909
909
  name: rqrcode
910
910
  requirement: !ruby/object:Gem::Requirement