OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Password.c File Reference
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/OcCryptoLib.h>
#include <Library/OcMiscLib.h>
#include <Library/ResetSystemLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include "../OpenCanopy.h"
#include "../GuiApp.h"
#include "../GuiIo.h"
#include "BootPicker.h"
#include "Common.h"

Go to the source code of this file.

Data Structures

struct  GUI_PASSWORD_INFO
 
struct  GUI_PASSWORD_BOX
 

Macros

#define PASSWORD_FIRST_DOT_SPACE   11U
 
#define PASSWORD_LAST_DOT_SPACE   9U
 
#define PASSWORD_INTER_DOT_SPACE   5U
 
#define PASSWORD_ENTER_INTERNAL_OFFSET   25U
 
#define PASSWORD_BOX_SPACE   30U
 

Functions

STATIC VOID InternalInitPasswordIncorrectInterpol (IN CONST GUI_DRAWING_CONTEXT *DrawContext, IN UINT64 StartTime)
 
BOOLEAN InternalPasswordAnimateIncorrect (IN BOOT_PICKER_GUI_CONTEXT *Context, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN UINT64 CurrentTime)
 
STATIC VOID InternalQueueIncorrectPassword (OUT GUI_DRAWING_CONTEXT *DrawContext)
 
STATIC VOID InternalRedrawPaswordBox (VOID)
 
BOOLEAN InternalConfirmPassword (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN CONST BOOT_PICKER_GUI_CONTEXT *Context)
 
STATIC VOID InternalRequestPasswordConfirmation (IN OUT GUI_DRAWING_CONTEXT *DrawContext)
 
VOID InternalPasswordBoxKeyEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
 
VOID InternalPasswordBoxFocus (IN CONST GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOLEAN Focus)
 
VOID InternalPasswordViewKeyEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
 
GUI_OBJInternalPasswordViewPtrEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
 
VOID InternalPasswordLockDraw (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
 
VOID InternalPasswordBoxDraw (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
 
GUI_OBJInternalPasswordEnterPtrEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
 
BOOLEAN InternalPasswordExitLoop (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context)
 
BOOLEAN InternalPasswordAnimateIntro (IN BOOT_PICKER_GUI_CONTEXT *Context, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN UINT64 CurrentTime)
 
EFI_STATUS PasswordViewInitialize (OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext)
 
VOID PasswordViewDeinitialize (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN OUT BOOT_PICKER_GUI_CONTEXT *GuiContext)
 

Variables

GUI_KEY_CONTEXTmKeyContext
 
GUI_PASSWORD_BOX mPasswordBox
 
GUI_OBJ_CLICKABLE mPasswordEnter
 
GUI_OBJ_CHILD mPasswordLock
 
GUI_OBJ_CHILD mPasswordBoxContainer
 
GUI_POINTER_CONTEXTmPointerContext
 
STATIC GUI_INTERPOLATION mPasswordIncorrectInterpol
 
STATIC GUI_OBJmPasswordFocusList []
 
STATIC GUI_OBJmPasswordFocusListReversed []
 
STATIC GUI_OBJmPasswordFocusListMinimal []
 
STATIC UINT8 mPasswordNumTries = 0
 
STATIC GUI_OBJ_CHILDmPasswordViewChildren []
 
STATIC GUI_OBJ_CHILDmPasswordViewChildrenMinimal []
 
STATIC GUI_VIEW_CONTEXT mPasswordViewContext
 
STATIC GUI_VIEW_CONTEXT mPasswordViewContextReversed
 
STATIC GUI_VIEW_CONTEXT mPasswordViewContextMinimal
 
STATIC GUI_OBJ_CHILDmPasswordBoxContainerChildren []
 
STATIC GUI_ANIMATION mPasswordIntroAnimation
 

Macro Definition Documentation

◆ PASSWORD_BOX_SPACE

#define PASSWORD_BOX_SPACE   30U

Definition at line 31 of file Password.c.

◆ PASSWORD_ENTER_INTERNAL_OFFSET

#define PASSWORD_ENTER_INTERNAL_OFFSET   25U

Definition at line 27 of file Password.c.

◆ PASSWORD_FIRST_DOT_SPACE

#define PASSWORD_FIRST_DOT_SPACE   11U

Definition at line 17 of file Password.c.

◆ PASSWORD_INTER_DOT_SPACE

#define PASSWORD_INTER_DOT_SPACE   5U

Definition at line 23 of file Password.c.

◆ PASSWORD_LAST_DOT_SPACE

#define PASSWORD_LAST_DOT_SPACE   9U

Definition at line 22 of file Password.c.

Function Documentation

◆ InternalConfirmPassword()

BOOLEAN InternalConfirmPassword ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN CONST BOOT_PICKER_GUI_CONTEXT * Context )

Definition at line 185 of file Password.c.

◆ InternalInitPasswordIncorrectInterpol()

STATIC VOID InternalInitPasswordIncorrectInterpol ( IN CONST GUI_DRAWING_CONTEXT * DrawContext,
IN UINT64 StartTime )

Definition at line 84 of file Password.c.

◆ InternalPasswordAnimateIncorrect()

BOOLEAN InternalPasswordAnimateIncorrect ( IN BOOT_PICKER_GUI_CONTEXT * Context,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN UINT64 CurrentTime )

Definition at line 94 of file Password.c.

◆ InternalPasswordAnimateIntro()

BOOLEAN InternalPasswordAnimateIntro ( IN BOOT_PICKER_GUI_CONTEXT * Context,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN UINT64 CurrentTime )

Definition at line 710 of file Password.c.

◆ InternalPasswordBoxDraw()

VOID InternalPasswordBoxDraw ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height,
IN UINT8 Opacity )

Definition at line 462 of file Password.c.

◆ InternalPasswordBoxFocus()

VOID InternalPasswordBoxFocus ( IN CONST GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOLEAN Focus )

Definition at line 358 of file Password.c.

◆ InternalPasswordBoxKeyEvent()

VOID InternalPasswordBoxKeyEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN CONST GUI_KEY_EVENT * KeyEvent )

Definition at line 290 of file Password.c.

◆ InternalPasswordEnterPtrEvent()

GUI_OBJ * InternalPasswordEnterPtrEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN CONST GUI_PTR_EVENT * Event )

Definition at line 519 of file Password.c.

◆ InternalPasswordExitLoop()

BOOLEAN InternalPasswordExitLoop ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context )

Definition at line 562 of file Password.c.

◆ InternalPasswordLockDraw()

VOID InternalPasswordLockDraw ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height,
IN UINT8 Opacity )

Definition at line 435 of file Password.c.

◆ InternalPasswordViewKeyEvent()

VOID InternalPasswordViewKeyEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN CONST GUI_KEY_EVENT * KeyEvent )

Definition at line 377 of file Password.c.

◆ InternalPasswordViewPtrEvent()

GUI_OBJ * InternalPasswordViewPtrEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN CONST GUI_PTR_EVENT * Event )

Definition at line 408 of file Password.c.

◆ InternalQueueIncorrectPassword()

STATIC VOID InternalQueueIncorrectPassword ( OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 154 of file Password.c.

◆ InternalRedrawPaswordBox()

STATIC VOID InternalRedrawPaswordBox ( VOID )

Definition at line 172 of file Password.c.

◆ InternalRequestPasswordConfirmation()

STATIC VOID InternalRequestPasswordConfirmation ( IN OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 273 of file Password.c.

◆ PasswordViewDeinitialize()

VOID PasswordViewDeinitialize ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN OUT BOOT_PICKER_GUI_CONTEXT * GuiContext )

Definition at line 864 of file Password.c.

◆ PasswordViewInitialize()

EFI_STATUS PasswordViewInitialize ( OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * GuiContext )

Definition at line 753 of file Password.c.

Variable Documentation

◆ mKeyContext

GUI_KEY_CONTEXT* mKeyContext
extern

Definition at line 45 of file OpenCanopy.c.

◆ mPasswordBox

GLOBAL_REMOVE_IF_UNREFERENCED GUI_PASSWORD_BOX mPasswordBox
Initial value:
= {
{
{
0, 0, 0, 0, 0xFF,
NULL,
NULL,
0,
NULL
},
},
{
{ '\0' }, 0
},
FALSE,
0
}
GUI_OBJ * GuiObjDelegatePtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition OpenCanopy.c:226
GUI_OBJ_CHILD mPasswordBoxContainer
Definition Password.c:696
VOID InternalPasswordBoxDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Password.c:462

Definition at line 654 of file Password.c.

◆ mPasswordBoxContainer

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mPasswordBoxContainer
Initial value:
= {
{
0, 0, 0, 0, 0xFF,
},
NULL
}
#define ARRAY_SIZE(Array)
Definition AppleMacEfi.h:34
VOID GuiObjDrawDelegate(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition OpenCanopy.c:137
VOID InternalPasswordBoxKeyEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Password.c:290
VOID InternalPasswordBoxFocus(IN CONST GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOLEAN Focus)
Definition Password.c:358
STATIC GUI_OBJ_CHILD * mPasswordBoxContainerChildren[]
Definition Password.c:691

Definition at line 696 of file Password.c.

◆ mPasswordBoxContainerChildren

STATIC GUI_OBJ_CHILD* mPasswordBoxContainerChildren[]
Initial value:
= {
}
GUI_OBJ_CLICKABLE mPasswordEnter
Definition Password.c:674
GUI_PASSWORD_BOX mPasswordBox
Definition Password.c:654
GUI_OBJ_CHILD Hdr
Definition Common.h:7
GUI_OBJ_CHILD Hdr
Definition Password.c:39

Definition at line 691 of file Password.c.

◆ mPasswordEnter

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mPasswordEnter
Initial value:
= {
{
{
0, 0, 0, 0, 0xFF,
NULL,
NULL,
0,
NULL
},
},
0,
0
}
VOID InternalCommonSimpleButtonDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:263
GUI_OBJ * InternalPasswordEnterPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Password.c:519

Definition at line 674 of file Password.c.

◆ mPasswordFocusList

STATIC GUI_OBJ* mPasswordFocusList[]
Initial value:
= {
}
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonShutDown
Definition Common.c:626
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonRestart
Definition Common.c:609

Definition at line 64 of file Password.c.

◆ mPasswordFocusListMinimal

STATIC GUI_OBJ* mPasswordFocusListMinimal[]
Initial value:

Definition at line 76 of file Password.c.

◆ mPasswordFocusListReversed

STATIC GUI_OBJ* mPasswordFocusListReversed[]
Initial value:

Definition at line 70 of file Password.c.

◆ mPasswordIncorrectInterpol

STATIC GUI_INTERPOLATION mPasswordIncorrectInterpol
Initial value:
= {
0,
3,
0,
0,
0
}
@ GuiInterpolTypeLinear
Definition OpenCanopy.h:348

Definition at line 55 of file Password.c.

◆ mPasswordIntroAnimation

STATIC GUI_ANIMATION mPasswordIntroAnimation
Initial value:
= {
INITIALIZE_LIST_HEAD_VARIABLE (mPasswordIntroAnimation.Link),
NULL,
}
BOOLEAN InternalPasswordAnimateIntro(IN BOOT_PICKER_GUI_CONTEXT *Context, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN UINT64 CurrentTime)
Definition Password.c:710
STATIC GUI_ANIMATION mPasswordIntroAnimation
Definition Password.c:746
LIST_ENTRY Link
Definition OpenCanopy.h:100

Definition at line 746 of file Password.c.

◆ mPasswordLock

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mPasswordLock
Initial value:
= {
{
0, 0, 0, 0, 0xFF,
NULL,
NULL,
0,
NULL
},
NULL
}
VOID InternalPasswordLockDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Password.c:435

Definition at line 641 of file Password.c.

◆ mPasswordNumTries

STATIC UINT8 mPasswordNumTries = 0

Definition at line 80 of file Password.c.

◆ mPasswordViewChildren

STATIC GUI_OBJ_CHILD* mPasswordViewChildren[]
Initial value:
= {
}
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonActionButtonsContainer
Definition Common.c:643
GUI_OBJ_CHILD mPasswordLock
Definition Password.c:641

Definition at line 594 of file Password.c.

◆ mPasswordViewChildrenMinimal

STATIC GUI_OBJ_CHILD* mPasswordViewChildrenMinimal[]
Initial value:

Definition at line 600 of file Password.c.

◆ mPasswordViewContext

STATIC GUI_VIEW_CONTEXT mPasswordViewContext
Initial value:
= {
}
VOID InternalCommonViewDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:189
CONST GUI_IMAGE * InternalGetCursorImage(IN BOOT_PICKER_GUI_CONTEXT *Context)
Definition GuiApp.c:663
GUI_OBJ * InternalPasswordViewPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Password.c:408
STATIC GUI_OBJ * mPasswordFocusList[]
Definition Password.c:64
BOOLEAN InternalPasswordExitLoop(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context)
Definition Password.c:562
VOID InternalPasswordViewKeyEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Password.c:377
STATIC GUI_OBJ_CHILD * mPasswordViewChildren[]
Definition Password.c:594

Definition at line 605 of file Password.c.

◆ mPasswordViewContextMinimal

STATIC GUI_VIEW_CONTEXT mPasswordViewContextMinimal

◆ mPasswordViewContextReversed

◆ mPointerContext

GUI_POINTER_CONTEXT* mPointerContext
extern

Definition at line 44 of file OpenCanopy.c.