| 93 | } |
| 94 | |
| 95 | void discard_key(struct secret *key TAKES) |
| 96 | { |
| 97 | /* sodium_munlock() also zeroes the memory. */ |
| 98 | sodium_munlock(key->data, sizeof(key->data)); |
| 99 | if (taken(key)) |
| 100 | tal_free(key); |
| 101 | } |
| 102 | |
| 103 | /* Read a line from stdin, do not take the newline character into account. */ |
| 104 | static bool getline_stdin_pass(char **passwd, size_t *passwd_size) |