diff options
| author | Werner Koch <[email protected]> | 2021-12-20 16:15:14 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2021-12-20 18:34:34 +0000 |
| commit | afe5fcda52e88438c7a7278117b2e03f510a9c1c (patch) | |
| tree | f04be1318b1f98ba582d58389091ecc50d7f400d /g10/gpg.c | |
| parent | gpg: Allow passing a keygrip as description to pinentry. (diff) | |
| download | gnupg-afe5fcda52e88438c7a7278117b2e03f510a9c1c.tar.gz gnupg-afe5fcda52e88438c7a7278117b2e03f510a9c1c.zip | |
gpg: Add unfinished code for --export-secret-ssh-key.
* g10/gpg.c (exportSecretSshKey): New.
(opts): Add --export-secret-ssh-key.
(main): Implement option.
* g10/export.c (do_export_stream): Factor keywrap key code out to ...
(get_keywrap_key): new.
(mb_write_uint32, mb_write_uint8)
(mb_write_data, mb_write_cstring)
(mb_write_string, mb_write_mpi): New.
(receive_raw_seckey_from_agent): New.
(export_secret_ssh_key): New.
--
Due to time constraints the code is not yet ready.
Diffstat (limited to 'g10/gpg.c')
| -rw-r--r-- | g10/gpg.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -158,6 +158,7 @@ enum cmd_and_opt_values aExportSecret, aExportSecretSub, aExportSshKey, + aExportSecretSshKey, aCheckKeys, aGenRevoke, aDesigRevoke, @@ -527,6 +528,7 @@ static gpgrt_opt_t opts[] = { ARGPARSE_c (aExportSecret, "export-secret-keys" , "@" ), ARGPARSE_c (aExportSecretSub, "export-secret-subkeys" , "@" ), ARGPARSE_c (aExportSshKey, "export-ssh-key", "@" ), + ARGPARSE_c (aExportSecretSshKey, "export-secret-ssh-key", "@" ), ARGPARSE_c (aImport, "import", N_("import/merge keys")), ARGPARSE_c (aFastImport, "fast-import", "@"), #ifdef ENABLE_CARD_SUPPORT @@ -2676,6 +2678,7 @@ main (int argc, char **argv) case aExportSecret: case aExportSecretSub: case aExportSshKey: + case aExportSecretSshKey: case aSym: case aClearsign: case aGenRevoke: @@ -4893,6 +4896,17 @@ main (int argc, char **argv) } break; + case aExportSecretSshKey: + if (argc != 1) + wrong_args ("--export-secret-ssh-key <user-id>"); + rc = export_secret_ssh_key (ctrl, argv[0]); + if (rc) + { + write_status_failure ("export-ssh-key", rc); + log_error (_("export as ssh key failed: %s\n"), gpg_strerror (rc)); + } + break; + case aSearchKeys: sl = NULL; for (; argc; argc--, argv++) |
