#include
|
#include
|
#include
|
#include
|
typedef unsigned short uint16;
|
typedef unsigned short uint16;
|
|
|
namespace base {
|
namespace base {
|
class StringPiece
|
class StringPiece
|
{
|
{
|
public:
|
public:
|
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
size_type size() const { return length_; }
|
size_type size() const { return length_; }
|
size_type length_;
|
size_type length_;
|
};
|
};
|
}
|
}
|
|
|
namespace net {
|
namespace net {
|
class DNSSECKeySet
|
class DNSSECKeySet
|
{
|
{
|
bool CheckSignature (const base::StringPiece& name, const
|
bool CheckSignature (const base::StringPiece& name, const
|
base::StringPiece& zone, const
|
base::StringPiece& zone, const
|
base::StringPiece& signature, uint16 rrtype,
|
base::StringPiece& signature, uint16 rrtype,
|
const std::vector& rrdatas);
|
const std::vector& rrdatas);
|
};
|
};
|
}
|
}
|
|
|
template class scoped_array
|
template class scoped_array
|
{
|
{
|
public: typedef C element_type;
|
public: typedef C element_type;
|
explicit scoped_array(C* p = __null):array_(p) {}
|
explicit scoped_array(C* p = __null):array_(p) {}
|
private: C* array_;
|
private: C* array_;
|
};
|
};
|
|
|
namespace net {
|
namespace net {
|
bool DNSSECKeySet::CheckSignature (const base::StringPiece& name,
|
bool DNSSECKeySet::CheckSignature (const base::StringPiece& name,
|
const base::StringPiece& zone, const base::StringPiece& signature,
|
const base::StringPiece& zone, const base::StringPiece& signature,
|
uint16 rrtype, const std::vector& rrdatas)
|
uint16 rrtype, const std::vector& rrdatas)
|
{
|
{
|
unsigned signed_data_len = 0;
|
unsigned signed_data_len = 0;
|
for (std::vector::const_iterator i =
|
for (std::vector::const_iterator i =
|
rrdatas.begin();
|
rrdatas.begin();
|
i != rrdatas.end(); i++) {
|
i != rrdatas.end(); i++) {
|
signed_data_len += 2;
|
signed_data_len += 2;
|
signed_data_len += i->size();
|
signed_data_len += i->size();
|
}
|
}
|
scoped_array signed_data(new unsigned
|
scoped_array signed_data(new unsigned
|
char[signed_data_len]);
|
char[signed_data_len]);
|
}
|
}
|
}
|
}
|
|
|
|
|