summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/host.cc
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2019-07-02 12:40:50 +0200
committerFrancis Dupont <fdupont@isc.org>2019-07-02 17:33:39 +0200
commitf45511f0445cd4204671771175f7f0d34df54b0e (patch)
tree516fd7da32bc79550b0f276f34c1616be7a3187a /src/lib/dhcpsrv/host.cc
parent[550-authentication-key-to-text-method-miss-spelled] AuthKey is binary (diff)
downloadkea-f45511f0445cd4204671771175f7f0d34df54b0e.tar.xz
kea-f45511f0445cd4204671771175f7f0d34df54b0e.zip
[550-authentication-key-to-text-method-miss-spelled] Addressed comments
Diffstat (limited to 'src/lib/dhcpsrv/host.cc')
-rw-r--r--src/lib/dhcpsrv/host.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/dhcpsrv/host.cc b/src/lib/dhcpsrv/host.cc
index 5ffb873cce..cb5659b94f 100644
--- a/src/lib/dhcpsrv/host.cc
+++ b/src/lib/dhcpsrv/host.cc
@@ -36,7 +36,7 @@ AuthKey::AuthKey() {
std::vector<uint8_t>
AuthKey::getRandomKeyString() {
- return (isc::cryptolink::random(AuthKey::KEY_LEN));
+ return (isc::cryptolink::random(AUTH_KEY_LEN));
}
std::string
@@ -50,8 +50,8 @@ AuthKey::toText() const {
void
AuthKey::setAuthKey(const std::vector<uint8_t>& key) {
authKey_ = key;
- if (authKey_.size() > AuthKey::KEY_LEN) {
- authKey_.resize(AuthKey::KEY_LEN);
+ if (authKey_.size() > AUTH_KEY_LEN) {
+ authKey_.resize(AUTH_KEY_LEN);
}
}
@@ -59,6 +59,7 @@ void
AuthKey::setAuthKey(const std::string& key) {
if (key.empty()) {
authKey_.clear();
+ return;
}
try {
std::vector<uint8_t> bin;