Skip to content

Commit

Permalink
Merge pull request #1600 from timopollmeier/include_certificate_data
Browse files Browse the repository at this point in the history
Add include_certificate_data to gsad
  • Loading branch information
bjoernricks authored Sep 2, 2019
2 parents ae2c87d + ff07518 commit 50d4c2e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add storybook [#1272](https://github.com/greenbone/gsa/pull/1286)
- Added TLS certificates to the asset management.
[#1455](https://github.com/greenbone/gsa/pull/1455),
[#1461](https://github.com/greenbone/gsa/pull/1461)
[#1461](https://github.com/greenbone/gsa/pull/1461),
[#1600](https://github.com/greenbone/gsa/pull/1600)
- Add usage type to task and scanconfig commands [#1460](https://github.com/greenbone/gsa/pull/1460)
[#1466](https://github.com/greenbone/gsa/pull/1466) [#1467](https://github.com/greenbone/gsa/pull/1467)

Expand Down
1 change: 1 addition & 0 deletions gsad/src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ init_validator ()
gvm_validator_alias (validator, "in_assets", "boolean");
gvm_validator_alias (validator, "in_use", "boolean");
gvm_validator_alias (validator, "include_related", "number");
gvm_validator_alias (validator, "include_certificate_data", "boolean");
gvm_validator_alias (validator, "inheritor_id", "id");
gvm_validator_alias (validator, "ignore_pagination", "boolean");
gvm_validator_alias (validator, "event", "condition");
Expand Down
30 changes: 27 additions & 3 deletions gsad/src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -16935,8 +16935,20 @@ get_tls_certificates_gmp (gvm_connection_t *connection,
credentials_t *credentials, params_t *params,
cmd_response_data_t *response_data)
{
return get_many (connection, "tls_certificates", credentials, params, NULL,
response_data);
gmp_arguments_t *arguments = gmp_arguments_new ();
const char *include_certificate_data;

if (params_given (params, "include_certificate_data"))
{
include_certificate_data =
params_value (params, "include_certificate_data");
CHECK_VARIABLE_INVALID (include_certificate_data, "Get TLS Certificate");
gmp_arguments_add (arguments, "include_certificate_data",
include_certificate_data);
}

return get_many (connection, "tls_certificates", credentials, params,
arguments, response_data);
}

/**
Expand All @@ -16954,8 +16966,20 @@ get_tls_certificate_gmp (gvm_connection_t *connection,
credentials_t *credentials, params_t *params,
cmd_response_data_t *response_data)
{
gmp_arguments_t *arguments = gmp_arguments_new ();
const char *include_certificate_data;

if (params_given (params, "include_certificate_data"))
{
include_certificate_data =
params_value (params, "include_certificate_data");
CHECK_VARIABLE_INVALID (include_certificate_data, "Get TLS Certificate");
gmp_arguments_add (arguments, "include_certificate_data",
include_certificate_data);
}

return get_one (connection, "tls_certificate", credentials, params, NULL,
NULL, response_data);
arguments, response_data);
}

/**
Expand Down

0 comments on commit 50d4c2e

Please sign in to comment.