Minor stuff
This commit is contained in:
parent
796cb31ed7
commit
0b16d88756
@ -207,4 +207,4 @@ void detectAndProcessExceptionDumps(void)
|
|||||||
waitInput();
|
waitInput();
|
||||||
mcuPowerOff();
|
mcuPowerOff();
|
||||||
}
|
}
|
||||||
}
|
}
|
12
source/pin.c
12
source/pin.c
@ -56,7 +56,7 @@ void newPin(bool allowSkipping, u32 pinMode)
|
|||||||
drawCharacter('0' + length, true, 10 + 5 * SPACING_X, 10 + 2 * SPACING_Y, COLOR_WHITE);
|
drawCharacter('0' + length, true, 10 + 5 * SPACING_X, 10 + 2 * SPACING_Y, COLOR_WHITE);
|
||||||
|
|
||||||
//Pad to AES block length with zeroes
|
//Pad to AES block length with zeroes
|
||||||
u8 __attribute__((aligned(4))) enteredPassword[AES_BLOCK_SIZE] = {0};
|
__attribute__((aligned(4))) u8 enteredPassword[AES_BLOCK_SIZE] = {0};
|
||||||
|
|
||||||
u8 cnt = 0;
|
u8 cnt = 0;
|
||||||
u32 charDrawPos = 16 * SPACING_X;
|
u32 charDrawPos = 16 * SPACING_X;
|
||||||
@ -90,8 +90,8 @@ void newPin(bool allowSkipping, u32 pinMode)
|
|||||||
pin.formatVersionMajor = PIN_VERSIONMAJOR;
|
pin.formatVersionMajor = PIN_VERSIONMAJOR;
|
||||||
pin.formatVersionMinor = PIN_VERSIONMINOR;
|
pin.formatVersionMinor = PIN_VERSIONMINOR;
|
||||||
|
|
||||||
u8 __attribute__((aligned(4))) tmp[SHA_256_HASH_SIZE];
|
__attribute__((aligned(4))) u8 tmp[SHA_256_HASH_SIZE],
|
||||||
u8 __attribute__((aligned(4))) lengthBlock[AES_BLOCK_SIZE] = {0};
|
lengthBlock[AES_BLOCK_SIZE] = {0};
|
||||||
lengthBlock[0] = length;
|
lengthBlock[0] = length;
|
||||||
|
|
||||||
computePinHash(tmp, lengthBlock);
|
computePinHash(tmp, lengthBlock);
|
||||||
@ -114,8 +114,8 @@ bool verifyPin(u32 pinMode)
|
|||||||
pin.formatVersionMinor != PIN_VERSIONMINOR)
|
pin.formatVersionMinor != PIN_VERSIONMINOR)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
u8 __attribute__((aligned(4))) tmp[SHA_256_HASH_SIZE];
|
__attribute__((aligned(4))) u8 tmp[SHA_256_HASH_SIZE],
|
||||||
u8 __attribute__((aligned(4))) lengthBlock[AES_BLOCK_SIZE] = {0};
|
lengthBlock[AES_BLOCK_SIZE] = {0};
|
||||||
lengthBlock[0] = 4 + 2 * (pinMode - 1);
|
lengthBlock[0] = 4 + 2 * (pinMode - 1);
|
||||||
|
|
||||||
computePinHash(tmp, lengthBlock);
|
computePinHash(tmp, lengthBlock);
|
||||||
@ -126,7 +126,7 @@ bool verifyPin(u32 pinMode)
|
|||||||
initScreens();
|
initScreens();
|
||||||
|
|
||||||
//Pad to AES block length with zeroes
|
//Pad to AES block length with zeroes
|
||||||
u8 __attribute__((aligned(4))) enteredPassword[AES_BLOCK_SIZE] = {0};
|
__attribute__((aligned(4))) u8 enteredPassword[AES_BLOCK_SIZE] = {0};
|
||||||
|
|
||||||
bool unlock = false;
|
bool unlock = false;
|
||||||
u8 cnt = 0;
|
u8 cnt = 0;
|
||||||
|
Reference in New Issue
Block a user