File: 002-fix-fxamacker-cbor-2.9.0.patch

package info (click to toggle)
golang-github-veraison-go-cose 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,132 kB
  • sloc: sh: 8; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 2,873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From: Mathias Gibbens <gibmat@debian.org>
Description: Update expected error messages from fxamacker/cbor
Forwarded: https://github.com/veraison/go-cose/pull/218
diff --git a/conformance_test.go b/conformance_test.go
index cb76135..0500bbd 100644
--- a/conformance_test.go
+++ b/conformance_test.go
@@ -80,8 +80,8 @@ var testCases = []struct {
 	{name: "sign1-verify-0006"},
 	{name: "sign1-verify-negative-0000", err: "cbor: invalid protected header: cbor: require bstr type"},
 	{name: "sign1-verify-negative-0001", err: "cbor: invalid protected header: cbor: protected header: require map type"},
-	{name: "sign1-verify-negative-0002", err: "cbor: invalid protected header: cbor: found duplicate map key \"1\" at map element index 1"},
-	{name: "sign1-verify-negative-0003", err: "cbor: invalid unprotected header: cbor: found duplicate map key \"4\" at map element index 1"},
+	{name: "sign1-verify-negative-0002", err: "cbor: invalid protected header: cbor: found duplicate map key cose.headerLabelValidator{value:1} at map element index 1"},
+	{name: "sign1-verify-negative-0003", err: "cbor: invalid unprotected header: cbor: found duplicate map key cose.headerLabelValidator{value:4} at map element index 1"},
 }
 
 func TestConformance(t *testing.T) {
diff --git a/headers_test.go b/headers_test.go
index 11d4e72..d3c2916 100644
--- a/headers_test.go
+++ b/headers_test.go
@@ -289,7 +289,7 @@ func TestProtectedHeader_UnmarshalCBOR(t *testing.T) {
 			data: []byte{
 				0x45, 0xa2, 0x01, 0x00, 0x01, 0x00,
 			},
-			wantErr: "cbor: found duplicate map key \"1\" at map element index 1",
+			wantErr: "cbor: found duplicate map key cose.headerLabelValidator{value:1} at map element index 1",
 		},
 		{
 			name: "incomplete CBOR data",
@@ -694,7 +694,7 @@ func TestUnprotectedHeader_UnmarshalCBOR(t *testing.T) {
 			data: []byte{
 				0xa2, 0x01, 0x00, 0x01, 0x00,
 			},
-			wantErr: "cbor: found duplicate map key \"1\" at map element index 1",
+			wantErr: "cbor: found duplicate map key cose.headerLabelValidator{value:1} at map element index 1",
 		},
 		{
 			name: "incomplete CBOR data",
diff --git a/key_test.go b/key_test.go
index 6e5ee0c..309cedc 100644
--- a/key_test.go
+++ b/key_test.go
@@ -340,7 +340,7 @@ func TestKey_UnmarshalCBOR(t *testing.T) {
 				0x18, 0x66, 0x18, 0x47, // 66: 47
 			},
 			want:    nil,
-			wantErr: `cbor: found duplicate map key "102" at map element index 2`,
+			wantErr: `cbor: found duplicate map key 102 at map element index 2`,
 		}, {
 			name: "duplicated kty",
 			data: []byte{
@@ -350,7 +350,7 @@ func TestKey_UnmarshalCBOR(t *testing.T) {
 				0x01, 0x01, // kty: OKP (duplicated)
 			},
 			want:    nil,
-			wantErr: `cbor: found duplicate map key "1" at map element index 2`,
+			wantErr: `cbor: found duplicate map key 1 at map element index 2`,
 		}, {
 			name: "OKP missing curve",
 			data: []byte{