Skip to content
Snippets Groups Projects
Commit 60733e21 authored by Emily Ehlert's avatar Emily Ehlert
Browse files

Fix slot mod for YubiKey

parent f0e98854
Branches
No related merge requests found
......@@ -485,8 +485,14 @@ yubikey_import_server_key(struct plugin_context *context, const char **argv) {
ERROR_CHECK(ovpn_base64_decode(argv[3], hmac_keybuf, TLS_CRYPT_V2_SERVER_KEY_LEN) <= 0,
"ovpn_base64_decode() failed");
ret_code |= import_server_key(context->yk, context->st, aes_keybuf, context->acc_code, context->verb, AES_SLOT);
ret_code |= import_server_key(context->yk, context->st, hmac_keybuf, context->acc_code, context->verb, HMAC_SLOT);
if(context->slot[0] == context->slot[1])
{
ret_code |= import_server_key(context->yk, context->st, aes_keybuf, context->acc_code, context->verb, context->slot[AES_SLOT]);}
else
{
ret_code |= import_server_key(context->yk, context->st, aes_keybuf, context->acc_code, context->verb, context->slot[AES_SLOT]);
ret_code |= import_server_key(context->yk, context->st, hmac_keybuf, context->acc_code, context->verb, context->slot[HMAC_SLOT]);
}
ovpn_secure_memzero(aes_keybuf, sizeof(aes_keybuf));
ovpn_secure_memzero(hmac_keybuf, sizeof(hmac_keybuf));
return ret_code;
......@@ -691,10 +697,6 @@ openvpn_plugin_func_v3(const int v3structver,
struct openvpn_plugin_args_func_in const *args,
struct openvpn_plugin_args_func_return *ret)
{
#
clock_t start, end;
start = clock();
if (v3structver < OPENVPN_PLUGIN_STRUCTVER_MIN)
{
fprintf(stderr, "%s: this plugin is incompatible with the running version of OpenVPN\n", MODULE);
......@@ -754,10 +756,6 @@ openvpn_plugin_func_v3(const int v3structver,
}
end:
end = clock();
double time_taken = (double)(end - start) / ((double)CLOCKS_PER_SEC);
plog(PLOG_DEBUG, "Operation took %f\n", time_taken);
return exit_code;
}
......
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