Set pinentry->result
This commit is contained in:
parent
e782992eae
commit
e583cf17b1
1 changed files with 10 additions and 11 deletions
|
@ -583,7 +583,7 @@ catchsig(int sig) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static void
|
||||||
password(void) {
|
password(void) {
|
||||||
winmode = WinPin;
|
winmode = WinPin;
|
||||||
|
|
||||||
|
@ -600,27 +600,26 @@ password(void) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pinentry->repeat_okay = 1;
|
if (pinentry->canceled) {
|
||||||
|
pinentry->result = -1;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (pinentry->canceled) ? -1 : 1;
|
pinentry->result = strlen(pinentry->pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static void
|
||||||
confirm(void) {
|
confirm(void) {
|
||||||
winmode = WinConfirm;
|
winmode = WinConfirm;
|
||||||
sel = Nothing;
|
sel = Nothing;
|
||||||
|
|
||||||
run();
|
run();
|
||||||
|
pinentry->result = sel != No;
|
||||||
return sel != No;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmdhandler(pinentry_t received_pinentry) {
|
cmdhandler(pinentry_t received_pinentry) {
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
XWindowAttributes wa;
|
XWindowAttributes wa;
|
||||||
int ret;
|
|
||||||
|
|
||||||
pinentry = received_pinentry;
|
pinentry = received_pinentry;
|
||||||
|
|
||||||
|
@ -655,14 +654,14 @@ cmdhandler(pinentry_t received_pinentry) {
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
if (pinentry->pin) {
|
if (pinentry->pin) {
|
||||||
ret = password();
|
password();
|
||||||
} else {
|
} else {
|
||||||
ret = confirm();
|
confirm();
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
return ret;
|
return pinentry->result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pinentry_cmd_handler_t pinentry_cmd_handler = cmdhandler;
|
pinentry_cmd_handler_t pinentry_cmd_handler = cmdhandler;
|
||||||
|
|
Loading…
Reference in a new issue