Skip to content

Commit

Permalink
Merge pull request #402 from janowagner/drop-severity-class-from-auth
Browse files Browse the repository at this point in the history
Remove handling of severity class from auth
  • Loading branch information
mattmundell authored Sep 22, 2020
2 parents 5e15b62 + fd9af02 commit ae7e127
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Retry if response via tls1.3 is still not received. [#394](https://github.com/greenbone/gvm-libs/pull/394)

### Removed
- Remove handling of severity class from auth [#402](https://github.com/greenbone/gvm-libs/pull/402)
- Remove version from the nvticache name. [#386](https://github.com/greenbone/gvm-libs/pull/386)

[unreleased]: https://github.com/greenbone/gvm-libs/compare/gvm-libs-20.08...master
Expand Down
12 changes: 3 additions & 9 deletions gmp/gmp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2019 Greenbone Networks GmbH
/* Copyright (C) 2009-2020 Greenbone Networks GmbH
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
Expand Down Expand Up @@ -421,17 +421,14 @@ gmp_authenticate_info_ext (gnutls_session_t *session,
first = status[0];
if (first == '2')
{
entity_t timezone_entity, role_entity, severity_entity, pw_warn_entity;
entity_t timezone_entity, role_entity, pw_warn_entity;
/* Get the extra info. */
timezone_entity = entity_child (entity, "timezone");
if (timezone_entity)
*opts.timezone = g_strdup (entity_text (timezone_entity));
role_entity = entity_child (entity, "role");
if (role_entity)
*opts.role = g_strdup (entity_text (role_entity));
severity_entity = entity_child (entity, "severity");
if (severity_entity)
*opts.severity = g_strdup (entity_text (severity_entity));
pw_warn_entity = entity_child (entity, "password_warning");
if (pw_warn_entity)
*(opts.pw_warning) = g_strdup (entity_text (pw_warn_entity));
Expand Down Expand Up @@ -508,17 +505,14 @@ gmp_authenticate_info_ext_c (gvm_connection_t *connection,
first = status[0];
if (first == '2')
{
entity_t timezone_entity, role_entity, severity_entity;
entity_t timezone_entity, role_entity;
/* Get the extra info. */
timezone_entity = entity_child (entity, "timezone");
if (timezone_entity && opts.timezone)
*opts.timezone = g_strdup (entity_text (timezone_entity));
role_entity = entity_child (entity, "role");
if (role_entity && opts.role)
*opts.role = g_strdup (entity_text (role_entity));
severity_entity = entity_child (entity, "severity");
if (severity_entity && opts.severity)
*opts.severity = g_strdup (entity_text (severity_entity));
if (opts.pw_warning)
{
entity_t pw_warn_entity;
Expand Down
5 changes: 2 additions & 3 deletions gmp/gmp.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2019 Greenbone Networks GmbH
/* Copyright (C) 2009-2020 Greenbone Networks GmbH
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
Expand Down Expand Up @@ -43,7 +43,6 @@ typedef struct
const char *username; ///< Password.
const char *password; ///< Username.
char **role; ///< [out] Role.
char **severity; ///< [out] Severity class setting.
char **timezone; ///< [out] Timezone if any, else NULL.
char **pw_warning; ///< [out] Password warning, NULL if password is okay.
} gmp_authenticate_info_opts_t;
Expand All @@ -52,7 +51,7 @@ typedef struct
* @brief Sensible default values for gmp_authenticate_info_opts_t
*/
static const gmp_authenticate_info_opts_t gmp_authenticate_info_opts_defaults =
{0, NULL, NULL, NULL, NULL, NULL, NULL};
{0, NULL, NULL, NULL, NULL, NULL};

/**
* @brief Struct holding options for gmp get_report command.
Expand Down

0 comments on commit ae7e127

Please sign in to comment.