Skip to content

Commit

Permalink
Merge branch 'master' into deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Jun 1, 2021
2 parents f632bf4 + 6fca01a commit df4859f
Show file tree
Hide file tree
Showing 4 changed files with 1,105 additions and 293 deletions.
2 changes: 1 addition & 1 deletion contracts/DNSSEC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract contract DNSSEC {
event NSEC3DigestUpdated(uint8 id, address addr);
event RRSetUpdated(bytes name, bytes rrset);

function submitRRSets(bytes calldata data, bytes calldata proof) public virtual returns (bytes memory);
function submitRRSets(RRSetWithSignature[] memory input, bytes calldata proof) public virtual returns (bytes memory);
function submitRRSet(RRSetWithSignature calldata input, bytes calldata proof) public virtual returns (bytes memory);
function deleteRRSet(uint16 deleteType, bytes calldata deleteName, RRSetWithSignature calldata nsec, bytes calldata proof) public virtual;
function deleteRRSetNSEC3(uint16 deleteType, bytes memory deleteName, RRSetWithSignature memory closestEncloser, RRSetWithSignature memory nextClosest, bytes memory dnskey) public virtual;
Expand Down
15 changes: 4 additions & 11 deletions contracts/DNSSECImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,14 @@ contract DNSSECImpl is DNSSEC, Owned {

/**
* @dev Submits multiple RRSets
* @param data The data to submit, as a series of chunks. Each chunk is
* in the format <uint16 length><bytes input><uint16 length><bytes sig>
* @param input A list of RRSets and signatures forming a chain of trust from an existing known-good record.
* @param _proof The DNSKEY or DS to validate the first signature against.
* @return The last RRSET submitted.
*/
function submitRRSets(bytes memory data, bytes memory _proof) public override returns (bytes memory) {
uint offset = 0;
function submitRRSets(RRSetWithSignature[] memory input, bytes calldata _proof) public override returns (bytes memory) {
bytes memory proof = _proof;
while(offset < data.length) {
RRSetWithSignature memory input;
input.rrset = data.substring(offset + 2, data.readUint16(offset));
offset += input.rrset.length + 2;
input.sig = data.substring(offset + 2, data.readUint16(offset));
offset += input.sig.length + 2;
proof = _submitRRSet(input, proof);
for(uint i = 0; i < input.length; i++) {
proof = _submitRRSet(input[i], proof);
}
return proof;
}
Expand Down
Loading

0 comments on commit df4859f

Please sign in to comment.