18
18
tag02Body4 = []byte {0x03 , 0x05 , 0x00 , 0x36 , 0x5e , 0xba , 0x44 , 0x0f , 0x64 , 0x8a , 0x1c , 0x9e , 0x4f , 0x74 , 0x4d , 0x01 , 0x01 , 0x66 , 0x36 , 0x04 , 0x00 , 0x8f , 0x8c , 0x6b , 0x45 , 0xa7 , 0x65 , 0xbd , 0x37 , 0xf6 , 0x76 , 0x58 , 0x85 , 0x7c , 0x39 , 0x66 , 0x7a , 0xc5 , 0xc1 , 0x48 , 0xf3 , 0xb8 , 0x85 , 0x69 , 0x7f , 0x22 , 0x54 , 0x71 , 0x50 , 0x0e , 0x97 , 0xb2 , 0x51 , 0x77 , 0x53 , 0xa2 , 0x22 , 0xd4 , 0x46 , 0xec , 0x0c , 0x50 , 0xbe , 0xee , 0xe6 , 0xb0 , 0xc2 , 0x76 , 0x08 , 0xf0 , 0x6b , 0x0e , 0x6c , 0xfc , 0xe6 , 0xef , 0xcd , 0x10 , 0x3d , 0x10 , 0xfd , 0xb3 , 0x87 , 0x40 , 0x20 , 0x55 , 0x6c , 0x06 , 0xae , 0x41 , 0xc5 , 0x7c , 0x0d , 0x17 , 0x75 , 0x44 , 0x32 , 0x7d , 0x08 , 0x41 , 0x45 , 0x95 , 0xda , 0xd6 , 0x57 , 0x74 , 0x58 , 0x38 , 0x72 , 0x6e , 0xf7 , 0x1f , 0x63 , 0xce , 0xd8 , 0x00 , 0x1b , 0x25 , 0x37 , 0x23 , 0xb2 , 0x56 , 0x1a , 0x02 , 0x9a , 0xee , 0x5a , 0x57 , 0xf7 , 0xa3 , 0xab , 0x2d , 0x89 , 0x20 , 0x85 , 0x1c , 0xc5 , 0xc0 , 0xec , 0x64 , 0xe9 , 0x2f , 0x0b , 0xf5 , 0x4b , 0x5f , 0x2b , 0x65 , 0x39 }
19
19
tag02Body5 = []byte {0x04 , 0x13 , 0x01 , 0x08 , 0x00 , 0x1e , 0x05 , 0x02 , 0x5a , 0xfa , 0x85 , 0x65 , 0x02 , 0x9b , 0x2f , 0x05 , 0x8b , 0x09 , 0x08 , 0x07 , 0x02 , 0x06 , 0x95 , 0x0a , 0x09 , 0x08 , 0x0b , 0x02 , 0x04 , 0x96 , 0x02 , 0x03 , 0x01 , 0x02 , 0x9e , 0x01 , 0x00 , 0x0a , 0x09 , 0x10 , 0x8e , 0x3d , 0xba , 0x0e , 0xc4 , 0xdc , 0xc3 , 0xb7 , 0xef , 0x56 , 0x07 , 0xff , 0x63 , 0xcf , 0x00 , 0x07 , 0x32 , 0xd7 , 0x4c , 0x58 , 0x0b , 0xa3 , 0x81 , 0x0e , 0xd7 , 0x3e , 0xde , 0x04 , 0xd4 , 0xf8 , 0x63 , 0x87 , 0x49 , 0xf3 , 0x3c , 0x8a , 0x36 , 0x47 , 0x30 , 0x25 , 0x15 , 0x5b , 0x3a , 0xea , 0x75 , 0x95 , 0x53 , 0x70 , 0x31 , 0xbe , 0xb9 , 0x23 , 0x2a , 0xa7 , 0xc5 , 0xb4 , 0xd7 , 0x56 , 0xcb , 0x00 , 0x1c , 0xc6 , 0x03 , 0xf4 , 0x49 , 0x87 , 0xcd , 0x07 , 0xd5 , 0xd4 , 0x1f , 0xc1 , 0x95 , 0xc1 , 0xf7 , 0x0e , 0x16 , 0x27 , 0x54 , 0xda , 0x4e , 0xa0 , 0xea , 0xde , 0x5b , 0xdd , 0xeb , 0x4d , 0x17 , 0x19 , 0x4b , 0x61 , 0x30 , 0x52 , 0xd0 , 0x02 , 0x50 , 0x16 , 0x5a , 0xb5 , 0xcf , 0xa7 , 0x64 , 0x2c , 0x89 , 0xff , 0x67 , 0x12 , 0x9b , 0xce , 0xb6 , 0xba , 0x92 , 0xa4 , 0x61 , 0x25 , 0x96 , 0x06 , 0x14 , 0x23 , 0xed , 0x6d , 0x30 , 0x8f , 0xe5 , 0x26 , 0x9c , 0x66 , 0x5b , 0x6f , 0x34 , 0x05 , 0x66 , 0x13 , 0xb7 , 0xcd , 0x90 , 0xbc , 0x38 , 0x84 , 0xaf , 0x5f , 0x8f , 0x20 , 0x07 , 0xd0 , 0xe5 , 0xbd , 0x17 , 0x23 , 0x4f , 0x2a , 0x5d , 0x37 , 0x17 , 0xd8 , 0xf8 , 0xb4 , 0x2f , 0xe6 , 0xbe , 0x28 , 0x79 , 0xbc , 0x00 , 0x05 , 0x18 , 0xac , 0xab , 0xd6 , 0xea , 0x9d , 0xf4 , 0x6c , 0x1a , 0xdd , 0xc9 , 0x6a , 0x87 , 0x9e , 0x19 , 0x2f , 0xff , 0x12 , 0xaa , 0x69 , 0x49 , 0x3e , 0x93 , 0xee , 0x78 , 0x8c , 0xf7 , 0xab , 0x29 , 0xd5 , 0xdc , 0x47 , 0x50 , 0xa6 , 0x94 , 0x02 , 0xa4 , 0xb4 , 0x97 , 0x10 , 0xa4 , 0x7d , 0x4a , 0x36 , 0xbe , 0xfe , 0xe9 , 0x1f , 0xc4 , 0x44 , 0x63 , 0x7b , 0x75 , 0x55 , 0x3b , 0xd5 , 0x7b , 0xf7 , 0x76 , 0x16 , 0x93 , 0x01 , 0xb3 , 0xbe , 0xf0 , 0x1c , 0xc4 , 0x12 , 0x2a , 0x51 , 0x99 , 0xa2 , 0xf4 , 0x9d , 0x22 , 0x0a , 0x51 , 0x8c , 0x96 , 0x77 , 0x4d , 0x94 , 0x24 , 0x32 , 0x0a , 0xde , 0x5b , 0x7d , 0x53 , 0x4b , 0x24 , 0xab , 0xfc , 0x30 , 0x99 , 0xd8 , 0x7c , 0x0b , 0x88 , 0x8a , 0x75 , 0x4d }
20
20
tag02Body6 = []byte {0x04 , 0x13 , 0x16 , 0x0a , 0x00 , 0x30 , 0x02 , 0x9b , 0x03 , 0x05 , 0x82 , 0x5b , 0x1a , 0x4e , 0x1d , 0x05 , 0x89 , 0x01 , 0xdf , 0xe2 , 0x00 , 0x16 , 0xa1 , 0x04 , 0x2b , 0x77 , 0x57 , 0xd8 , 0xaf , 0x28 , 0x34 , 0x68 , 0xa0 , 0x57 , 0x46 , 0x99 , 0x91 , 0x0e , 0x55 , 0x44 , 0x78 , 0xcc , 0xde , 0x00 , 0x09 , 0x90 , 0x91 , 0x0e , 0x55 , 0x44 , 0x78 , 0xcc , 0xde , 0x00 , 0x00 , 0x00 , 0xbd , 0xfc , 0x00 , 0xfd , 0x17 , 0xe2 , 0xb2 , 0xa9 , 0xa4 , 0xdd , 0x49 , 0x9c , 0x67 , 0xe8 , 0xa2 , 0x9d , 0x82 , 0xb7 , 0x0e , 0x8a , 0xe9 , 0xee , 0xc4 , 0x0d , 0x69 , 0x67 , 0xf6 , 0xcf , 0xd9 , 0x36 , 0x01 , 0x58 , 0xb5 , 0xe8 , 0x8a , 0xb4 , 0x00 , 0xfb , 0x04 , 0xe6 , 0xf4 , 0xad , 0x9a , 0x49 , 0xcf , 0x58 , 0xba , 0x56 , 0xc9 , 0x70 , 0x51 , 0x77 , 0x5c , 0xa4 , 0x09 , 0x0f , 0x3b , 0xca , 0x78 , 0x3c , 0xa4 , 0x9e , 0x89 , 0x3e , 0x4d , 0x5c , 0xd8 , 0x21 , 0x53 , 0x08 }
21
+ tag02Body7 = []byte {0x05 , 0x13 , 0x16 , 0x08 , 0x00 , 0x48 , 0x22 , 0x21 , 0x05 , 0x19 , 0x34 , 0x7b , 0xc9 , 0x87 , 0x24 , 0x64 , 0x02 , 0x5f , 0x99 , 0xdf , 0x3e , 0xc2 , 0xe0 , 0x00 , 0x0e , 0xd9 , 0x88 , 0x48 , 0x92 , 0xe1 , 0xf7 , 0xb3 , 0xea , 0x4c , 0x94 , 0x00 , 0x91 , 0x59 , 0x56 , 0x9b , 0x54 , 0x05 , 0x02 , 0x5c , 0x91 , 0xf4 , 0xe4 , 0x02 , 0x1b , 0x03 , 0x05 , 0x0b , 0x09 , 0x08 , 0x07 , 0x02 , 0x03 , 0x22 , 0x02 , 0x01 , 0x06 , 0x15 , 0x0a , 0x09 , 0x08 , 0x0b , 0x02 , 0x04 , 0x16 , 0x02 , 0x03 , 0x01 , 0x02 , 0x1e , 0x07 , 0x02 , 0x17 , 0x80 , 0x00 , 0x00 , 0xf5 , 0xc0 , 0x00 , 0xfe , 0x38 , 0x91 , 0xdf , 0x23 , 0x2c , 0x64 , 0xc7 , 0x84 , 0x43 , 0x8d , 0x2e , 0xea , 0xec , 0xc4 , 0xa1 , 0x76 , 0xba , 0x51 , 0x77 , 0x95 , 0xfd , 0x2d , 0xf0 , 0xc0 , 0x90 , 0x17 , 0x44 , 0x9c , 0xbd , 0x33 , 0xcb , 0x34 , 0x00 , 0xff , 0x6f , 0xb8 , 0xbf , 0xfb , 0x03 , 0x24 , 0xdf , 0x15 , 0x7c , 0x30 , 0xcd , 0x28 , 0xc3 , 0x9d , 0x89 , 0xb3 , 0x4b , 0x4a , 0x80 , 0x85 , 0xb2 , 0xc3 , 0x43 , 0xae , 0x37 , 0x37 , 0xe3 , 0x17 , 0x18 , 0x12 , 0x76 , 0x05 }
21
22
)
22
23
23
24
const (
@@ -217,6 +218,79 @@ const (
217
218
17 e2 b2 a9 a4 dd 49 9c 67 e8 a2 9d 82 b7 0e 8a e9 ee c4 0d 69 67 f6 cf d9 36 01 58 b5 e8 8a b4
218
219
EdDSA compressed value s (251 bits)
219
220
04 e6 f4 ad 9a 49 cf 58 ba 56 c9 70 51 77 5c a4 09 0f 3b ca 78 3c a4 9e 89 3e 4d 5c d8 21 53 08
221
+ `
222
+ tag02Redult7 = `Signature Packet (tag 2) (150 bytes)
223
+ 05 13 16 08 00 48 22 21 05 19 34 7b c9 87 24 64 02 5f 99 df 3e c2 e0 00 0e d9 88 48 92 e1 f7 b3 ea 4c 94 00 91 59 56 9b 54 05 02 5c 91 f4 e4 02 1b 03 05 0b 09 08 07 02 03 22 02 01 06 15 0a 09 08 0b 02 04 16 02 03 01 02 1e 07 02 17 80 00 00 f5 c0 00 fe 38 91 df 23 2c 64 c7 84 43 8d 2e ea ec c4 a1 76 ba 51 77 95 fd 2d f0 c0 90 17 44 9c bd 33 cb 34 00 ff 6f b8 bf fb 03 24 df 15 7c 30 cd 28 c3 9d 89 b3 4b 4a 80 85 b2 c3 43 ae 37 37 e3 17 18 12 76 05
224
+ Version: 5 (draft)
225
+ 05
226
+ Signiture Type: Positive certification of a User ID and Public-Key packet (0x13)
227
+ 13
228
+ Public-key Algorithm: EdDSA (pub 22)
229
+ 16
230
+ Hash Algorithm: SHA2-256 (hash 8)
231
+ 08
232
+ Hashed Subpacket (72 bytes)
233
+ 22 21 05 19 34 7b c9 87 24 64 02 5f 99 df 3e c2 e0 00 0e d9 88 48 92 e1 f7 b3 ea 4c 94 00 91 59 56 9b 54 05 02 5c 91 f4 e4 02 1b 03 05 0b 09 08 07 02 03 22 02 01 06 15 0a 09 08 0b 02 04 16 02 03 01 02 1e 07 02 17 80
234
+ Issuer Fingerprint (sub 33) (33 bytes)
235
+ 05 19 34 7b c9 87 24 64 02 5f 99 df 3e c2 e0 00 0e d9 88 48 92 e1 f7 b3 ea 4c 94 00 91 59 56 9b 54
236
+ Version: 5 (need 32 octets length)
237
+ Fingerprint (32 bytes)
238
+ 19 34 7b c9 87 24 64 02 5f 99 df 3e c2 e0 00 0e d9 88 48 92 e1 f7 b3 ea 4c 94 00 91 59 56 9b 54
239
+ Signature Creation Time (sub 2): 2019-03-20T08:08:04Z
240
+ 5c 91 f4 e4
241
+ Key Flags (sub 27) (1 bytes)
242
+ 03
243
+ Flag: This key may be used to certify other keys.
244
+ Flag: This key may be used to sign data.
245
+ Preferred Symmetric Algorithms (sub 11) (4 bytes)
246
+ 09 08 07 02
247
+ Symmetric Algorithm: AES with 256-bit key (sym 9)
248
+ 09
249
+ Symmetric Algorithm: AES with 192-bit key (sym 8)
250
+ 08
251
+ Symmetric Algorithm: AES with 128-bit key (sym 7)
252
+ 07
253
+ Symmetric Algorithm: TripleDES (168 bit key derived from 192) (sym 2)
254
+ 02
255
+ Preferred AEAD Algorithms (sub 34) (2 bytes)
256
+ 02 01
257
+ AEAD Algorithm: OCB mode <RFC7253> (aead 2)
258
+ 02
259
+ AEAD Algorithm: EAX mode (aead 1)
260
+ 01
261
+ Preferred Hash Algorithms (sub 21) (5 bytes)
262
+ 0a 09 08 0b 02
263
+ Hash Algorithm: SHA2-512 (hash 10)
264
+ 0a
265
+ Hash Algorithm: SHA2-384 (hash 9)
266
+ 09
267
+ Hash Algorithm: SHA2-256 (hash 8)
268
+ 08
269
+ Hash Algorithm: SHA2-224 (hash 11)
270
+ 0b
271
+ Hash Algorithm: SHA-1 (hash 2)
272
+ 02
273
+ Preferred Compression Algorithms (sub 22) (3 bytes)
274
+ 02 03 01
275
+ Compression Algorithm: ZLIB <RFC1950> (comp 2)
276
+ 02
277
+ Compression Algorithm: BZip2 (comp 3)
278
+ 03
279
+ Compression Algorithm: ZIP <RFC1951> (comp 1)
280
+ 01
281
+ Features (sub 30) (1 bytes)
282
+ 07
283
+ Flag: Modification Detection (packets 18 and 19)
284
+ Flag: Unknown flag1(0x06)
285
+ Key Server Preferences (sub 23) (1 bytes)
286
+ 80
287
+ Flag: No-modify
288
+ Hash left 2 bytes
289
+ f5 c0
290
+ EdDSA compressed value r (254 bits)
291
+ 38 91 df 23 2c 64 c7 84 43 8d 2e ea ec c4 a1 76 ba 51 77 95 fd 2d f0 c0 90 17 44 9c bd 33 cb 34
292
+ EdDSA compressed value s (255 bits)
293
+ 6f b8 bf fb 03 24 df 15 7c 30 cd 28 c3 9d 89 b3 4b 4a 80 85 b2 c3 43 ae 37 37 e3 17 18 12 76 05
220
294
`
221
295
)
222
296
@@ -234,6 +308,7 @@ func TestTag02(t *testing.T) {
234
308
{tag : 2 , content : tag02Body4 , ktm : []byte {0x54 , 0xc3 , 0x01 , 0xbf }, cxt : context .ModeNotSpecified , res : tag02Redult4 },
235
309
{tag : 2 , content : tag02Body5 , ktm : []byte {0x54 , 0xc3 , 0x01 , 0xbf }, cxt : context .ModeNotSpecified , res : tag02Redult5 },
236
310
{tag : 2 , content : tag02Body6 , ktm : []byte {0x5b , 0x1a , 0x4e , 0x1d }, cxt : context .ModeNotSpecified , res : tag02Redult6 },
311
+ {tag : 2 , content : tag02Body7 , ktm : []byte {0x5b , 0x1a , 0x4e , 0x1d }, cxt : context .ModeNotSpecified , res : tag02Redult7 },
237
312
}
238
313
for _ , tc := range testCases {
239
314
op := & openpgp.OpaquePacket {Tag : tc .tag , Contents : tc .content }
0 commit comments