eks: Use LOT0 for identification

This commit is contained in:
CTCaer 2020-11-15 13:43:22 +02:00
parent 32955380c7
commit 67a03bbd85
4 changed files with 7 additions and 7 deletions

View file

@ -222,7 +222,7 @@ void hos_eks_get()
// Check if valid and for this unit.
if (eks->magic == HOS_EKS_MAGIC &&
eks->sbk_low == FUSE(FUSE_PRIVATE_KEY0))
eks->lot0 == FUSE(FUSE_OPT_LOT_CODE_0))
{
h_cfg.eks = eks;
return;
@ -276,7 +276,7 @@ void hos_eks_save(u32 kb)
// Set magic and personalized info.
h_cfg.eks->magic = HOS_EKS_MAGIC;
h_cfg.eks->enabled[key_idx] = kb;
h_cfg.eks->sbk_low = FUSE(FUSE_PRIVATE_KEY0);
h_cfg.eks->lot0 = FUSE(FUSE_OPT_LOT_CODE_0);
// Copy new keys.
memcpy(h_cfg.eks->dkg, keys + 10 * 0x10, 0x10);

View file

@ -69,7 +69,7 @@ typedef struct _hos_eks_mbr_t
u8 enabled[5];
u8 enabled_bis;
u8 rsvd[2];
u32 sbk_low;
u32 lot0;
u8 dkg[0x10];
u8 dkk[0x10];
hos_eks_keys_t keys[5];

View file

@ -167,7 +167,7 @@ void hos_eks_get()
// Check if valid and for this unit.
if (eks->magic == HOS_EKS_MAGIC &&
eks->sbk_low == FUSE(FUSE_PRIVATE_KEY0))
eks->lot0 == FUSE(FUSE_OPT_LOT_CODE_0))
{
h_cfg.eks = eks;
return;
@ -221,7 +221,7 @@ void hos_eks_save(u32 kb)
// Set magic and personalized info.
h_cfg.eks->magic = HOS_EKS_MAGIC;
h_cfg.eks->enabled[key_idx] = kb;
h_cfg.eks->sbk_low = FUSE(FUSE_PRIVATE_KEY0);
h_cfg.eks->lot0 = FUSE(FUSE_OPT_LOT_CODE_0);
// Copy new keys.
memcpy(h_cfg.eks->dkg, keys + 10 * 0x10, 0x10);
@ -322,7 +322,7 @@ void hos_eks_bis_save()
// Set magic and personalized info.
h_cfg.eks->magic = HOS_EKS_MAGIC;
h_cfg.eks->enabled_bis = 1;
h_cfg.eks->sbk_low = FUSE(FUSE_PRIVATE_KEY0);
h_cfg.eks->lot0 = FUSE(FUSE_OPT_LOT_CODE_0);
// Copy new keys.
memcpy(h_cfg.eks->bis_keys[0].crypt, bis_keys + (0 * 0x10), 0x10);

View file

@ -60,7 +60,7 @@ typedef struct _hos_eks_mbr_t
u8 enabled[5];
u8 enabled_bis;
u8 rsvd[2];
u32 sbk_low;
u32 lot0;
u8 dkg[0x10];
u8 dkk[0x10];
hos_eks_keys_t keys[5];