diff --git a/CHANGELOG.md b/CHANGELOG.md index 20746caa6..d9b984c1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). [#410](https://github.com/greenbone/gvm-libs/pull/410) - Add multiple severities for nvti [#317](https://github.com/greenbone/gvm-libs/pull/317) - Add support for new OSP element for defining alive test methods via separate subelements. [#409](https://github.com/greenbone/gvm-libs/pull/409) +- Add severity_date tag in epoch time format. [#412](https://github.com/greenbone/gvm-libs/pull/412) ### Changed - Add separators for a new (ip address) field in ERRMSG and DEADHOST messages. [#376](https://github.com/greenbone/gvm-libs/pull/376) diff --git a/base/nvti.c b/base/nvti.c index 9809e0a1b..65acb7e79 100644 --- a/base/nvti.c +++ b/base/nvti.c @@ -1458,10 +1458,10 @@ nvti_set_solution_method (nvti_t *n, const gchar *solution_method) /** * @brief Add a tag to the NVT tags. - * The tag names "last_modification" and "creation_date" are - * treated special: The value is expected to be a timestamp - * and it is being converted to seconds since epoch before - * added as a tag value. + * The tag names "severity_date", "last_modification" and + * "creation_date" are treated special: The value is expected + * to be a timestamp and it is being converted to seconds + * since epoch before added as a tag value. * The tag name "cvss_base" will be ignored and not added. * * @param n The NVT Info structure. @@ -1496,6 +1496,8 @@ nvti_add_tag (nvti_t *n, const gchar *name, const gchar *value) nvti_set_creation_time (n, parse_nvt_timestamp (value)); newvalue = g_strdup_printf ("%i", (int) nvti_creation_time (n)); } + else if (!strcmp (name, "severity_date")) + newvalue = g_strdup_printf ("%i", (int) parse_nvt_timestamp (value)); else if (!strcmp (name, "cvss_base")) { /* Ignore this tag because it is not being used.