mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Fix accessing way to data.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
7195a8f3ec
commit
c01940b62b
1 changed files with 4 additions and 2 deletions
|
|
@ -18,7 +18,9 @@
|
|||
#include <string.h>
|
||||
#include "common.h"
|
||||
#include "stdlib.h"
|
||||
#ifndef ENABLE_EMULATION
|
||||
#include "pico/stdlib.h"
|
||||
#endif
|
||||
#include "kek.h"
|
||||
#include "crypto_utils.h"
|
||||
#include "random.h"
|
||||
|
|
@ -54,14 +56,14 @@ int load_mkek(uint8_t *mkek) {
|
|||
const uint8_t *pin = NULL;
|
||||
if (pin == NULL && has_session_pin == true) {
|
||||
file_t *tf = search_by_fid(EF_MKEK, NULL, SPECIFY_EF);
|
||||
if (tf) {
|
||||
if (file_has_data(tf)) {
|
||||
memcpy(mkek, file_get_data(tf), MKEK_SIZE);
|
||||
pin = session_pin;
|
||||
}
|
||||
}
|
||||
if (pin == NULL && has_session_sopin == true) {
|
||||
file_t *tf = search_by_fid(EF_MKEK_SO, NULL, SPECIFY_EF);
|
||||
if (tf) {
|
||||
if (file_has_data(tf)) {
|
||||
memcpy(mkek, file_get_data(tf), MKEK_SIZE);
|
||||
pin = session_sopin;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue