From 8fb6e77a618ce1a8151fab27445e0c3cc0241134 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 5 Dec 2015 11:13:46 +0100 Subject: beginning of issue #2 on github MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- info/libpassphrase.texinfo | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'info') diff --git a/info/libpassphrase.texinfo b/info/libpassphrase.texinfo index d55d12d..32f19c3 100644 --- a/info/libpassphrase.texinfo +++ b/info/libpassphrase.texinfo @@ -194,6 +194,7 @@ and is equivalent to @code{passphrase_reenable_echo1(STDIN_FILENO)}. @item void passphrase_wipe(char*, size_t) +@itemx void passphrase_wipe1(char*) When you are done using passhprase you should erase it from the memory before freeing its allocation. To do this securtly, call @@ -201,6 +202,9 @@ allocation. To do this securtly, call as the first argument and the length of the passphrase as the second argument. +@code{passphrase_wipe1} will determine the +length of the passphrase by itself. + @end table These three functions could be made into one @@ -218,7 +222,6 @@ been disabled. #include /* For libpassphrase */ #include /* For output */ #include /* For free */ -#include /* For strlen */ #include /* For open, O_RDONLY */ #include /* For close */ @@ -257,7 +260,7 @@ int main(int argc, char** argv) printf("You entered: %s\n", passphrase); /* Wipe and free the passphrase */ - passphrase_wipe(passphrase, strlen(passphrase)); + passphrase_wipe1(passphrase); free(passphrase); /* Stop hiding user input */ @@ -389,6 +392,31 @@ This options is not really needed, but not using it means that you can get warnings in @command{valgrind}. +@item @code{PASSPHRASE_METER} +When the @code{PASSPHRASE_READ_METER} flag +is used, and @code{PASSPHRASE_READ_SCREEN_FREE} +or @code{PASSPHRASE_READ_BELOW_FREE}, use +@command{passcheck} to evaluate the strenght +of the passphrase and display a passphrase +strenght meter. @command{passcheck} will be +started by the real user, not the effective +user, and the real group. + +It possibly to select another program than +@command{passcheck} by specifying it setting +the environment variable @env{LIBPASSPHRASE_METER}. +@env{LIBPASSPHRASE_METER} will be treated as +one argument. The selected program must behave +similar to @command{passcheck}: for each line +to stdin, it must print a non-negative int +integer, optinally coloured with one signal +escape sequence, followed by a new line or +whitespace; the rest of the is ignored. The +program must also accept the flag @code{-r}, +telling it not to discard any input. + + + @end table -- cgit v1.2.3-70-g09d2