Commit Graph

61 Commits (master)

Author SHA1 Message Date
Daniel Dumitriu da8de6a647 Remove read constraint for directories on key path
On Unix, do not check whether all directories on the path to storage_dir
are readable; in corporate environments this is often not the case.

Closes #28.
2021-05-31 09:43:52 -04:00
Christopher Wellons 32d4d99472 Properly terminate pinentry protocol (BYE)
This isn't strictly necessary on unix-like systems since it will exit
when the pipes are closed. Unfortunately Windows isn't so nice and neat
and the program will remain open indefinitely even though its inputs and
outputs have been closed. So ask pinentry to terminate gracefully.
2020-05-18 19:09:22 -04:00
Christopher Wellons 50624f2373 Add pinentry support on Windows 2020-05-18 22:43:35 +00:00
Christopher Wellons 7cc0e13f0a Allow Unicode passphrases on Windows
This change uses ReadConsoleW() to read passphrase input. It converts
the passphrase from UTF-16 to UTF-8 before further processing. With
this, passphrase input is now consistent between platforms.

Currently Windows provides no options for reading keyboard input as
UTF-8, and it's certainly not supported by any of the various CRT
implementations. This is the only way to do it.
2020-05-03 14:39:07 -04:00
Christopher Wellons f7c4b6ba55 Support binary stdin/stdout on Windows
It's now possible to pipe files over standard input and standard output
in Windows.
2020-05-03 14:32:38 -04:00
Christopher Wellons b25af46615 Add MSVC linker #pragma for advzpi32.lib
This makes compilation using Visual Studio (cl.exe) slightly simpler.
2020-05-03 14:19:30 -04:00
Zoltán Mizsei 3f1910cb0c Build fixes for Haiku 2018-07-15 19:28:06 +02:00
Christopher Wellons f01f732433 Fix number of command_names searched (fixes #18)
The "help" subcommand was removed in 6d1407b, but the number of commands
searched was not updated. With this commit it always checks the right
number of command strings.
2018-06-30 15:42:55 -04:00
Christopher Wellons a38e5e3bb9 Add new keygen option: passphrase --repeats (-r)
This option controls the number of repeated passphrase prompts when
deriving a secret key. It is convenient to set this to zero when relying
primarily on fingerprint verification. Alternatively, additional repeat
prompts may aid in memorization. The default value is 1.
2018-05-25 18:58:03 +00:00
Christopher Wellons ff83f9259e Drop use of custom integer names
Just use the C99 integer names directly and document the ones that are
needed in a comment in config.h in case it's needed when porting.
2018-04-17 22:03:05 -04:00
Christopher Wellons 274b080e12 Fix indentation typo in cleanup_closed()
Not sure how this mistake was made in the first place. Identified by a
dead code warning from Visual Studio 6.0.
2018-04-17 20:49:02 -04:00
Christopher Wellons 3b1127a644 In prompts be explicit about which passphrase it is (#5) 2018-04-06 10:51:07 -04:00
Christopher Wellons d09debe64c Add ENCHIVE_FILE_EXTENSION compile-time option (#9) 2018-01-06 14:01:58 -05:00
Christopher Wellons ed739bc3dd Don't forget to close the pinentry FILE streams 2017-12-23 22:59:51 -05:00
Christopher Wellons a407afcdaf Add support for pinentry protocol
This feature is now used by Emacs so that Emacs doesn't need to handle
the passphrase itself.
2017-12-23 22:12:46 -05:00
Christopher Wellons e9a50022c0 Remove incorrect path defaults from --help 2017-11-18 19:23:58 -05:00
Christopher Wellons 39bc92455f Completely remove random device options
This option adds needless complexity. Just hardcode /dev/urandom.
2017-10-03 19:30:40 -04:00
Christopher Wellons 9d87816841 Use strerror() when available for better errors (#7) 2017-09-27 13:23:24 -04:00
Christopher Wellons bd1100ae99 Remove trailing whitespace 2017-09-27 13:20:16 -04:00
Christopher Wellons 9c1fa33356 Print usage newline on stderr, not stdout 2017-09-09 22:10:45 -04:00
Christopher Wellons 2790ce019f Print random device instead of /dev/urandom 2017-07-24 12:25:01 -04:00
Christopher Wellons 727e89a81f Undo a comment change back to a basic comment 2017-07-24 12:24:38 -04:00
Christopher Wellons e1e857c935 Fix prototype for agent_read() 2017-07-24 12:23:55 -04:00
Christopher Wellons 9d7e161f05 Touch up function documentation comments. 2017-07-23 21:01:10 -04:00
Christopher Wellons 64471b097b Touch up the --help documentation. 2017-07-23 19:56:21 -04:00
Christopher Wellons 514dc7d4dc Free all path strings before success exit
This fixes all the valgrind complaints and properly frees all allocated
memory so long as the program exits successfully.
2017-07-22 20:01:00 -04:00
Christopher Wellons fa7228133e Use the correct output file in error message. 2017-07-22 17:18:15 -04:00
Christopher Wellons ab0ce78a00 Before mkdir(2), check if directory exists.
On Cygwin, mkdir(2) reports EACCES if the directory exists but the
system call would have failed had it not existed. This is a little odd
since EEXIST would be a much more sensible error code, but this odd
behavior seems to be permitted by POSIX. If mkdir(2) fails, but the path
exists as a directory, then continue as normal.
2017-07-11 20:35:46 -04:00
Christopher Wellons 6d1407bf1f Drop built-in help command. 2017-07-11 15:31:32 -04:00
Christopher Wellons d7a455033b Fix missing newline in keygen help. 2017-07-03 23:03:11 -04:00
Christopher Wellons 808fde4f1a Fix a couple of style typos. 2017-07-02 21:58:59 -04:00
Christopher Wellons 18cc64311c Simplify fingerprint command output. 2017-03-26 12:24:05 -04:00
Christopher Wellons b7a7e0094c Truncate fingerprints to 16 bytes. 2017-03-26 12:21:15 -04:00
Christopher Wellons 5d1f4dfe21 More consistent use of 'keypair' in docs. 2017-03-26 12:20:37 -04:00
Christopher Wellons 910a923139 List 'fingerprint' command in main help listing. 2017-03-26 08:48:24 -04:00
Christopher Wellons d44d2bb255 Add fingerprint command and --fingerprint keygen option. 2017-03-25 22:11:17 -04:00
Markus Böhme 1d365fbdf0 Fix out-of-bounds memory access. 2017-03-14 14:14:59 +01:00
Markus Böhme 8ca7eb3428 Replace magic value with already defined constant. 2017-03-14 14:14:06 +01:00
Markus Böhme 09e8ec6f8d Fix typos in comments. 2017-03-14 14:13:34 +01:00
Markus Böhme 18249a7f82 Use va_end in functions with a variable number of arguments. 2017-03-14 14:12:15 +01:00
Markus Böhme 99e568f55b Fix registering of files to be cleaned up to work with multiple files. 2017-03-14 14:11:08 +01:00
Christopher Wellons 7341de31ca Update docstring to say HMAC-SHA256. 2017-03-09 13:32:40 -05:00
Christopher Wellons b705d7d159 Fix Win32 directory detection. 2017-03-08 12:05:08 -05:00
Christopher Wellons 1f0f28c125 Use $XDG_RUNTIME_DIR for agent. 2017-03-08 11:51:21 -05:00
Christopher Wellons 3e30188671 Fix key derivation salt to be 32 bytes. 2017-03-08 11:51:21 -05:00
Christopher Wellons 365b184ab8 Use XDG_CONFIG_HOME instead. 2017-03-08 11:51:21 -05:00
Christopher Wellons 6e8453894b Unlink socket before use (agent). 2017-03-08 11:43:36 -05:00
Christopher Wellons ff6ac9c7ca Remove extra passphrase mixing from key derivation. 2017-03-08 10:07:29 -05:00
Christopher Wellons 65467d2fe3 Tweak the algorithm further. 2017-03-07 23:09:32 -05:00
Christopher Wellons 62bed915da Fix argument parsing for new difficulty. 2017-03-07 22:22:34 -05:00