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 (8.0) #1158

Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [8.0.3] (unreleased)

### Changed
- Try importing private keys with libssh if GnuTLS fails [#1058](https://github.com/greenbone/gvmd/pull/1158)
mattmundell marked this conversation as resolved.
Show resolved Hide resolved

### Fixed
- Fix NVTs list in CVE details [#1098](https://github.com/greenbone/gvmd/pull/1098)
- Fix handling of duplicate settings [#1104](https://github.com/greenbone/gvmd/pull/1104)
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