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

Add TLS certificate assets #585

Merged
merged 24 commits into from
Jun 21, 2019

Conversation

timopollmeier
Copy link
Member

No description provided.

This adds the basic tables and GET_... GMP command to handle TLS
certificates as separate assets outside the report host details.
This allows adding a new TLS certificate from a certificate file.
This adds the columns md5_fingerprint, activation_time and
expiration_time to tls certificates.
This adds an output parameter to the get_certificate_info function which
is used by create_tls_certificate to get the subject DN.
This fixes a few mistakes in the function documentation of
get_certificate_info, create_tls_certificate and copy_tls_certificate.
This fixes some issues that prevented copy_tls_certificate from
working, adds the delete_tls_certificate GMP command and other
functions related to deleting for TLS certificates.
The case for invalid certificate content was missing.
The trust can be optionally set in both create_tls_certificate and
modify_tls_certificate.
The activation_time and expiration_time have special cases for "unknown"
and "unlimited" to be considered in the GMP elements and filters.
This adds documentation for the commands create_tls_certificate
get_tls_certificates and modify_tls_certificate.
The certificate must not be empty for create_tls_certificate and
modify_tls_certificate.
@timopollmeier timopollmeier marked this pull request as ready for review June 13, 2019 16:10
@timopollmeier timopollmeier requested a review from a team June 13, 2019 16:10
The commands create_tls_certificate and modify_tls_certificate now
expect the certificate in Base64 encoding, so the DER format can be used
in addition to PEM.
The size of the certificate datum has to be set after truncation and
certificate_len is used before that.
If certificate_len < 0 and the certificate does not look PEM-encoded,
the function will return and not try to determine the size with strlen.
The certificate_format parameter was listed with the wrong name.
The format (DER or PEM) can help clients determine the MIME content type
of the decoded certificate.
The certificate element in the get_tls_certificates response will
only contain the Base64 content if details are requested.
Copy link
Contributor

@mattmundell mattmundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Just a few minor queries.

src/gmp_tls_certificates.c Outdated Show resolved Hide resolved
src/manage_sql_tls_certificates.c Outdated Show resolved Hide resolved
src/manage_sql_tls_certificates.c Outdated Show resolved Hide resolved
src/manage_sql_tls_certificates.c Outdated Show resolved Hide resolved
This fixes some typos, formatting issue and copy-paste errors in the new
code for handling TLS certificates.
@mattmundell mattmundell merged commit 10cf1ae into greenbone:master Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants