Implement OTP page in config
a
This commit is contained in:
@@ -766,8 +766,8 @@ namespace confighttp {
|
||||
}
|
||||
|
||||
outputTree.put("otp", nvhttp::request_otp(it->second));
|
||||
outputTree.put("statue", true);
|
||||
outputTree.put("message", "OTP created, effective within 1 minute.");
|
||||
outputTree.put("status", true);
|
||||
outputTree.put("message", "OTP created, effective within 3 minutes.");
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
BOOST_LOG(warning) << "OTP creation failed: "sv << e.what();
|
||||
|
||||
@@ -619,10 +619,10 @@ namespace nvhttp {
|
||||
tree.put("root.<xmlattr>.status_code", 503);
|
||||
tree.put("root.<xmlattr>.status_message", "OTP auth not available.");
|
||||
} else {
|
||||
auto hash = util::hex(crypto::hash(one_time_pin + ptr->second.async_insert_pin.salt + otp_passphrase));
|
||||
auto hash = util::hex(crypto::hash(one_time_pin + ptr->second.async_insert_pin.salt + otp_passphrase), true);
|
||||
|
||||
if (hash.to_string_view() == it->second) {
|
||||
getservercert(ptr->second, tree, one_time_pin);
|
||||
pin(one_time_pin, deviceName);
|
||||
one_time_pin.clear();
|
||||
otp_passphrase.clear();
|
||||
return;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace nvhttp {
|
||||
*/
|
||||
constexpr auto PORT_HTTPS = -5;
|
||||
|
||||
constexpr auto OTP_EXPIRE_DURATION = 60s;
|
||||
constexpr auto OTP_EXPIRE_DURATION = 180s;
|
||||
|
||||
/**
|
||||
* @brief Start the nvhttp server.
|
||||
|
||||
Reference in New Issue
Block a user