(List<CachedProposal> proposals)
| 1626 | } |
| 1627 | |
| 1628 | private void applyUpdate(List<CachedProposal> proposals) |
| 1629 | throws Exception |
| 1630 | { |
| 1631 | for (CachedProposal cached : proposals) |
| 1632 | { |
| 1633 | if (cached.proposal.getProposalType() != ProposalType.UPDATE) |
| 1634 | { |
| 1635 | continue; |
| 1636 | } |
| 1637 | if (cached.sender == null) |
| 1638 | { |
| 1639 | throw new Exception("Update without target leaf"); |
| 1640 | } |
| 1641 | LeafIndex target = cached.sender; |
| 1642 | if (!target.equals(index)) |
| 1643 | { |
| 1644 | tree.updateLeaf(target, cached.proposal.getLeafNode()); |
| 1645 | continue; |
| 1646 | } |
| 1647 | |
| 1648 | if (cachedUpdate == null) |
| 1649 | { |
| 1650 | throw new Exception("Self-update with no cached secret"); |
| 1651 | } |
| 1652 | |
| 1653 | if (!cached.proposal.getLeafNode().equals(cachedUpdate.update.getLeafNode())) |
| 1654 | { |
| 1655 | throw new Exception("Self-update does not match cached data"); |
| 1656 | } |
| 1657 | |
| 1658 | tree.updateLeaf(target, cached.proposal.getLeafNode()); |
| 1659 | treePriv.setLeafKey(cachedUpdate.updateSk); |
| 1660 | } |
| 1661 | |
| 1662 | if (cachedUpdate != null) |
| 1663 | { |
| 1664 | cachedUpdate.reset(); |
| 1665 | } |
| 1666 | } |
| 1667 | |
| 1668 | private boolean extensionsSupported(List<Extension> exts) |
| 1669 | { |
no test coverage detected