This repository was archived by the owner on Apr 22, 2025. It is now read-only.
Commit cb9f8c1
committed
FAB-1263 ECDSA signature malleability resistance
This change-set introduces ECDSA Signature malleability resistance.
ECDSA signatures do not have unique representation and this can facilitate
replay attacks and more. In order to have a unique representation,
this change-set forses BCCSP to generate and accept only signatures
with low-S.
Bitcoin has also addressed this issue with the following BIP:
https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki
Before merging this change-set, we need to ensure that client-sdks
generates signatures properly in order to avoid massive rejection
of transactions.
This is a port of the GO implementation here:
https://gerrit.hyperledger.org/r/#/c/2983
This changeset has been successfully tested with 2983.
Change-Id: Iee78ee93f83ddfdd99526ea3cca9c11b33af8318
Signed-off-by: Jim Zhang <jzhang@us.ibm.com>1 parent fab746c commit cb9f8c1
File tree
3 files changed
+83
-16
lines changed- hfc/lib/impl
- test/unit
3 files changed
+83
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 31 | + | |
| 32 | + | |
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
| |||
236 | 231 | | |
237 | 232 | | |
238 | 233 | | |
| 234 | + | |
239 | 235 | | |
240 | 236 | | |
241 | 237 | | |
| |||
258 | 254 | | |
259 | 255 | | |
260 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
| |||
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
289 | 338 | | |
290 | 339 | | |
291 | 340 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1246 | 1254 | | |
1247 | 1255 | | |
1248 | 1256 | | |
| |||
1369 | 1377 | | |
1370 | 1378 | | |
1371 | 1379 | | |
1372 | | - | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
1373 | 1388 | | |
1374 | 1389 | | |
1375 | 1390 | | |
| |||
1412 | 1427 | | |
1413 | 1428 | | |
1414 | 1429 | | |
1415 | | - | |
| 1430 | + | |
1416 | 1431 | | |
1417 | 1432 | | |
1418 | 1433 | | |
1419 | 1434 | | |
1420 | 1435 | | |
1421 | 1436 | | |
1422 | 1437 | | |
1423 | | - | |
| 1438 | + | |
1424 | 1439 | | |
1425 | 1440 | | |
1426 | 1441 | | |
1427 | | - | |
1428 | | - | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1429 | 1445 | | |
1430 | 1446 | | |
1431 | 1447 | | |
| |||
0 commit comments