From 6fd9cd22469bf3f525a7fa15acca00edf5330554 Mon Sep 17 00:00:00 2001 From: Connor E <38229097+c-edw@users.noreply.github.com> Date: Sun, 27 Jan 2019 18:12:54 +0000 Subject: [PATCH] Sleep on incorrect password with shadow backend. --- shadow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shadow.c b/shadow.c index 70d00a8..76dd7ae 100644 --- a/shadow.c +++ b/shadow.c @@ -92,8 +92,12 @@ void run_pw_backend_child(void) { exit(EXIT_FAILURE); } + // We don't want to keep it in memory longer than necessary, + // so clear *before* sleeping. clear_buffer(buf, size); free(buf); + + sleep(2); } clear_buffer(encpw, strlen(encpw));