Greenbone Vulnerability Manager  22.4.0~dev1
Functions
manage_sql_tls_certificates.h File Reference

GVM management layer: TLS Certificates SQL headers. More...

Go to the source code of this file.

Functions

const char ** tls_certificate_filter_columns ()
 Gets the filter columns for TLS certificates. More...
 
column_ttls_certificate_select_columns ()
 Gets the select columns for TLS certificates. More...
 
gchar * tls_certificate_extra_where (const char *)
 Get extra_where string for a TLS certificate iterator or count. More...
 
int delete_tls_certificate (const char *, int)
 Delete a tls_certificate. More...
 
void delete_tls_certificates_user (user_t)
 Delete all TLS certificate owned by a user. More...
 
void inherit_tls_certificates (user_t, user_t)
 Change ownership of tls_certificate, for user deletion. More...
 
int user_has_tls_certificate (tls_certificate_t, user_t)
 Checks if user owns a certificate or one with the same fingerprints. More...
 
int add_tls_certificates_from_report_host (report_host_t, const char *, const char *)
 Collects and add TLS certificates from the details of a report host. More...
 

Detailed Description

GVM management layer: TLS Certificates SQL headers.

Headers for TLS Certificates SQL for the GVM management layer.

Function Documentation

◆ add_tls_certificates_from_report_host()

int add_tls_certificates_from_report_host ( report_host_t  report_host,
const char *  report_id,
const char *  host_ip 
)

Collects and add TLS certificates from the details of a report host.

Parameters
[in]report_hostThe report host to get certificates from.
[in]report_idUUID of the report
[in]host_ipThe IP address of the report host.
Returns
0: success, -1: error

◆ delete_tls_certificate()

int delete_tls_certificate ( const char *  tls_certificate_id,
int  ultimate 
)

Delete a tls_certificate.

TLS certificates do not use the trashcan, so the "ultimate" param is ignored and the resource is always removed completely.

Parameters
[in]tls_certificate_idUUID of tls_certificate.
[in]ultimateDummy for consistency with other delete commands.
Returns
0 success, 1 fail because tls_certificate is in use, 2 failed to find tls_certificate, 99 permission denied, -1 error.

◆ delete_tls_certificates_user()

void delete_tls_certificates_user ( user_t  user)

Delete all TLS certificate owned by a user.

Also delete trash TLS certificates.

Parameters
[in]userThe user.

◆ inherit_tls_certificates()

void inherit_tls_certificates ( user_t  user,
user_t  inheritor 
)

Change ownership of tls_certificate, for user deletion.

Also assign tls_certificate that are assigned to the user to the inheritor.

Parameters
[in]userCurrent owner.
[in]inheritorNew owner.

◆ tls_certificate_extra_where()

gchar* tls_certificate_extra_where ( const char *  filter)

Get extra_where string for a TLS certificate iterator or count.

Parameters
[in]filterFilter string.
Returns
Newly allocated extra_where string.

◆ tls_certificate_filter_columns()

const char** tls_certificate_filter_columns ( )

Gets the filter columns for TLS certificates.

Returns
Constant array of filter columns.

◆ tls_certificate_select_columns()

column_t* tls_certificate_select_columns ( )

Gets the select columns for TLS certificates.

Returns
Constant array of select columns.

◆ user_has_tls_certificate()

int user_has_tls_certificate ( tls_certificate_t  tls_certificate,
user_t  user 
)

Checks if user owns a certificate or one with the same fingerprints.

Parameters
[in]tls_certificateThe certificate to check
[in]userThe user to check
Returns
1 matching certificate found, 0 no matching certificate