Commit 34e739f
committed
Reset per-signature state in loadSignature
signatureAlgorithm, canonicalizationAlgorithm, signatureValue, and
keyInfo were only assigned when the corresponding node existed in the
signature being loaded, so a reused instance silently inherited values
from a previously loaded signature when the new one omitted them. A
document whose <SignatureValue> was emptied would still verify against
the value left over from the previous verification.
Reset all four fields at the top of loadSignature and add a regression
test covering the stale-SignatureValue case on a reused verifier.1 parent 16520bc commit 34e739f
2 files changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
705 | 715 | | |
706 | 716 | | |
707 | 717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
408 | 430 | | |
409 | 431 | | |
410 | 432 | | |
| |||
0 commit comments