| 452 | } |
| 453 | |
| 454 | const char *read_stdin_mnemonic(const tal_t *ctx, enum hsm_secret_error *err) |
| 455 | { |
| 456 | printf("Introduce your BIP39 word list separated by space (at least 12 words):\n"); |
| 457 | fflush(stdout); |
| 458 | |
| 459 | const char *line = read_line(ctx); |
| 460 | if (!line) { |
| 461 | *err = HSM_SECRET_ERR_INVALID_FORMAT; |
| 462 | return NULL; |
| 463 | } |
| 464 | |
| 465 | /* Validate mnemonic */ |
| 466 | *err = validate_mnemonic(line); |
| 467 | if (*err != HSM_SECRET_OK) { |
| 468 | return tal_free(line); |
| 469 | } |
| 470 | |
| 471 | *err = HSM_SECRET_OK; |
| 472 | return line; |
| 473 | } |
| 474 | |
| 475 | int is_legacy_hsm_secret_encrypted(const char *path) |
| 476 | { |
no test coverage detected