MX
2023-03-21 19:03:53 +03:00
parent c9cc2b5e20
commit 8373a21af2
27 changed files with 696 additions and 91 deletions

View File

@@ -8,6 +8,7 @@
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <dolphin/dolphin.h>
#include "features_config.h"
#include "services/config/config.h"
#include "types/plugin_state.h"
#include "types/token_info.h"
@@ -108,6 +109,14 @@ static bool totp_plugin_state_init(PluginState* const plugin_state) {
return false;
}
#ifdef TOTP_BADBT_TYPE_ENABLED
if(plugin_state->automation_method & AutomationMethodBadBt) {
plugin_state->bt_type_code_worker_context = totp_bt_type_code_worker_init();
} else {
plugin_state->bt_type_code_worker_context = NULL;
}
#endif
return true;
}
@@ -130,6 +139,13 @@ static void totp_plugin_state_free(PluginState* plugin_state) {
free(plugin_state->crypto_verify_data);
}
#ifdef TOTP_BADBT_TYPE_ENABLED
if(plugin_state->bt_type_code_worker_context != NULL) {
totp_bt_type_code_worker_free(plugin_state->bt_type_code_worker_context);
plugin_state->bt_type_code_worker_context = NULL;
}
#endif
furi_mutex_free(plugin_state->mutex);
free(plugin_state);
}