faces/totp: rename initializer macro to credential

Shorter and far more expressive.
This commit is contained in:
Matheus Afonso Martins Moreira 2024-02-25 22:46:45 -03:00
parent 46a4076f9e
commit 238709e1d9

View File

@ -46,7 +46,7 @@ typedef struct {
unsigned char *key; unsigned char *key;
} totp_t; } totp_t;
#define TOTP_INITIALIZER(label, key_array, algo, timestep) \ #define CREDENTIAL(label, key_array, algo, timestep) \
(const totp_t) { \ (const totp_t) { \
.key = ((unsigned char *) key_array), \ .key = ((unsigned char *) key_array), \
.key_length = sizeof(key_array) - 1, \ .key_length = sizeof(key_array) - 1, \
@ -59,8 +59,8 @@ typedef struct {
// Enter your TOTP key data below // Enter your TOTP key data below
static totp_t credentials[] = { static totp_t credentials[] = {
TOTP_INITIALIZER(2F, "JBSWY3DPEHPK3PXP", SHA1, 30), CREDENTIAL(2F, "JBSWY3DPEHPK3PXP", SHA1, 30),
TOTP_INITIALIZER(AC, "JBSWY3DPEHPK3PXP", SHA1, 30), CREDENTIAL(AC, "JBSWY3DPEHPK3PXP", SHA1, 30),
}; };
// END OF KEY DATA. // END OF KEY DATA.