| 1 | to-do list for libxcrypt |
| 2 | ------------------------ |
| 3 | |
| 4 | This list is categorized but not in any kind of priority order. |
| 5 | It was last updated 20 October 2018. |
| 6 | |
| 7 | * Code cleanliness |
| 8 | * Find and remove any code that still does dodgy things with type punning |
| 9 | * Factor out all of the repetitive base64 code |
| 10 | * Factor out the multiple implementations of HMAC and PBKDF |
| 11 | |
| 12 | * Testsuite improvements |
| 13 | * Investigate branch coverage |
| 14 | * Do some API fuzz testing and add missing cases to the testsuite |
| 15 | * Many of the `test-crypt-*.c` files repeat more or less the same |
| 16 | code with different data, consider merging them |
| 17 | |
| 18 | * Portability |
| 19 | * Make sure the symbol versioning macros work with all of the |
| 20 | compilers that anyone needs (they use GCC extensions that clang |
| 21 | also supports). |
| 22 | |
| 23 | * Hardening |
| 24 | * bcrypt-like selftest/memory scribble for all hashing methods |
| 25 | * how do we know the memory scribble is doing its job? |
| 26 | * build out of the box with compiler hardening features turned on |
| 27 | * something bespoke for not having to write serialization and |
| 28 | deserialization logic for hash strings by hand, as this is |
| 29 | probably the most error-prone part of writing a hashing method |
| 30 | |
| 31 | * the most sensitive piece of data handled by this library is a |
| 32 | cleartext passphrase. OS may have trusted-path facilities for |
| 33 | prompting the user for a passphrase and feeding it to a KDF |
| 34 | without its ever being accessible in normal memory. investigate |
| 35 | whether we can use these. |
| 36 | |
| 37 | * Additional hashing methods |
| 38 | * Argon2 <https://password-hashing.net/> |
| 39 | * ...? |
| 40 | |
| 41 | * Runtime configurability (in progress on the [crypt.conf branch][]) |
| 42 | * allow installations to enable or disable specific hash methods |
| 43 | without rebuilding the library |
| 44 | * make the default cost parameter used by `crypt_gensalt_*` for new |
| 45 | hashes configurable |
| 46 | * update the compiled-in defaults used by `crypt_gensalt_*` (not the |
| 47 | defaults used when no explicit cost parameter is present in a |
| 48 | hash; those can’t be changed without breaking existing stored hashes) |
| 49 | * relevant benchmarking at |
| 50 | <https://pthree.org/2016/06/28/lets-talk-password-hashing/> |
| 51 | * offer a way to tune cost parameters for a specific installation |
| 52 | * N.B. Solaris 11 has all of these features but our implementation will |
| 53 | probably not match them (they have a `crypt.conf` but it’s not the |
| 54 | same, and their `crypt_gensalt` is API-incompatible anyway). |
| 55 | |
| 56 | [crypt.conf branch]: https://github.com/besser82/libxcrypt/tree/zack/crypt.conf |
| 57 | |
| 58 | * Potential API enhancements: |
| 59 | |
| 60 | * Support for "pepper" (an additional piece of information, _not_ |
| 61 | stored in the password file, that you need to check a password) |
| 62 | |
| 63 | * Reading passphrases from the terminal is finicky and there are |
| 64 | several competing, poorly portable, questionably sound library |
| 65 | functions to do it (`getpass`, `readpassphrase`, etc) -- should we |
| 66 | incorporate one? |
| 67 | * If we do, should it know how to trigger the trusted-path |
| 68 | password prompt in modern GUI environments? (probably) |
| 69 | |
| 70 | * Make the crypt and crypt_gensalt static state thread-specific? |
| 71 | * Solaris 11 may have done this (its `crypt(3)` manpage describes |
| 72 | it as MT-Safe and I don’t see any other way they could have |
| 73 | accomplished that). |
| 74 | * if allocated on first use, this would also shave 32kB of |
| 75 | data segment off the shared library |
| 76 | * alternatively, add a global lock and *crash the program* if we |
| 77 | detect concurrent calls |
| 78 | |
| 79 | * Allow access to more of yescrypt’s tunable parameters and ROM |
| 80 | feature, in a way that’s generic enough that we could also use it |
| 81 | for e.g. Argon2’s tunable parameters |
| 82 | |
| 83 | * Other yescrypt-inspired features relevant to using this library to |
| 84 | back a “dedicated authentication service,” e.g. preallocation of |
| 85 | large blocks of scratch memory |
| 86 | * the main obstacles here are that `struct crypt_data` has a fixed |
| 87 | size which is either too big or too small depending how you look |
| 88 | at it, and no destructor function |
| 89 | |
| 90 | * Permissive relicensing, to encourage use beyond the GNU ecosystem? |
| 91 | * Replace crypt-md5.c with original md5crypt from FreeBSD? |
| 92 | * Other files subject to the (L)GPL are crypt.c, crypt-static.c, |
| 93 | crypt-gensalt-static.c, crypt-obsolete.h, crypt-port.h, |
| 94 | test-badsalt.c. It is not clear to me how much material originally |
| 95 | assigned to the FSF remains in these files. |
| 96 | Several of them are API definitions and trivial wrappers that |
| 97 | could not be meaningfully changed without breaking them (so are |
| 98 | arguably uncopyrightable). |
| 99 | * Most of the test suite lacks any license or even authorship |
| 100 | information. We would have to track down the original authors. |