Skip to content

Commit

Permalink
Don't allow users to opt-in to older versions of Argon2.
Browse files Browse the repository at this point in the history
  • Loading branch information
SadieCat committed May 10, 2024
1 parent 0af89e5 commit 5ac051a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/modules/extra/m_argon2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class ProviderConfig final
uint32_t outlen;
uint32_t saltlen;
uint32_t threads;
Argon2_version version;

ProviderConfig()
{
Expand Down Expand Up @@ -69,12 +68,6 @@ class ProviderConfig final

uint32_t def_threads = def ? def->threads : 1;
this->threads = tag->getNum<uint32_t>("threads", def_threads, ARGON2_MIN_THREADS, ARGON2_MAX_THREADS);

Argon2_version def_version = def ? def->version : ARGON2_VERSION_13;
this->version = tag->getEnum("version", def_version, {
{ "10", ARGON2_VERSION_10 },
{ "13", ARGON2_VERSION_13 },
});
}
};

Expand Down Expand Up @@ -126,7 +119,7 @@ class HashArgon2 final
encoded_data.data(),
encoded_data.size(),
argon2Type,
config.version);
ARGON2_VERSION_NUMBER);

if (argonResult != ARGON2_OK)
throw ModuleException(creator, "Argon2 hashing failed: " + std::string(argon2_error_message(argonResult)));
Expand Down

0 comments on commit 5ac051a

Please sign in to comment.