@@ -13,6 +13,7 @@ import (
13
13
type tls1prfTest struct {
14
14
hash func () hash.Hash
15
15
secret []byte
16
+ label []byte
16
17
seed []byte
17
18
out []byte
18
19
}
@@ -27,7 +28,8 @@ var tls1prfTests = []tls1prfTest{
27
28
},
28
29
[]byte {
29
30
0x74 , 0x65 , 0x73 , 0x74 , 0x20 , 0x6c , 0x61 , 0x62 ,
30
- 0x65 , 0x6c ,
31
+ 0x65 , 0x6c },
32
+ []byte {
31
33
0xa0 , 0xba , 0x9f , 0x93 , 0x6c , 0xda , 0x31 , 0x18 ,
32
34
0x27 , 0xa6 , 0xf7 , 0x96 , 0xff , 0xd5 , 0x19 , 0x8c ,
33
35
},
@@ -55,7 +57,8 @@ var tls1prfTests = []tls1prfTest{
55
57
},
56
58
[]byte {
57
59
0x74 , 0x65 , 0x73 , 0x74 , 0x20 , 0x6c , 0x61 , 0x62 ,
58
- 0x65 , 0x6c ,
60
+ 0x65 , 0x6c },
61
+ []byte {
59
62
0xcd , 0x66 , 0x5c , 0xf6 , 0xa8 , 0x44 , 0x7d , 0xd6 ,
60
63
0xff , 0x8b , 0x27 , 0x55 , 0x5e , 0xdb , 0x74 , 0x65 ,
61
64
},
@@ -90,6 +93,8 @@ var tls1prfTests = []tls1prfTest{
90
93
[]byte {
91
94
0x74 , 0x65 , 0x73 , 0x74 , 0x20 , 0x6c , 0x61 , 0x62 ,
92
95
0x65 , 0x6c ,
96
+ },
97
+ []byte {
93
98
0xd4 , 0x64 , 0x0e , 0x12 , 0xe4 , 0xbc , 0xdb , 0xfb ,
94
99
0x43 , 0x7f , 0x03 , 0xe6 , 0xae , 0x41 , 0x8e , 0xe5 ,
95
100
},
@@ -128,7 +133,7 @@ func TestTLS1PRF(t *testing.T) {
128
133
t .Skip ("TLS 1.2 PRF is not supported" )
129
134
}
130
135
for i , tt := range tls1prfTests {
131
- out , err := openssl .TLS1PRF (tt .secret , tt .seed , len (tt .out ), tt .hash )
136
+ out , err := openssl .TLS1PRF (tt .secret , tt .label , tt . seed , len (tt .out ), tt .hash )
132
137
if err != nil {
133
138
t .Errorf ("test %d: error deriving TLS 1.2 PRF: %v." , i , err )
134
139
}
0 commit comments