#include "ACLManager.h"
#define MAC_ADDRESS_LEN 17
+#define PASSKEY_DATAS 11
+#define PASSKEY_LEN 4
typedef struct {
conv::acl_manager::PopupCallback callback;
void CreatePasskey()
{
- char token[64] = "01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ char token[PASSKEY_DATAS] = "0123456789";
unsigned int time_seed = (unsigned int)time(NULL);
srand(time_seed);
- for (int i = 0; i < 4; i++) {
- int random_num = rand_r(&time_seed) % 63;
- passkey[i] = token[random_num];
+ for (int index = 0; index < PASSKEY_LEN; index++) {
+ int random_num = rand_r(&time_seed) % (PASSKEY_DATAS - 1);
+ passkey[index] = token[random_num];
}
- passkey[4] = '\0';
+ passkey[PASSKEY_LEN] = '\0';
}
static void LaunchPasskeyInputPopupCallback(app_control_h request, app_control_h reply, app_control_result_e result_e, void *user_data)