parent
0b41ed04d5
commit
4f54596658
27
source/pin.c
27
source/pin.c
@ -146,21 +146,32 @@ bool verifyPin(u32 pinMode)
|
|||||||
|
|
||||||
initScreens();
|
initScreens();
|
||||||
|
|
||||||
|
swapFramebuffers(true);
|
||||||
|
|
||||||
drawString(true, 10, 10, COLOR_TITLE, "Enter the PIN using ABXY and the DPad to proceed");
|
drawString(true, 10, 10, COLOR_TITLE, "Enter the PIN using ABXY and the DPad to proceed");
|
||||||
drawString(true, 10, 10 + SPACING_Y, COLOR_TITLE, "Press START to shutdown, SELECT to clear");
|
drawString(true, 10, 10 + SPACING_Y, COLOR_TITLE, "Press START to shutdown, SELECT to clear");
|
||||||
|
|
||||||
drawFormattedString(true, 10, 10 + 3 * SPACING_Y, COLOR_WHITE, "PIN (%u digits): ", lengthBlock[0]);
|
drawFormattedString(true, 10, 10 + 3 * SPACING_Y, COLOR_WHITE, "PIN (%u digits): ", lengthBlock[0]);
|
||||||
|
|
||||||
static const char *messageFile = "pinmessage.txt";
|
bool isBottomSplashValid = getFileSize("splashpin.bin") == SCREEN_BOTTOM_FBSIZE;
|
||||||
char message[801];
|
if(isBottomSplashValid)
|
||||||
|
|
||||||
u32 messageSize = fileRead(message, messageFile, sizeof(message) - 1);
|
|
||||||
|
|
||||||
if(messageSize != 0)
|
|
||||||
{
|
{
|
||||||
message[messageSize] = 0;
|
isBottomSplashValid = fileRead(fbs[0].bottom, "splashpin.bin", SCREEN_BOTTOM_FBSIZE) == SCREEN_BOTTOM_FBSIZE;
|
||||||
drawString(false, 10, 10, COLOR_WHITE, message);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static const char *messageFile = "pinmessage.txt";
|
||||||
|
char message[801];
|
||||||
|
|
||||||
|
u32 messageSize = fileRead(message, messageFile, sizeof(message) - 1);
|
||||||
|
|
||||||
|
if(messageSize != 0)
|
||||||
|
{
|
||||||
|
message[messageSize] = 0;
|
||||||
|
drawString(false, 10, 10, COLOR_WHITE, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
swapFramebuffers(false);
|
||||||
|
|
||||||
//Pad to AES block length with zeroes
|
//Pad to AES block length with zeroes
|
||||||
__attribute__((aligned(4))) u8 enteredPassword[AES_BLOCK_SIZE] = {0};
|
__attribute__((aligned(4))) u8 enteredPassword[AES_BLOCK_SIZE] = {0};
|
||||||
|
Reference in New Issue
Block a user