@ -30,21 +30,22 @@
# include "messages.pb.h"
# include "messages.pb.h"
# include "oled.h"
# include "oled.h"
# include "pinmatrix.h"
# include "pinmatrix.h"
# include "rng.h"
# include "usb.h"
# include "usb.h"
# include "util.h"
# include "util.h"
# include "rng.h"
# define MAX_WRONG_PINS 15
# define MAX_WRONG_PINS 15
# define BACKSPACE '\x08'
# define BACKSPACE '\x08'
# define SPACE '\x09'
# define SPACE '\x09'
# define DONE '\x06'
# define DONE '\x06'
# define INPUT_DONE -1
# define INPUT_DONE -1
# define NUM_PASSPHRASE_LINES 3
# define NUM_PASSPHRASE_LINES 3
# define CHAR_AND_SPACE_WIDTH (5 + 1)
# define CHAR_AND_SPACE_WIDTH (5 + 1)
# define PASSPHRASE_WIDTH (MAX_PASSPHRASE_LEN / NUM_PASSPHRASE_LINES * CHAR_AND_SPACE_WIDTH)
# define PASSPHRASE_WIDTH \
( MAX_PASSPHRASE_LEN / NUM_PASSPHRASE_LINES * CHAR_AND_SPACE_WIDTH )
# define LAST_PASSPHRASE_INDEX (MAX_PASSPHRASE_LEN - 1)
# define LAST_PASSPHRASE_INDEX (MAX_PASSPHRASE_LEN - 1)
@ -54,125 +55,100 @@
bool protectAbortedByCancel = false ;
bool protectAbortedByCancel = false ;
bool protectAbortedByInitialize = false ;
bool protectAbortedByInitialize = false ;
void buttonCheckRepeat ( bool * yes , bool * no , bool * confirm )
void buttonCheckRepeat ( bool * yes , bool * no , bool * confirm ) {
{
* yes = false ;
* yes = false ;
* no = false ;
* no = false ;
* confirm = false ;
* confirm = false ;
const int Threshold0 = 20 ;
const int Threshold0 = 20 ;
const int Thresholds [ ] = { Threshold0 , 80 , 20 , 18 , 16 , 14 , 12 , 10 , 8 , 6 , 4 } ;
const int Thresholds [ ] = { Threshold0 , 80 , 20 , 18 , 16 , 14 , 12 , 10 , 8 , 6 , 4 } ;
const int MaxThresholdLevel = sizeof ( Thresholds ) / sizeof ( Thresholds [ 0 ] ) - 1 ;
const int MaxThresholdLevel = sizeof ( Thresholds ) / sizeof ( Thresholds [ 0 ] ) - 1 ;
static int yesthreshold = Threshold0 ;
static int yesthreshold = Threshold0 ;
static int nothreshold = Threshold0 ;
static int nothreshold = Threshold0 ;
static int yeslevel = 0 ;
static int yeslevel = 0 ;
static int nolevel = 0 ;
static int nolevel = 0 ;
static bool both = false ;
static bool both = false ;
usbSleep ( 5 ) ;
usbSleep ( 5 ) ;
buttonUpdate ( ) ;
buttonUpdate ( ) ;
if ( both ) {
if ( both )
if ( ! button . YesDown & & ! button . NoDown ) {
{
both = false ;
if ( ! button . YesDown & & ! button . NoDown )
yeslevel = 0 ;
{
nolevel = 0 ;
both = false ;
yesthreshold = Thresholds [ 0 ] ;
yeslevel = 0 ;
nothreshold = Thresholds [ 0 ] ;
nolevel = 0 ;
}
yesthreshold = Thresholds [ 0 ] ;
} else if ( ( button . YesDown & & button . NoDown ) | |
nothreshold = Thresholds [ 0 ] ;
( button . YesUp & & button . NoDown ) | |
}
( button . YesDown & & button . NoUp ) | | ( button . YesUp & & button . NoUp ) ) {
}
if ( ! yeslevel & & ! nolevel ) {
else if ( ( button . YesDown & & button . NoDown )
both = true ;
| | ( button . YesUp & & button . NoDown )
* confirm = true ;
| | ( button . YesDown & & button . NoUp )
}
| | ( button . YesUp & & button . NoUp ) )
} else {
{
if ( button . YesUp ) {
if ( ! yeslevel & & ! nolevel )
if ( ! yeslevel ) * yes = true ;
{
yeslevel = 0 ;
both = true ;
yesthreshold = Thresholds [ 0 ] ;
* confirm = true ;
} else if ( button . YesDown > = yesthreshold ) {
}
if ( yeslevel < MaxThresholdLevel ) yeslevel + + ;
}
yesthreshold + = Thresholds [ yeslevel ] ;
else
* yes = true ;
{
}
if ( button . YesUp )
if ( button . NoUp ) {
{
if ( ! nolevel ) * no = true ;
if ( ! yeslevel )
nolevel = 0 ;
* yes = true ;
nothreshold = Thresholds [ 0 ] ;
yeslevel = 0 ;
} else if ( button . NoDown > = nothreshold ) {
yesthreshold = Thresholds [ 0 ] ;
if ( nolevel < MaxThresholdLevel ) nolevel + + ;
}
nothreshold + = Thresholds [ nolevel ] ;
else if ( button . YesDown > = yesthreshold )
* no = true ;
{
}
if ( yeslevel < MaxThresholdLevel )
}
yeslevel + + ;
yesthreshold + = Thresholds [ yeslevel ] ;
* yes = true ;
}
if ( button . NoUp )
{
if ( ! nolevel )
* no = true ;
nolevel = 0 ;
nothreshold = Thresholds [ 0 ] ;
}
else if ( button . NoDown > = nothreshold )
{
if ( nolevel < MaxThresholdLevel )
nolevel + + ;
nothreshold + = Thresholds [ nolevel ] ;
* no = true ;
}
}
}
}
void buttonWaitForYesUp ( void )
void buttonWaitForYesUp ( void ) {
{
buttonUpdate ( ) ;
buttonUpdate ( ) ;
for ( ; ; ) {
for ( ; ; )
usbSleep ( 5 ) ;
{
buttonUpdate ( ) ;
usbSleep ( 5 ) ;
if ( button . YesUp ) break ;
buttonUpdate ( ) ;
}
if ( button . YesUp )
break ;
}
}
}
void buttonWaitForIdle ( void )
void buttonWaitForIdle ( void ) {
{
buttonUpdate ( ) ;
buttonUpdate ( ) ;
for ( ; ; ) {
for ( ; ; )
usbSleep ( 5 ) ;
{
buttonUpdate ( ) ;
usbSleep ( 5 ) ;
if ( ! button . YesDown & & ! button . YesUp & & ! button . NoDown & & ! button . NoUp )
buttonUpdate ( ) ;
break ;
if ( ! button . YesDown & & ! button . YesUp & & ! button . NoDown & & ! button . NoUp )
}
break ;
}
}
}
void requestOnDeviceTextInput ( void )
void requestOnDeviceTextInput ( void ) {
{
layoutDialog ( & bmp_icon_question , _ ( " Cancel " ) , _ ( " Confirm " ) , NULL ,
layoutDialog ( & bmp_icon_question , _ ( " Cancel " ) , _ ( " Confirm " ) , NULL , _ ( " Do you like to use " ) , _ ( " on-device text input? " ) , NULL , NULL , NULL , NULL ) ;
_ ( " Do you like to use " ) , _ ( " on-device text input? " ) , NULL , NULL ,
NULL , NULL ) ;
buttonUpdate ( ) ;
buttonUpdate ( ) ;
for ( ; ; )
for ( ; ; ) {
{
usbSleep ( 5 ) ;
usbSleep ( 5 ) ;
buttonUpdate ( ) ;
buttonUpdate ( ) ;
if ( button . YesUp | | button . NoUp ) break ;
if ( button . YesUp | | button . NoUp )
}
break ;
}
layoutSwipe ( ) ;
layoutSwipe ( ) ;
session_setUseOnDeviceTextInput ( button . YesUp ) ;
session_setUseOnDeviceTextInput ( button . YesUp ) ;
}
}
bool protectButton ( ButtonRequestType type , bool confirm_only ) {
bool protectButton ( ButtonRequestType type , bool confirm_only ) {
@ -450,209 +426,197 @@ bool protectPassphraseComputer(void) {
return result ;
return result ;
}
}
int inputPassphraseScroll ( char * passphrase , int * passphrasecharindex , const char entries [ ] , int entryindex , int numtotal , int numscreen , int padding , const int groups [ ] , int numgroup , int skip , int * caret )
int inputPassphraseScroll ( char * passphrase , int * passphrasecharindex ,
{
const char entries [ ] , int entryindex , int numtotal ,
for ( ; ; * caret = ( * caret + 1 ) % CARET_CYCLE )
int numscreen , int padding , const int groups [ ] ,
{
int numgroup , int skip , int * caret ) {
bool yes , no , confirm ;
for ( ; ; * caret = ( * caret + 1 ) % CARET_CYCLE ) {
buttonCheckRepeat ( & yes , & no , & confirm ) ;
bool yes , no , confirm ;
buttonCheckRepeat ( & yes , & no , & confirm ) ;
if ( confirm )
{
if ( confirm ) {
buttonWaitForIdle ( ) ;
buttonWaitForIdle ( ) ;
if ( entries [ entryindex ] = = BACKSPACE )
if ( entries [ entryindex ] = = BACKSPACE ) {
{
if ( * passphrasecharindex > 0 ) {
if ( * passphrasecharindex > 0 )
- - ( * passphrasecharindex ) ;
{
passphrase [ * passphrasecharindex ] = 0 ;
- - ( * passphrasecharindex ) ;
}
passphrase [ * passphrasecharindex ] = 0 ;
} else if ( entries [ entryindex ] = = DONE ) {
}
return INPUT_DONE ;
}
} else {
else if ( entries [ entryindex ] = = DONE )
if ( * passphrasecharindex < LAST_PASSPHRASE_INDEX ) {
{
passphrase [ * passphrasecharindex ] = entries [ entryindex ] ;
return INPUT_DONE ;
+ + ( * passphrasecharindex ) ;
}
}
else
return entryindex ;
{
}
if ( * passphrasecharindex < LAST_PASSPHRASE_INDEX )
{
entryindex = random32 ( ) % numtotal ;
passphrase [ * passphrasecharindex ] = entries [ entryindex ] ;
} else {
+ + ( * passphrasecharindex ) ;
if ( yes ) entryindex = ( entryindex + 1 ) % numtotal ;
}
if ( no ) entryindex = ( entryindex - 1 + numtotal ) % numtotal ;
return entryindex ;
}
}
layoutScrollInput ( passphrase , PASSPHRASE_WIDTH , numtotal , numscreen ,
entryindex = random32 ( ) % numtotal ;
entryindex , entries , padding , numgroup , groups , skip ,
}
* caret < CARET_SHOW ) ;
else
}
{
if ( yes )
entryindex = ( entryindex + 1 ) % numtotal ;
if ( no )
entryindex = ( entryindex - 1 + numtotal ) % numtotal ;
}
layoutScrollInput ( passphrase , PASSPHRASE_WIDTH , numtotal , numscreen , entryindex , entries , padding , numgroup , groups , skip , * caret < CARET_SHOW ) ;
}
}
}
int findCharIndex ( const char entries [ ] , char needle , int numtotal , int startindex , bool forward )
int findCharIndex ( const char entries [ ] , char needle , int numtotal ,
{
int startindex , bool forward ) {
int index = startindex ;
int index = startindex ;
int step = forward ? 1 : - 1 ;
int step = forward ? 1 : - 1 ;
while ( index > = 0 & & index < numtotal )
while ( index > = 0 & & index < numtotal ) {
{
if ( entries [ index ] = = needle ) return index ;
if ( entries [ index ] = = needle )
index + = step ;
return index ;
}
index + = step ;
return startindex ;
}
return startindex ;
}
}
void inputPassphrase ( char * passphrase )
void inputPassphrase ( char * passphrase ) {
{
const char Entries [ ] = {
const char Entries [ ] = {
' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' ,
' a ' , ' b ' , ' c ' , ' d ' , ' e ' , ' f ' , ' g ' , ' h ' , ' i ' , BACKSPACE , DONE ,
' h ' , ' i ' , BACKSPACE , DONE , ' j ' , ' k ' , ' l ' ,
' j ' , ' k ' , ' l ' , ' m ' , ' n ' , ' o ' , ' p ' , ' q ' , ' r ' , BACKSPACE , DONE ,
' m ' , ' n ' , ' o ' , ' p ' , ' q ' , ' r ' , BACKSPACE ,
' s ' , ' t ' , ' u ' , ' v ' , ' w ' , ' x ' , ' y ' , ' z ' , SPACE , BACKSPACE , DONE ,
DONE , ' s ' , ' t ' , ' u ' , ' v ' , ' w ' , ' x ' ,
' A ' , ' B ' , ' C ' , ' D ' , ' E ' , ' F ' , ' G ' , ' H ' , ' I ' , BACKSPACE , DONE ,
' y ' , ' z ' , SPACE , BACKSPACE , DONE , ' A ' , ' B ' ,
' J ' , ' K ' , ' L ' , ' M ' , ' N ' , ' O ' , ' P ' , ' Q ' , ' R ' , BACKSPACE , DONE ,
' C ' , ' D ' , ' E ' , ' F ' , ' G ' , ' H ' , ' I ' ,
' S ' , ' T ' , ' U ' , ' V ' , ' W ' , ' X ' , ' Y ' , ' Z ' , SPACE , BACKSPACE , DONE ,
BACKSPACE , DONE , ' J ' , ' K ' , ' L ' , ' M ' , ' N ' ,
' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' , ' 0 ' , BACKSPACE , DONE ,
' O ' , ' P ' , ' Q ' , ' R ' , BACKSPACE , DONE , ' S ' ,
' ! ' , ' @ ' , ' # ' , ' $ ' , ' \x25 ' , ' ^ ' , ' & ' , ' * ' , ' ( ' , ' ) ' , BACKSPACE , DONE ,
' T ' , ' U ' , ' V ' , ' W ' , ' X ' , ' Y ' , ' Z ' ,
' ` ' , ' - ' , ' = ' , ' [ ' , ' ] ' , ' \\ ' , ' ; ' , ' \' ' , ' , ' , ' . ' , ' / ' , BACKSPACE , DONE ,
SPACE , BACKSPACE , DONE , ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' ,
' ~ ' , ' _ ' , ' + ' , ' { ' , ' } ' , ' | ' , ' : ' , ' \' ' , ' < ' , ' > ' , ' ? ' , BACKSPACE , DONE
' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , ' 9 ' , ' 0 ' , BACKSPACE ,
} ;
DONE , ' ! ' , ' @ ' , ' # ' , ' $ ' , ' \x25 ' , ' ^ ' ,
const int EntriesGroups [ ] = { 0 , 11 , 22 , 33 , 44 , 55 , 66 , 78 , 90 , 103 , 116 } ;
' & ' , ' * ' , ' ( ' , ' ) ' , BACKSPACE , DONE , ' ` ' ,
' - ' , ' = ' , ' [ ' , ' ] ' , ' \\ ' , ' ; ' , ' \' ' ,
int numentries = sizeof ( Entries ) / sizeof ( Entries [ 0 ] ) ;
' , ' , ' . ' , ' / ' , BACKSPACE , DONE , ' ~ ' , ' _ ' ,
int numentriesgroups = sizeof ( EntriesGroups ) / sizeof ( EntriesGroups [ 0 ] ) ;
' + ' , ' { ' , ' } ' , ' | ' , ' : ' , ' \' ' , ' < ' ,
' > ' , ' ? ' , BACKSPACE , DONE } ;
usbSleep ( 5 ) ;
const int EntriesGroups [ ] = { 0 , 11 , 22 , 33 , 44 , 55 , 66 , 78 , 90 , 103 , 116 } ;
buttonUpdate ( ) ;
int numentries = sizeof ( Entries ) / sizeof ( Entries [ 0 ] ) ;
int passphrasecharindex = strlen ( passphrase ) ;
int numentriesgroups = sizeof ( EntriesGroups ) / sizeof ( EntriesGroups [ 0 ] ) ;
int caret = 0 ;
usbSleep ( 5 ) ;
for ( ; ; )
buttonUpdate ( ) ;
{
int entryindex = random32 ( ) % numentries ;
int passphrasecharindex = strlen ( passphrase ) ;
if ( passphrasecharindex > = LAST_PASSPHRASE_INDEX )
int caret = 0 ;
entryindex = findCharIndex ( Entries , DONE , numentries , entryindex , entryindex < numentries / 2 ) ;
entryindex = inputPassphraseScroll ( passphrase , & passphrasecharindex , Entries , entryindex , numentries , 9 , 9 , EntriesGroups , numentriesgroups , 2 , & caret ) ;
for ( ; ; ) {
if ( entryindex = = INPUT_DONE )
int entryindex = random32 ( ) % numentries ;
return ;
if ( passphrasecharindex > = LAST_PASSPHRASE_INDEX )
}
entryindex = findCharIndex ( Entries , DONE , numentries , entryindex ,
entryindex < numentries / 2 ) ;
entryindex = inputPassphraseScroll (
passphrase , & passphrasecharindex , Entries , entryindex , numentries , 9 , 9 ,
EntriesGroups , numentriesgroups , 2 , & caret ) ;
if ( entryindex = = INPUT_DONE ) return ;
}
}
}
bool checkPassphrase ( const char * passphrase , bool enable_edit , bool enable_done )
bool checkPassphrase ( const char * passphrase , bool enable_edit ,
{
bool enable_done ) {
layoutCheckPassphrase ( passphrase , PASSPHRASE_WIDTH , enable_edit , enable_done ) ;
layoutCheckPassphrase ( passphrase , PASSPHRASE_WIDTH , enable_edit , enable_done ) ;
buttonUpdate ( ) ;
buttonUpdate ( ) ;
for ( ; ; )
for ( ; ; ) {
{
usbSleep ( 5 ) ;
usbSleep ( 5 ) ;
buttonUpdate ( ) ;
buttonUpdate ( ) ;
if ( enable_done & & button . YesUp ) return true ;
if ( enable_done & & button . YesUp )
if ( enable_edit & & button . NoUp ) return false ;
return true ;
}
if ( enable_edit & & button . NoUp )
return false ;
}
}
}
bool protectPassphraseDevice ( void )
bool protectPassphraseDevice ( void ) {
{
static char CONFIDENTIAL passphrase [ MAX_PASSPHRASE_LEN ] ;
static char CONFIDENTIAL passphrase [ MAX_PASSPHRASE_LEN ] ;
memzero ( passphrase , sizeof ( passphrase ) ) ;
buttonUpdate ( ) ;
memzero ( passphrase , sizeof ( passphrase ) ) ;
layoutDialog ( NULL , NULL , _ ( " Next " ) , NULL , _ ( " You are about to enter " ) ,
buttonUpdate ( ) ;
_ ( " the passphrase. " ) , _ ( " Select how many times " ) ,
_ ( " you'd like to do it. " ) , NULL , NULL ) ;
buttonWaitForYesUp ( ) ;
layoutSwipe ( ) ;
layoutDialog ( NULL , NULL , _ ( " Next " ) , NULL , _ ( " You are about to enter " ) , _ ( " the passphrase. " ) , _ ( " Select how many times " ) , _ ( " you'd like to do it. " ) , NULL , NULL ) ;
layoutDialog ( NULL , _ ( " Twice " ) , _ ( " Once " ) , NULL ,
buttonWaitForYesUp ( ) ;
_ ( " If you are creating a new " ) , _ ( " wallet, it is advised " ) ,
layoutSwipe ( ) ;
_ ( " that you select Twice. " ) , NULL , NULL , NULL ) ;
for ( ; ; ) {
usbSleep ( 5 ) ;
buttonUpdate ( ) ;
if ( button . YesUp | | button . NoUp ) break ;
}
layoutSwipe ( ) ;
layoutDialog ( NULL , _ ( " Twice " ) , _ ( " Once " ) , NULL , _ ( " If you are creating a new " ) , _ ( " wallet, it is advised " ) , _ ( " that you select Twice. " ) , NULL , NULL , NULL ) ;
bool twice = button . NoUp ;
for ( ; ; )
{
usbSleep ( 5 ) ;
buttonUpdate ( ) ;
if ( button . YesUp | | button . NoUp )
break ;
}
layoutSwipe ( ) ;
bool twice = button . NoUp ;
layoutDialog ( NULL , NULL , _ ( " Next " ) , NULL , _ ( " Enter the passphrase " ) ,
_ ( " on the next screen. " ) , _ ( " - Single button: scroll. " ) ,
_ ( " - Hold: auto-scroll. " ) , _ ( " - Both buttons: confirm. " ) , NULL ) ;
buttonWaitForYesUp ( ) ;
layoutSwipe ( ) ;
layoutDialog ( NULL , NULL , _ ( " Next " ) , NULL , _ ( " Enter the passphrase " ) , _ ( " on the next screen. " ) , _ ( " - Single button: scroll. " ) , _ ( " - Hold: auto-scroll. " ) , _ ( " - Both buttons: confirm. " ) , NULL ) ;
for ( ; ; ) {
buttonWaitForYesUp ( ) ;
inputPassphrase ( passphrase ) ;
layoutSwipe ( ) ;
for ( ; ; )
if ( checkPassphrase ( passphrase , true , true ) ) break ;
{
inputPassphrase ( passphrase ) ;
if ( checkPassphrase ( passphrase , true , true ) )
oledSwipeRight ( ) ;
break ;
}
oledSwipeRight ( ) ;
if ( twice ) {
}
static char CONFIDENTIAL passphrase2 [ MAX_PASSPHRASE_LEN ] ;
if ( twice )
memzero ( passphrase2 , sizeof ( passphrase2 ) ) ;
{
static char CONFIDENTIAL passphrase2 [ MAX_PASSPHRASE_LEN ] ;
memzero ( passphrase2 , sizeof ( passphrase2 ) ) ;
layoutSwipe ( ) ;
layoutDialog ( NULL , NULL , _ ( " Next " ) , NULL , _ ( " Re-enter the passphrase. " ) ,
NULL , NULL , NULL , NULL , NULL ) ;
buttonWaitForYesUp ( ) ;
layoutSwipe ( ) ;
layoutSwipe ( ) ;
for ( ; ; ) {
layoutDialog ( NULL , NULL , _ ( " Next " ) , NULL , _ ( " Re-enter the passphrase. " ) , NULL , NULL , NULL , NULL , NULL ) ;
inputPassphrase ( passphrase2 ) ;
buttonWaitForYesUp ( ) ;
layoutSwipe ( ) ;
for ( ; ; )
if ( strcmp ( passphrase , passphrase2 ) = = 0 ) break ;
{
inputPassphrase ( passphrase2 ) ;
if ( strcmp ( passphrase , passphrase2 ) = = 0 )
checkPassphrase ( passphrase2 , true , false ) ;
break ;
oledSwipeRight ( ) ;
}
checkPassphrase ( passphrase2 , true , false ) ;
memzero ( passphrase2 , sizeof ( passphrase2 ) ) ;
oledSwipeRight ( ) ;
}
}
memzero ( passphrase2 , sizeof ( passphrase2 ) ) ;
checkPassphrase ( passphrase , false , true ) ;
}
checkPassphrase ( passphrase , false , true ) ;
for ( int i = 0 ; i < MAX_PASSPHRASE_LEN & & passphrase [ i ] ; + + i )
if ( passphrase [ i ] = = SPACE ) passphrase [ i ] = ' ' ;
for ( int i = 0 ; i < MAX_PASSPHRASE_LEN & & passphrase [ i ] ; + + i )
session_cachePassphrase ( passphrase ) ;
if ( passphrase [ i ] = = SPACE )
memzero ( passphrase , sizeof ( passphrase ) ) ;
passphrase [ i ] = ' ' ;
session_cachePassphrase ( passphrase ) ;
memzero ( passphrase , sizeof ( passphrase ) ) ;
layoutHome ( ) ;
layoutHome ( ) ;
return true ;
return true ;
}
}
bool protectPassphrase ( void )
bool protectPassphrase ( void ) {
{
bool passphrase_protection = false ;
bool passphrase_protection = false ;
config_getPassphraseProtection ( & passphrase_protection ) ;
config_getPassphraseProtection ( & passphrase_protection ) ;
if ( ! passphrase_protection | | session_isPassphraseCached ( ) ) {
if ( ! passphrase_protection | | session_isPassphraseCached ( ) ) {
return true ;
return true ;
}
}
bool result ;
bool result ;
if ( ! session_isUseOnDeviceTextInputCached ( ) ) requestOnDeviceTextInput ( ) ;
if ( ! session_isUseOnDeviceTextInputCached ( ) )
if ( session_isUseOnDeviceTextInput ( ) )
requestOnDeviceTextInput ( ) ;
result = protectPassphraseDevice ( ) ;
if ( session_isUseOnDeviceTextInput ( ) )
else
result = protectPassphraseDevice ( ) ;
result = protectPassphraseComputer ( ) ;
else
return result ;
result = protectPassphraseComputer ( ) ;
return result ;
}
}