@@ -45,45 +45,37 @@ contract DNSSECImpl is DNSSEC, Owned {
4545 mapping (uint8 => Algorithm) public algorithms;
4646 mapping (uint8 => Digest) public digests;
4747
48- /**
49- * @dev Constructor.
50- * @param _anchors The binary format RR entries for the root DS records.
51- */
48+ /// @dev Constructor.
49+ /// @param _anchors The binary format RR entries for the root DS records.
5250 constructor (bytes memory _anchors ) {
5351 // Insert the 'trust anchors' - the key hashes that start the chain
5452 // of trust for all other records.
5553 anchors = _anchors;
5654 }
5755
58- /**
59- * @dev Sets the contract address for a signature verification algorithm.
60- * Callable only by the owner.
61- * @param id The algorithm ID
62- * @param algo The address of the algorithm contract.
63- */
56+ /// @dev Sets the contract address for a signature verification algorithm.
57+ /// Callable only by the owner.
58+ /// @param id The algorithm ID
59+ /// @param algo The address of the algorithm contract.
6460 function setAlgorithm (uint8 id , Algorithm algo ) public owner_only {
6561 algorithms[id] = algo;
6662 emit AlgorithmUpdated (id, address (algo));
6763 }
6864
69- /**
70- * @dev Sets the contract address for a digest verification algorithm.
71- * Callable only by the owner.
72- * @param id The digest ID
73- * @param digest The address of the digest contract.
74- */
65+ /// @dev Sets the contract address for a digest verification algorithm.
66+ /// Callable only by the owner.
67+ /// @param id The digest ID
68+ /// @param digest The address of the digest contract.
7569 function setDigest (uint8 id , Digest digest ) public owner_only {
7670 digests[id] = digest;
7771 emit DigestUpdated (id, address (digest));
7872 }
7973
80- /**
81- * @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.
82- * Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.
83- * @param input A list of signed RRSets.
84- * @return rrs The RRData from the last RRSet in the chain.
85- * @return inception The inception time of the signed record set.
86- */
74+ /// @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.
75+ /// Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.
76+ /// @param input A list of signed RRSets.
77+ /// @return rrs The RRData from the last RRSet in the chain.
78+ /// @return inception The inception time of the signed record set.
8779 function verifyRRSet (
8880 RRSetWithSignature[] memory input
8981 )
@@ -96,14 +88,12 @@ contract DNSSECImpl is DNSSEC, Owned {
9688 return verifyRRSet (input, block .timestamp );
9789 }
9890
99- /**
100- * @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.
101- * Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.
102- * @param input A list of signed RRSets.
103- * @param now The Unix timestamp to validate the records at.
104- * @return rrs The RRData from the last RRSet in the chain.
105- * @return inception The inception time of the signed record set.
106- */
91+ /// @dev Takes a chain of signed DNS records, verifies them, and returns the data from the last record set in the chain.
92+ /// Reverts if the records do not form an unbroken chain of trust to the DNSSEC anchor records.
93+ /// @param input A list of signed RRSets.
94+ /// @param now The Unix timestamp to validate the records at.
95+ /// @return rrs The RRData from the last RRSet in the chain.
96+ /// @return inception The inception time of the signed record set.
10797 function verifyRRSet (
10898 RRSetWithSignature[] memory input ,
10999 uint256 now
@@ -127,16 +117,14 @@ contract DNSSECImpl is DNSSEC, Owned {
127117 return (proof, inception);
128118 }
129119
130- /**
131- * @dev Validates an RRSet against the already trusted RR provided in `proof`.
132- *
133- * @param input The signed RR set. This is in the format described in section
134- * 5.3.2 of RFC4035: The RRDATA section from the RRSIG without the signature
135- * data, followed by a series of canonicalised RR records that the signature
136- * applies to.
137- * @param proof The DNSKEY or DS to validate the signature against.
138- * @param now The current timestamp.
139- */
120+ /// @dev Validates an RRSet against the already trusted RR provided in `proof`.
121+ ///
122+ /// @param input The signed RR set. This is in the format described in section
123+ /// 5.3.2 of RFC4035: The RRDATA section from the RRSIG without the signature
124+ /// data, followed by a series of canonicalised RR records that the signature
125+ /// applies to.
126+ /// @param proof The DNSKEY or DS to validate the signature against.
127+ /// @param now The current timestamp.
140128 function validateSignedSet (
141129 RRSetWithSignature memory input ,
142130 bytes memory proof ,
@@ -173,11 +161,9 @@ contract DNSSECImpl is DNSSEC, Owned {
173161 return rrset;
174162 }
175163
176- /**
177- * @dev Validates a set of RRs.
178- * @param rrset The RR set.
179- * @param typecovered The type covered by the RRSIG record.
180- */
164+ /// @dev Validates a set of RRs.
165+ /// @param rrset The RR set.
166+ /// @param typecovered The type covered by the RRSIG record.
181167 function validateRRs (
182168 RRUtils.SignedSet memory rrset ,
183169 uint16 typecovered
@@ -213,15 +199,13 @@ contract DNSSECImpl is DNSSEC, Owned {
213199 }
214200 }
215201
216- /**
217- * @dev Performs signature verification.
218- *
219- * Throws or reverts if unable to verify the record.
220- *
221- * @param name The name of the RRSIG record, in DNS label-sequence format.
222- * @param data The original data to verify.
223- * @param proof A DS or DNSKEY record that's already verified by the oracle.
224- */
202+ /// @dev Performs signature verification.
203+ ///
204+ /// Throws or reverts if unable to verify the record.
205+ ///
206+ /// @param name The name of the RRSIG record, in DNS label-sequence format.
207+ /// @param data The original data to verify.
208+ /// @param proof A DS or DNSKEY record that's already verified by the oracle.
225209 function verifySignature (
226210 bytes memory name ,
227211 RRUtils.SignedSet memory rrset ,
@@ -245,12 +229,10 @@ contract DNSSECImpl is DNSSEC, Owned {
245229 }
246230 }
247231
248- /**
249- * @dev Attempts to verify a signed RRSET against an already known public key.
250- * @param rrset The signed set to verify.
251- * @param data The original data the signed set was read from.
252- * @param proof The serialized DS or DNSKEY record to use as proof.
253- */
232+ /// @dev Attempts to verify a signed RRSET against an already known public key.
233+ /// @param rrset The signed set to verify.
234+ /// @param data The original data the signed set was read from.
235+ /// @param proof The serialized DS or DNSKEY record to use as proof.
254236 function verifyWithKnownKey (
255237 RRUtils.SignedSet memory rrset ,
256238 RRSetWithSignature memory data ,
@@ -275,13 +257,11 @@ contract DNSSECImpl is DNSSEC, Owned {
275257 revert NoMatchingProof (rrset.signerName);
276258 }
277259
278- /**
279- * @dev Attempts to verify some data using a provided key and a signature.
280- * @param dnskey The dns key record to verify the signature with.
281- * @param rrset The signed RRSET being verified.
282- * @param data The original data `rrset` was decoded from.
283- * @return True iff the key verifies the signature.
284- */
260+ /// @dev Attempts to verify some data using a provided key and a signature.
261+ /// @param dnskey The dns key record to verify the signature with.
262+ /// @param rrset The signed RRSET being verified.
263+ /// @param data The original data `rrset` was decoded from.
264+ /// @return True iff the key verifies the signature.
285265 function verifySignatureWithKey (
286266 RRUtils.DNSKEY memory dnskey ,
287267 bytes memory keyrdata ,
@@ -320,13 +300,11 @@ contract DNSSECImpl is DNSSEC, Owned {
320300 return algorithm.verify (keyrdata, data.rrset, data.sig);
321301 }
322302
323- /**
324- * @dev Attempts to verify a signed RRSET against an already known hash. This function assumes
325- * that the record
326- * @param rrset The signed set to verify.
327- * @param data The original data the signed set was read from.
328- * @param proof The serialized DS or DNSKEY record to use as proof.
329- */
303+ /// @dev Attempts to verify a signed RRSET against an already known hash. This function assumes
304+ /// that the record
305+ /// @param rrset The signed set to verify.
306+ /// @param data The original data the signed set was read from.
307+ /// @param proof The serialized DS or DNSKEY record to use as proof.
330308 function verifyWithDS (
331309 RRUtils.SignedSet memory rrset ,
332310 RRSetWithSignature memory data ,
@@ -362,14 +340,12 @@ contract DNSSECImpl is DNSSEC, Owned {
362340 revert NoMatchingProof (rrset.signerName);
363341 }
364342
365- /**
366- * @dev Attempts to verify a key using DS records.
367- * @param keyname The DNS name of the key, in DNS label-sequence format.
368- * @param dsrrs The DS records to use in verification.
369- * @param dnskey The dnskey to verify.
370- * @param keyrdata The RDATA section of the key.
371- * @return True if a DS record verifies this key.
372- */
343+ /// @dev Attempts to verify a key using DS records.
344+ /// @param keyname The DNS name of the key, in DNS label-sequence format.
345+ /// @param dsrrs The DS records to use in verification.
346+ /// @param dnskey The dnskey to verify.
347+ /// @param keyrdata The RDATA section of the key.
348+ /// @return True if a DS record verifies this key.
373349 function verifyKeyWithDS (
374350 bytes memory keyname ,
375351 RRUtils.RRIterator memory dsrrs ,
@@ -405,13 +381,11 @@ contract DNSSECImpl is DNSSEC, Owned {
405381 return false ;
406382 }
407383
408- /**
409- * @dev Attempts to verify a DS record's hash value against some data.
410- * @param digesttype The digest ID from the DS record.
411- * @param data The data to digest.
412- * @param digest The digest data to check against.
413- * @return True iff the digest matches.
414- */
384+ /// @dev Attempts to verify a DS record's hash value against some data.
385+ /// @param digesttype The digest ID from the DS record.
386+ /// @param data The data to digest.
387+ /// @param digest The digest data to check against.
388+ /// @return True if the digest matches.
415389 function verifyDSHash (
416390 uint8 digesttype ,
417391 bytes memory data ,
0 commit comments