MCPcopy Index your code
hub / github.com/bcgit/bc-java / applyUpdate

Method applyUpdate

mls/src/main/java/org/bouncycastle/mls/protocol/Group.java:1628–1666  ·  view source on GitHub ↗
(List<CachedProposal> proposals)

Source from the content-addressed store, hash-verified

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 {

Callers 1

applyMethod · 0.95

Calls 7

equalsMethod · 0.95
getProposalTypeMethod · 0.80
updateLeafMethod · 0.80
setLeafKeyMethod · 0.80
equalsMethod · 0.65
resetMethod · 0.65
getLeafNodeMethod · 0.45

Tested by

no test coverage detected