Skip to content

Commit

Permalink
hotp: oracle: don't need magic
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Jan 7, 2024
1 parent f655be1 commit a284254
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/tutorials/hotp/hotp_oracle_complete/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ int key_digits[NUM_KEYS] = {6, 6, 7, 8};
typedef uint64_t counter_t;

typedef struct __attribute__((__packed__)) {
uint32_t magic;
uint8_t len;
uint8_t iv[16];
uint8_t key[64];
Expand Down Expand Up @@ -135,8 +134,7 @@ static int initialize_keys(void) {
hotp_key_t* hotp_key = (hotp_key_t*) value;

// Check if we read what looks like a valid key.
if (ret != RETURNCODE_SUCCESS || value_len != sizeof(hotp_key_t) || hotp_key->magic != 0xdeadbeef) {
keys[i].magic = 0xdeadbeef;
if (ret != RETURNCODE_SUCCESS || value_len != sizeof(hotp_key_t)) {
keys[i].len = 0;
save_key(i);

Expand Down

0 comments on commit a284254

Please sign in to comment.