Skip to content
Browse files

* clean up scanner comments

  • Loading branch information...
1 parent cd8c609 commit 747dceb06d1355451aea96ebaf5cc07321928fb6 @nahi committed Oct 30, 2004
View
18 lib/pgp/packet/sigsubpacket/packet.rb
@@ -102,18 +102,24 @@ def self.load(port)
packet
end
- def self.scan(port, io = STDOUT)
+ def self.scan(port, io)
length = load_length_new(port)
type = load_type(port)
critical = (type & T_CRITICAL).nonzero?
type &= ~T_CRITICAL
critlabel = critical ? "Critical" : "Non-critical"
- io.puts "#{critlabel} Sub: #{typelabel(type)}(#{type})(#{length - 1} bytes)\n"
- if !TAG_SCANNER.key?(type) and critical
+ io.puts "#{critlabel} Sub: #{typelabel(type)}(#{type})(#{length - 1} bytes)"
+ if TAG_SCANNER.key?(type)
+ io.indent(4) do
+ TAG_SCANNER[type].call(io, port, length - 1)
+ end
+ elsif critical
raise "Not supported: #{type}"
- end
- io.indent(4) do
- TAG_SCANNER[type].call(io, port, length - 1)
+ else
+ io.indent(4) do
+ io.puts "(unknown sub packet)"
+ end
+ port.read(length - 1)
end
end
View
2 lib/pgp/packet/sigsubpacket/preferredcompressionalgorithm.rb
@@ -18,7 +18,7 @@ def initialize
def scan(io)
super
@algorithm.each do |algo|
- io.puts CompressionAlgorithm.label(algo)
+ io.puts "#{CompressionAlgorithm.label(algo)}(#{algo})"
end
end
View
2 lib/pgp/packet/sigsubpacket/preferredhashalgorithm.rb
@@ -18,7 +18,7 @@ def initialize
def scan(io)
super
@algorithm.each do |algo|
- io.puts HashAlgorithm.label(algo)
+ io.puts "#{HashAlgorithm.label(algo)}(#{algo})"
end
end
View
2 lib/pgp/packet/sigsubpacket/preferredskeyalgorithm.rb
@@ -18,7 +18,7 @@ def initialize
def scan(io)
super
@algorithm.each do |algo|
- io.puts SKeyAlgorithm.label(algo)
+ io.puts "#{SKeyAlgorithm.label(algo)}(#{algo})"
end
end

0 comments on commit 747dceb

Please sign in to comment.
Something went wrong with that request. Please try again.