Commit f52ff519 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac910] clarified an internal method name with some more comments as

suggested in review.
parent dfd8332b
......@@ -109,8 +109,10 @@ struct TSIGContext::TSIGContextImpl {
// A shortcut method to create an HMAC object for sign/verify. If one
// has been successfully created in the constructor, return it; otherwise
// create a new one and return it.
HMACPtr getHMAC() {
// create a new one and return it. In the former case, the ownership is
// transferred to the caller; the stored HMAC will be reset after the
// call.
HMACPtr createHMAC() {
if (hmac_) {
HMACPtr ret = HMACPtr();
ret.swap(hmac_);
......@@ -353,7 +355,7 @@ TSIGContext::sign(const uint16_t qid, const void* const data,
return (tsig);
}
HMACPtr hmac(impl_->getHMAC());
HMACPtr hmac(impl_->createHMAC());
// If the context has previous MAC (either the Request MAC or its own
// previous MAC), digest it.
......@@ -479,7 +481,7 @@ TSIGContext::verify(const TSIGRecord* const record, const void* const data,
return (impl_->postVerifyUpdate(error, NULL, 0));
}
HMACPtr hmac(impl_->getHMAC());
HMACPtr hmac(impl_->createHMAC());
// If the context has previous MAC (either the Request MAC or its own
// previous MAC), digest it.
......
......@@ -355,7 +355,7 @@ public:
/// Return the expected length of TSIG RR after \c sign()
///
/// This method returns the length of the TSIG RR based that would be
/// This method returns the length of the TSIG RR that would be
/// produced as a result of \c sign() with the state of the context
/// at the time of the call. The expected length can be decided
/// from the key and the algorithm (which determines the MAC size if
......@@ -363,9 +363,9 @@ public:
/// related error has been identified, the MAC will be excluded; if
/// a time error has occurred, the TSIG will include "other data".
///
/// This method is provided mainly for the convenient of the Message class,
/// which needs to know the expected TSIG length in rendering a signed
/// DNS message so that it can handle truncated messages with TSIG
/// This method is provided mainly for the convenience of the Message
/// class, which needs to know the expected TSIG length in rendering a
/// signed DNS message so that it can handle truncated messages with TSIG
/// correctly. Normal applications wouldn't need this method. The Python
/// binding for this method won't be provided for the same reason.
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment