Skip to content

Commit b7cbf63

Browse files
Fix bug of tags.Tag09
1 parent 60b1263 commit b7cbf63

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

cli/gpgpdump/facade/facade.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ func getBool(cmd *cobra.Command, name string) bool {
9090
func parseOpt(cmd *cobra.Command) *options.Options {
9191
return options.New(
9292
options.Set(options.ArmorOpt, getBool(cmd, options.ArmorOpt)),
93-
//options.Set(options.DebugOpt, getBool(cmd, options.DebugOpt)), //not use
9493
//options.Set(options.GDumpOpt, getBool(cmd, options.GDumpOpt)), //not use
9594
options.Set(options.IntegerOpt, getBool(cmd, options.IntegerOpt)),
9695
options.Set(options.LiteralOpt, getBool(cmd, options.LiteralOpt)),
9796
options.Set(options.MarkerOpt, getBool(cmd, options.MarkerOpt)),
9897
options.Set(options.PrivateOpt, getBool(cmd, options.PrivateOpt)),
9998
options.Set(options.UTCOpt, getBool(cmd, options.UTCOpt)),
99+
100+
//options.Set(options.DebugOpt, true), //for debug
100101
)
101102
}
102103

cli/gpgpdump/facade/facade_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Symmetric-Key Encrypted Session Key Packet (tag 3) (4 bytes)
3030
String-to-Key (S2K) Algorithm: Simple S2K (s2k 0)
3131
Hash Algorithm: MD5 (hash 1)
3232
Symmetrically Encrypted Data Packet (tag 9) (56 bytes)
33-
Compression Algorithm: Unknown (comp 231)
34-
Compressed data (55 bytes)
33+
Encrypted data (sym alg is specified in sym-key encrypted session key)
3534
`
3635
resdataFromAscdata1 = `Signature Packet (tag 2) (94 bytes)
3736
Version: 4 (new)

cli/gpgpdump/facade/json_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ var resJSON = `{
4949
"note": "56 bytes",
5050
"Item": [
5151
{
52-
"name": "Compression Algorithm",
53-
"value": "Unknown (comp 231)"
54-
},
55-
{
56-
"name": "Compressed data",
57-
"note": "55 bytes"
52+
"name": "Encrypted data",
53+
"note": "sym alg is specified in sym-key encrypted session key"
5854
}
5955
]
6056
}

cli/gpgpdump/facade/toml_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ var (
5555
note = "56 bytes"
5656
5757
[[Packet.Item]]
58-
name = "Compression Algorithm"
59-
value = "Unknown (comp 231)"
60-
61-
[[Packet.Item]]
62-
name = "Compressed data"
63-
note = "55 bytes"
58+
name = "Encrypted data"
59+
note = "sym alg is specified in sym-key encrypted session key"
6460
`
6561
resTOMLdataFromAscdata1 = `[[Packet]]
6662
name = "Signature Packet (tag 2)"
@@ -174,7 +170,7 @@ func TestTOMLLoadByFile(t *testing.T) {
174170
}
175171
str = outBuf.String()
176172
if str != resTOMLdataFromBindata1 {
177-
t.Errorf("Execute(file) = \"%v\", want \"%v\".", str, resdataFromBindata1)
173+
t.Errorf("Execute(file) = \"%v\", want \"%v\".", str, resTOMLdataFromBindata1)
178174
}
179175
}
180176

packet/tags/tags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var newFunctions = FuncMap{
4343
6: newTag06, //Public-Key Packet
4444
7: newTag07, //Secret-Subkey Packet
4545
8: newTag08, //Compressed Data Packet
46-
9: newTag08, //Symmetrically Encrypted Data Packet
46+
9: newTag09, //Symmetrically Encrypted Data Packet
4747
10: newTag10, //Marker Packet (Obsolete Literal Packet)
4848
11: newTag11, //Literal Data Packet
4949
12: newTag12, //Trust Packet

0 commit comments

Comments
 (0)