Adding initialization.

- PINs are never stored, neither in flash nor in RAM.
- PINs are stored in flash in doubled salted way.
- PINs are stored in RAM in single salted way.
- SOPIN in RAM (single salted) is used to encrypt/decrypt DKEK.
- PINs in RAM (single salted) are used to encrypt/decrypt private keys related with user/so pins.
- DKEK is only used to export/import data.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-02-18 13:28:41 +01:00
parent 0fa7f4cd54
commit e59c0d08c4
2 changed files with 121 additions and 1 deletions

View File

@@ -44,4 +44,11 @@ extern const uint8_t sc_hsm_aid[];
extern int pin_reset_retries(const file_t *pin);
extern int pin_wrong_retry(const file_t *pin);
extern void hash(const uint8_t *input, size_t len, uint8_t output[32]);
extern void double_hash_pin(const uint8_t *pin, size_t len, uint8_t output[32]);
extern uint8_t session_pin[32], session_sopin[32];
#define IV_SIZE 16
#endif