Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try importing private keys with libssh if GnuTLS fails (9.0) #841

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Extend command line options for managing scanners [#815](https://github.com/greenbone/gvmd/pull/815)
- Update SCAP and CERT feed info in sync scripts [#809](https://github.com/greenbone/gvmd/pull/809)
- Try authentication when verifying GMP scanners [#837](https://github.com/greenbone/gvmd/pull/837)
- Try importing private keys with libssh if GnuTLS fails [#841](https://github.com/greenbone/gvmd/pull/841)

### Fixed
- Consider results_trash when deleting users [#799](https://github.com/greenbone/gvmd/pull/799)
Expand Down
17 changes: 12 additions & 5 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,18 @@ check_private_key (const char *key_str, const char *key_phrase)
key_phrase, 0);
if (ret)
{
g_message ("%s: import failed: %s",
__FUNCTION__, gnutls_strerror (ret));
gnutls_x509_privkey_deinit (key);
g_free (data.data);
return 1;
gchar *public_key;
public_key = gvm_ssh_public_from_private (key_str, key_phrase);

if (public_key == NULL)
{
gnutls_x509_privkey_deinit (key);
g_free (data.data);
g_message ("%s: import failed: %s",
__FUNCTION__, gnutls_strerror (ret));
return 1;
}
g_free (public_key);
}
g_free (data.data);
gnutls_x509_privkey_deinit (key);
Expand Down