Skip to content

Commit

Permalink
testing release
Browse files Browse the repository at this point in the history
  • Loading branch information
onlykey committed Nov 4, 2022
1 parent 5495501 commit a133bea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions onlykey/okcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ void set_slot(uint8_t *buffer)
if (buffer[7] <= 10)
{
buffer[7] = 11 - buffer[7];
okeeprom_eeset_typespeed(buffer + 7, buffer[5]);
okeeprom_eeset_typespeed(buffer + 7, slot);
if (buffer[8] == 0) {
TYPESPEED[0] = buffer[7];
}
Expand Down Expand Up @@ -5385,16 +5385,17 @@ void yubikeyinit(uint8_t slot)
} else if (slot > 0 && slot < 25) {
okcore_flashget_yubiotp(ptr, slot);
okcore_aes_gcm_decrypt(temp, slot, 10, profilekey, (EElen_aeskey + EElen_private + 16));
memcpy(pubID, temp, publen);
for (int i = 15; i > 1; i--) { // Public ID 2-16 bytes
if (pubID[i]!=0) {
for (int i = 37; i > 1; i--) { // Public ID 2-16 bytes
if (temp[i]!=0) {
break;
}
publen--;
}
memcpy(pubID, temp, publen);
memcpy(privID, temp+publen, 6);
memcpy(yaeskey, temp+publen+EElen_private, EElen_aeskey);
yubikey_hex_encode(public_id, (char *)pubID, publen);
ctx.publen = publen;
}

yubikey_hex_encode(private_id, (char *)privID, 6);
Expand All @@ -5415,6 +5416,7 @@ void yubikeyinit(uint8_t slot)
counter = ctr[0] << 8 | ctr[1];
uint32_t time = 0x010203;
usage = ctx.usage;

yubikey_init1(&ctx, yaeskey, public_id, private_id, counter, time, seed);
ctx.usage = usage + 1;
#endif
Expand Down
4 changes: 2 additions & 2 deletions onlykey/onlykey.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
#ifndef ONLYKEY_H
#define ONLYKEY_H

//#define DEBUG //Enable Serial Monitor
#define DEBUG //Enable Serial Monitor
#define STD_VERSION //Define for STD edition firmare, undefine for IN TRVL edition firmware
#define OK_Color //Define for hardware with color LED
#define FACTORYKEYS // Attestation key and other keys encrypted using CHIP ID and RNG for unique keys per device
#define OKversionmaj "3"
#define OKversionmin "0"
#define OKversionpat "2"
#define OKversionpat "3"

#ifndef OKCORE_H
#include "okcore.h"
Expand Down

0 comments on commit a133bea

Please sign in to comment.