@@ -57,13 +57,13 @@ type ServiceConfig struct {
57
57
func (hc * CothorityConfig ) Save (file string ) error {
58
58
fd , err := os .OpenFile (file , os .O_RDWR | os .O_CREATE | os .O_TRUNC , 0600 )
59
59
if err != nil {
60
- return xerrors .Errorf ("opening config file: %+ v" , err )
60
+ return xerrors .Errorf ("opening config file: %v" , err )
61
61
}
62
62
fd .WriteString ("# This file contains your private key.\n " )
63
63
fd .WriteString ("# Do not give it away lightly!\n " )
64
64
err = toml .NewEncoder (fd ).Encode (hc )
65
65
if err != nil {
66
- return xerrors .Errorf ("toml encoding: %+ v" , err )
66
+ return xerrors .Errorf ("toml encoding: %v" , err )
67
67
}
68
68
return nil
69
69
}
@@ -73,7 +73,7 @@ func LoadCothority(file string) (*CothorityConfig, error) {
73
73
hc := & CothorityConfig {}
74
74
_ , err := toml .DecodeFile (file , hc )
75
75
if err != nil {
76
- return nil , xerrors .Errorf ("toml decoding: %+ v" , err )
76
+ return nil , xerrors .Errorf ("toml decoding: %v" , err )
77
77
}
78
78
79
79
// Backwards compatibility with configs before we included the suite name
@@ -88,17 +88,17 @@ func LoadCothority(file string) (*CothorityConfig, error) {
88
88
func (hc * CothorityConfig ) GetServerIdentity () (* network.ServerIdentity , error ) {
89
89
suite , err := suites .Find (hc .Suite )
90
90
if err != nil {
91
- return nil , xerrors .Errorf ("kyber suite: %+ v" , err )
91
+ return nil , xerrors .Errorf ("kyber suite: %v" , err )
92
92
}
93
93
94
94
// Try to decode the Hex values
95
95
private , err := encoding .StringHexToScalar (suite , hc .Private )
96
96
if err != nil {
97
- return nil , xerrors .Errorf ("parsing private key: %+ v" , err )
97
+ return nil , xerrors .Errorf ("parsing private key: %v" , err )
98
98
}
99
99
point , err := encoding .StringHexToPoint (suite , hc .Public )
100
100
if err != nil {
101
- return nil , xerrors .Errorf ("parsing public key: %+ v" , err )
101
+ return nil , xerrors .Errorf ("parsing public key: %v" , err )
102
102
}
103
103
si := network .NewServerIdentity (point , hc .Address )
104
104
si .SetPrivate (private )
@@ -110,7 +110,7 @@ func (hc *CothorityConfig) GetServerIdentity() (*network.ServerIdentity, error)
110
110
} else {
111
111
p , err := strconv .Atoi (si .Address .Port ())
112
112
if err != nil {
113
- return nil , xerrors .Errorf ("port conversion: %+ v" )
113
+ return nil , xerrors .Errorf ("port conversion: %v" )
114
114
}
115
115
si .URL = fmt .Sprintf ("https://%s:%d" , si .Address .Host (), p + 1 )
116
116
}
@@ -127,16 +127,16 @@ func (hc *CothorityConfig) GetServerIdentity() (*network.ServerIdentity, error)
127
127
func ParseCothority (file string ) (* CothorityConfig , * onet.Server , error ) {
128
128
hc , err := LoadCothority (file )
129
129
if err != nil {
130
- return nil , nil , xerrors .Errorf ("reading config: %+ v" , err )
130
+ return nil , nil , xerrors .Errorf ("reading config: %v" , err )
131
131
}
132
132
suite , err := suites .Find (hc .Suite )
133
133
if err != nil {
134
- return nil , nil , xerrors .Errorf ("kyber suite: %+ v" , err )
134
+ return nil , nil , xerrors .Errorf ("kyber suite: %v" , err )
135
135
}
136
136
137
137
si , err := hc .GetServerIdentity ()
138
138
if err != nil {
139
- return nil , nil , xerrors .Errorf ("parse server identity: %+ v" , err )
139
+ return nil , nil , xerrors .Errorf ("parse server identity: %v" , err )
140
140
}
141
141
142
142
// Same as `NewServerTCP` if `hc.ListenAddress` is empty
@@ -154,7 +154,7 @@ func ParseCothority(file string) (*CothorityConfig, *onet.Server, error) {
154
154
hc .WebSocketTLSCertificateKey .blobPart (),
155
155
)
156
156
if err != nil {
157
- return nil , nil , xerrors .Errorf ("certificate: %+ v" , err )
157
+ return nil , nil , xerrors .Errorf ("certificate: %v" , err )
158
158
}
159
159
160
160
server .WebSocket .Lock ()
@@ -165,15 +165,15 @@ func ParseCothority(file string) (*CothorityConfig, *onet.Server, error) {
165
165
} else {
166
166
tlsCertificate , err := hc .WebSocketTLSCertificate .Content ()
167
167
if err != nil {
168
- return nil , nil , xerrors .Errorf ("getting WebSocketTLSCertificate content: %+ v" , err )
168
+ return nil , nil , xerrors .Errorf ("getting WebSocketTLSCertificate content: %v" , err )
169
169
}
170
170
tlsCertificateKey , err := hc .WebSocketTLSCertificateKey .Content ()
171
171
if err != nil {
172
- return nil , nil , xerrors .Errorf ("getting WebSocketTLSCertificateKey content: %+ v" , err )
172
+ return nil , nil , xerrors .Errorf ("getting WebSocketTLSCertificateKey content: %v" , err )
173
173
}
174
174
cert , err := tls .X509KeyPair (tlsCertificate , tlsCertificateKey )
175
175
if err != nil {
176
- return nil , nil , xerrors .Errorf ("loading X509KeyPair: %+ v" , err )
176
+ return nil , nil , xerrors .Errorf ("loading X509KeyPair: %v" , err )
177
177
}
178
178
179
179
server .WebSocket .Lock ()
@@ -235,7 +235,7 @@ func (g *Group) Toml(suite suites.Suite) (*GroupToml, error) {
235
235
for i , si := range g .Roster .List {
236
236
pub , err := encoding .PointToStringHex (suite , si .Public )
237
237
if err != nil {
238
- return nil , xerrors .Errorf ("encoding public key: %+ v" , err )
238
+ return nil , xerrors .Errorf ("encoding public key: %v" , err )
239
239
}
240
240
241
241
services := make (map [string ]ServerServiceConfig )
@@ -244,7 +244,7 @@ func (g *Group) Toml(suite suites.Suite) (*GroupToml, error) {
244
244
245
245
pub , err := encoding .PointToStringHex (suite , sid .Public )
246
246
if err != nil {
247
- return nil , xerrors .Errorf ("encoding service key: %+ v" , err )
247
+ return nil , xerrors .Errorf ("encoding service key: %v" , err )
248
248
}
249
249
250
250
services [sid .Name ] = ServerServiceConfig {Public : pub , Suite : suite .String ()}
@@ -267,7 +267,7 @@ func (g *Group) Toml(suite suites.Suite) (*GroupToml, error) {
267
267
func (g * Group ) Save (suite suites.Suite , filename string ) error {
268
268
gt , err := g .Toml (suite )
269
269
if err != nil {
270
- return xerrors .Errorf ("toml encoding: %+ v" , err )
270
+ return xerrors .Errorf ("toml encoding: %v" , err )
271
271
}
272
272
273
273
return gt .Save (filename )
@@ -281,7 +281,7 @@ func ReadGroupDescToml(f io.Reader) (*Group, error) {
281
281
group := & GroupToml {}
282
282
_ , err := toml .DecodeReader (f , group )
283
283
if err != nil {
284
- return nil , xerrors .Errorf ("toml decoding: %+ v" , err )
284
+ return nil , xerrors .Errorf ("toml decoding: %v" , err )
285
285
}
286
286
// convert from ServerTomls to entities
287
287
var entities = make ([]* network.ServerIdentity , len (group .Servers ))
@@ -293,7 +293,7 @@ func ReadGroupDescToml(f io.Reader) (*Group, error) {
293
293
}
294
294
en , err := s .ToServerIdentity ()
295
295
if err != nil {
296
- return nil , xerrors .Errorf ("server identity encoding: %+ v" , err )
296
+ return nil , xerrors .Errorf ("server identity encoding: %v" , err )
297
297
}
298
298
entities [i ] = en
299
299
descs [en ] = s .Description
@@ -308,12 +308,12 @@ func ReadGroupDescToml(f io.Reader) (*Group, error) {
308
308
func (gt * GroupToml ) Save (fname string ) error {
309
309
file , err := os .Create (fname )
310
310
if err != nil {
311
- return xerrors .Errorf ("creating file: %+ v" , err )
311
+ return xerrors .Errorf ("creating file: %v" , err )
312
312
}
313
313
defer file .Close ()
314
314
_ , err = file .WriteString (gt .String ())
315
315
if err != nil {
316
- return xerrors .Errorf ("writing file: %+ v" , err )
316
+ return xerrors .Errorf ("writing file: %v" , err )
317
317
}
318
318
319
319
return nil
@@ -338,13 +338,13 @@ func (gt *GroupToml) String() string {
338
338
func (s * ServerToml ) ToServerIdentity () (* network.ServerIdentity , error ) {
339
339
suite , err := suites .Find (s .Suite )
340
340
if err != nil {
341
- return nil , xerrors .Errorf ("kyber suite: %+ v" , err )
341
+ return nil , xerrors .Errorf ("kyber suite: %v" , err )
342
342
}
343
343
344
344
pubR := strings .NewReader (s .Public )
345
345
public , err := encoding .ReadHexPoint (suite , pubR )
346
346
if err != nil {
347
- return nil , xerrors .Errorf ("encoding key: %+ v" , err )
347
+ return nil , xerrors .Errorf ("encoding key: %v" , err )
348
348
}
349
349
si := network .NewServerIdentity (public , s .Address )
350
350
si .URL = s .URL
@@ -474,7 +474,7 @@ func (cu CertificateURL) Content() ([]byte, error) {
474
474
if cuType == File {
475
475
dat , err := ioutil .ReadFile (cu .blobPart ())
476
476
if err != nil {
477
- return nil , xerrors .Errorf ("reading file: %+ v" , err )
477
+ return nil , xerrors .Errorf ("reading file: %v" , err )
478
478
}
479
479
return dat , nil
480
480
}
0 commit comments