Greenbone Vulnerability Manager  22.4.0~dev1
Macros | Enumerations | Functions
manage_sql_report_formats.c File Reference

GVM management layer: Report format SQL. More...

#include "debug_utils.h"
#include "manage_sql_report_formats.h"
#include "manage_acl.h"
#include "manage_report_formats.h"
#include "sql.h"
#include "utils.h"
#include <errno.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <grp.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <gvm/base/gvm_sentry.h>
#include <bsd/unistd.h>
#include <gvm/util/uuidutils.h>
#include <gvm/util/fileutils.h>

Macros

#define G_LOG_DOMAIN   "md manage"
 GLib log domain.
 
#define REPORT_FORMAT_ITERATOR_FILTER_COLUMNS
 
#define REPORT_FORMAT_ITERATOR_COLUMNS
 
#define REPORT_FORMAT_ITERATOR_TRASH_COLUMNS
 

Enumerations

enum  report_format_flag_t { REPORT_FORMAT_FLAG_ACTIVE = 1 }
 Possible port types.
 

Functions

int sync_report_formats_with_feed (gboolean)
 Sync all report formats with the feed. More...
 
static int validate_param_value (report_format_t report_format, report_format_param_t param, const char *name, const char *value)
 Validate a value for a report format param. More...
 
static void set_report_format_name (report_format_t report_format, const char *name)
 Set the name of the report format. More...
 
static void set_report_format_summary (report_format_t report_format, const char *summary)
 Set the summary of the report format. More...
 
static void set_report_format_active (report_format_t report_format, int active)
 Set the active flag of a report format. More...
 
static int set_report_format_param (report_format_t, const char *, const char *)
 
static const char * get_sysconf_gpghome ()
 Return the name of the sysconf GnuPG home directory. More...
 
static const char * get_trustedkeys_name ()
 Return the name of the trusted keys file name. More...
 
int resource_predefined (const gchar *type, resource_t resource)
 Return whether a resource is predefined. More...
 
static int verify_signature (const gchar *installer, gsize installer_size, const gchar *signature, gsize signature_size, int *trust)
 Execute gpg to verify an installer signature. More...
 
static int find_signature (const gchar *location, const gchar *installer_filename, gchar **signature, gsize *signature_size, gchar **uuid)
 Find a signature in a feed. More...
 
static gchar * report_format_trash_dir (const gchar *report_format_id)
 Get trash directory of a report format. More...
 
gboolean lookup_report_format (const char *name, report_format_t *report_format)
 Find a report format given a name. More...
 
gboolean find_report_format_no_acl (const char *uuid, report_format_t *report_format)
 Find a report format given a UUID. More...
 
gboolean find_trash_report_format_no_acl (const char *uuid, report_format_t *report_format)
 Find a trash report format given a UUID. More...
 
static gint compare_files (gconstpointer one, gconstpointer two)
 Compare files for create_report_format. More...
 
static int save_report_format_files (const gchar *report_id, array_t *files, gchar **report_format_dir)
 Save files of a report format. More...
 
static int add_report_format_params (report_format_t report_format, array_t *params, array_t *params_options)
 Add params to a report format. More...
 
static int create_report_format_internal (int check_access, int may_exist, int active, int trusted, const char *uuid, const char *name, const char *content_type, const char *extension, const char *summary, const char *description, array_t *files, array_t *params, array_t *params_options, const char *signature, int predefined, report_format_t *report_format)
 Create a report format. More...
 
int create_report_format (const char *uuid, const char *name, const char *content_type, const char *extension, const char *summary, const char *description, array_t *files, array_t *params, array_t *params_options, const char *signature, report_format_t *report_format)
 Create a report format. More...
 
int create_report_format_no_acl (const char *uuid, const char *name, const char *content_type, const char *extension, const char *summary, const char *description, array_t *files, array_t *params, array_t *params_options, const char *signature, int predefined, report_format_t *report_format)
 Create a report format. More...
 
static int copy_report_format_dir (const gchar *source_dir, const gchar *copy_parent, const gchar *copy_uuid)
 Create a report format dir. More...
 
int copy_report_format (const char *name, const char *source_uuid, report_format_t *new_report_format)
 Create Report Format from an existing Report Format. More...
 
static int report_format_predefined_uuid (const gchar *report_format_id)
 Return whether a report format is predefined. More...
 
int modify_report_format (const char *report_format_id, const char *name, const char *summary, const char *active, const char *param_name, const char *param_value)
 Modify a report format. More...
 
static int move_report_format_dir (const char *dir, const char *new_dir)
 Move a report format directory. More...
 
static void delete_report_format_rows (report_format_t report_format)
 Delete a report format from the db. More...
 
int delete_report_format (const char *report_format_id, int ultimate)
 Delete a report format. More...
 
int restore_report_format (const char *report_format_id)
 Try restore a report format. More...
 
char * report_format_uuid (report_format_t report_format)
 Return the UUID of a report format. More...
 
char * report_format_owner_uuid (report_format_t report_format)
 Return the UUID of the owner of a report format. More...
 
char * report_format_name (report_format_t report_format)
 Return the name of a report format. More...
 
char * report_format_content_type (report_format_t report_format)
 Return the content type of a report format. More...
 
int report_format_in_use (report_format_t report_format)
 Return whether a report format is referenced by an alert. More...
 
int trash_report_format_in_use (report_format_t report_format)
 Return whether a report format in trash is referenced by an alert. More...
 
int report_format_predefined (report_format_t report_format)
 Return whether a report format is predefined. More...
 
int trash_report_format_predefined (report_format_t report_format)
 Return whether a trash report format is predefined. More...
 
char * report_format_extension (report_format_t report_format)
 Return the extension of a report format. More...
 
int report_format_active (report_format_t report_format)
 Return whether a report format is active. More...
 
static report_format_param_type_t report_format_param_type (report_format_t report_format, const char *name)
 Return the type max of a report format param. More...
 
static long long int report_format_param_type_max (report_format_t report_format, const char *name)
 Return the type max of a report format param. More...
 
static long long int report_format_param_type_min (report_format_t report_format, const char *name)
 Return the type min of a report format param. More...
 

Detailed Description

GVM management layer: Report format SQL.

The report format SQL for the GVM management layer.

Macro Definition Documentation

◆ REPORT_FORMAT_ITERATOR_COLUMNS

#define REPORT_FORMAT_ITERATOR_COLUMNS
Value:
{ \
{ "id", NULL, KEYWORD_TYPE_INTEGER }, \
{ "uuid", NULL, KEYWORD_TYPE_STRING }, \
{ "name", NULL, KEYWORD_TYPE_STRING }, \
{ "''", NULL, KEYWORD_TYPE_STRING }, \
{ "iso_time (creation_time)", NULL, KEYWORD_TYPE_STRING }, \
{ "iso_time (modification_time)", NULL, KEYWORD_TYPE_STRING }, \
{ "creation_time", "created", KEYWORD_TYPE_INTEGER }, \
{ "modification_time", "modified", KEYWORD_TYPE_INTEGER }, \
{ \
"(SELECT name FROM users WHERE users.id = report_formats.owner)", \
"_owner", \
KEYWORD_TYPE_STRING \
}, \
{ "owner", NULL, KEYWORD_TYPE_INTEGER }, \
{ "extension", NULL, KEYWORD_TYPE_STRING }, \
{ "content_type", NULL, KEYWORD_TYPE_STRING }, \
{ "summary", NULL, KEYWORD_TYPE_STRING }, \
{ "description", NULL, KEYWORD_TYPE_STRING }, \
{ "signature", NULL, KEYWORD_TYPE_STRING }, \
{ "trust", NULL, KEYWORD_TYPE_INTEGER }, \
{ "trust_time", NULL, KEYWORD_TYPE_INTEGER }, \
{ "flags & 1", "active", KEYWORD_TYPE_INTEGER }, \
{ "predefined", NULL, KEYWORD_TYPE_INTEGER }, \
{ NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
}

◆ REPORT_FORMAT_ITERATOR_FILTER_COLUMNS

#define REPORT_FORMAT_ITERATOR_FILTER_COLUMNS
Value:
{ ANON_GET_ITERATOR_FILTER_COLUMNS, "name", "extension", "content_type", \
"summary", "description", "trust", "trust_time", "active", "predefined", \
NULL }

◆ REPORT_FORMAT_ITERATOR_TRASH_COLUMNS

#define REPORT_FORMAT_ITERATOR_TRASH_COLUMNS
Value:
{ \
{ "id", NULL, KEYWORD_TYPE_INTEGER }, \
{ "uuid", NULL, KEYWORD_TYPE_STRING }, \
{ "name", NULL, KEYWORD_TYPE_STRING }, \
{ "''", NULL, KEYWORD_TYPE_STRING }, \
{ "iso_time (creation_time)", NULL, KEYWORD_TYPE_STRING }, \
{ "iso_time (modification_time)", NULL, KEYWORD_TYPE_STRING }, \
{ "creation_time", "created", KEYWORD_TYPE_INTEGER }, \
{ "modification_time", "modified", KEYWORD_TYPE_INTEGER }, \
{ \
"(SELECT name FROM users" \
" WHERE users.id = report_formats_trash.owner)", \
"_owner", \
KEYWORD_TYPE_STRING \
}, \
{ "owner", NULL, KEYWORD_TYPE_INTEGER }, \
{ "extension", NULL, KEYWORD_TYPE_STRING }, \
{ "content_type", NULL, KEYWORD_TYPE_STRING }, \
{ "summary", NULL, KEYWORD_TYPE_STRING }, \
{ "description", NULL, KEYWORD_TYPE_STRING }, \
{ "signature", NULL, KEYWORD_TYPE_STRING }, \
{ "trust", NULL, KEYWORD_TYPE_INTEGER }, \
{ "trust_time", NULL, KEYWORD_TYPE_INTEGER }, \
{ "flags & 1", "active", KEYWORD_TYPE_INTEGER }, \
{ "predefined", NULL, KEYWORD_TYPE_INTEGER }, \
{ NULL, NULL, KEYWORD_TYPE_UNKNOWN } \
}

Function Documentation

◆ add_report_format_params()

static int add_report_format_params ( report_format_t  report_format,
array_t *  params,
array_t *  params_options 
)
static

Add params to a report format.

Parameters
[in]report_formatReport format.
[in]paramsArray of params.
[in]params_optionsArray. Each item is an array corresponding to params. Each item of an inner array is a string, the text of an option in a selection.
Returns
0 success, 3 param value validation failed, 4 param value validation failed, 5 param default missing, 6 param min or max out of range, 7 param type missing, 8 duplicate param name, 9 bogus param type name, 99 permission denied, -1 error.

◆ compare_files()

static gint compare_files ( gconstpointer  one,
gconstpointer  two 
)
static

Compare files for create_report_format.

Parameters
[in]oneFirst.
[in]twoSecond.
Returns
Less than, equal to, or greater than zero if one is found to be less than, to match, or be greater than two.

◆ copy_report_format()

int copy_report_format ( const char *  name,
const char *  source_uuid,
report_format_t *  new_report_format 
)

Create Report Format from an existing Report Format.

Parameters
[in]nameName of new Report Format. NULL to copy from existing.
[in]source_uuidUUID of existing Report Format.
[out]new_report_formatNew Report Format.
Returns
0 success, 1 Report Format exists already, 2 failed to find existing Report Format, 99 permission denied, -1 error.

◆ copy_report_format_dir()

static int copy_report_format_dir ( const gchar *  source_dir,
const gchar *  copy_parent,
const gchar *  copy_uuid 
)
static

Create a report format dir.

Parameters
[in]source_dirFull path of source directory, including UUID.
[in]copy_parentPath of destination directory, excluding UUID.
[in]copy_uuidUUID (dirname) of destination directory.
Returns
0 success, -1 error.

◆ create_report_format()

int create_report_format ( const char *  uuid,
const char *  name,
const char *  content_type,
const char *  extension,
const char *  summary,
const char *  description,
array_t *  files,
array_t *  params,
array_t *  params_options,
const char *  signature,
report_format_t *  report_format 
)

Create a report format.

Parameters
[in]uuidUUID of format.
[in]nameName of format.
[in]content_typeContent type of format.
[in]extensionFile extension of format.
[in]summarySummary of format.
[in]descriptionDescription of format.
[in]filesArray of memory. Each item is a file name string, a terminating NULL, the file contents in base64 and a terminating NULL.
[in]paramsArray of params.
[in]params_optionsArray. Each item is an array corresponding to params. Each item of an inner array is a string, the text of an option in a selection.
[in]signatureSignature.
[out]report_formatCreated report format.
Returns
0 success, 2 empty file name, 3 param value validation failed, 4 param value validation failed, 5 param default missing, 6 param min or max out of range, 7 param type missing, 8 duplicate param name, 9 bogus param type name, 99 permission denied, -1 error.

◆ create_report_format_internal()

static int create_report_format_internal ( int  check_access,
int  may_exist,
int  active,
int  trusted,
const char *  uuid,
const char *  name,
const char *  content_type,
const char *  extension,
const char *  summary,
const char *  description,
array_t *  files,
array_t *  params,
array_t *  params_options,
const char *  signature,
int  predefined,
report_format_t *  report_format 
)
static

Create a report format.

Parameters
[in]check_accessWhether to check for permission.
[in]may_existWhether it is OK if there is already a report format with this UUID.
[in]activeWhether report format is active.
[in]trustedWhether to assumed report format is trusted.
[in]uuidUUID of format.
[in]nameName of format.
[in]content_typeContent type of format.
[in]extensionFile extension of format.
[in]summarySummary of format.
[in]descriptionDescription of format.
[in]filesArray of memory. Each item is a file name string, a terminating NULL, the file contents in base64 and a terminating NULL.
[in]paramsArray of params.
[in]params_optionsArray. Each item is an array corresponding to params. Each item of an inner array is a string, the text of an option in a selection.
[in]predefinedWhether report format is from the feed.
[in]signatureSignature.
[out]report_formatCreated report format.
Returns
0 success, 1 report format exists, 2 empty file name, 3 param value validation failed, 4 param value validation failed, 5 param default missing, 6 param min or max out of range, 7 param type missing, 8 duplicate param name, 9 bogus param type name, 99 permission denied, -1 error.

◆ create_report_format_no_acl()

int create_report_format_no_acl ( const char *  uuid,
const char *  name,
const char *  content_type,
const char *  extension,
const char *  summary,
const char *  description,
array_t *  files,
array_t *  params,
array_t *  params_options,
const char *  signature,
int  predefined,
report_format_t *  report_format 
)

Create a report format.

Parameters
[in]uuidUUID of format.
[in]nameName of format.
[in]content_typeContent type of format.
[in]extensionFile extension of format.
[in]summarySummary of format.
[in]descriptionDescription of format.
[in]filesArray of memory. Each item is a file name string, a terminating NULL, the file contents in base64 and a terminating NULL.
[in]paramsArray of params.
[in]params_optionsArray. Each item is an array corresponding to params. Each item of an inner array is a string, the text of an option in a selection.
[in]signatureSignature.
[in]predefinedWhether report format is from the feed.
[out]report_formatCreated report format.
Returns
0 success, 1 report format exists, 2 empty file name, 3 param value validation failed, 4 param value validation failed, 5 param default missing, 6 param min or max out of range, 7 param type missing, 8 duplicate param name, 9 bogus param type name, 99 permission denied, -1 error.

◆ delete_report_format()

int delete_report_format ( const char *  report_format_id,
int  ultimate 
)

Delete a report format.

Parameters
[in]report_format_idUUID of Report format.
[in]ultimateWhether to remove entirely, or to trashcan.
Returns
0 success, 1 report format in use, 2 failed to find report format, 99 permission denied, -1 error.

◆ delete_report_format_rows()

static void delete_report_format_rows ( report_format_t  report_format)
static

Delete a report format from the db.

Parameters
[in]report_formatReport format.

◆ find_report_format_no_acl()

gboolean find_report_format_no_acl ( const char *  uuid,
report_format_t *  report_format 
)

Find a report format given a UUID.

This does not do any permission checks.

Parameters
[in]uuidUUID of resource.
[out]report_formatReport Format return, 0 if no such report format.
Returns
FALSE on success (including if no such report format), TRUE on error.

◆ find_signature()

static int find_signature ( const gchar *  location,
const gchar *  installer_filename,
gchar **  signature,
gsize *  signature_size,
gchar **  uuid 
)
static

Find a signature in a feed.

Parameters
[in]locationFeed directory to search for signature.
[in]installer_filenameInstaller filename.
[out]signatureFreshly allocated installer signature.
[out]signature_sizeSize of installer signature.
[out]uuidAddress for basename of linked signature when the signature was found in the private directory, if desired, else NULL. Private directory is only checked if this is given.
Returns
0 success, -1 error.

◆ find_trash_report_format_no_acl()

gboolean find_trash_report_format_no_acl ( const char *  uuid,
report_format_t *  report_format 
)

Find a trash report format given a UUID.

This does not do any permission checks.

This considers the actual UUID of the report format, not the original_uuid.

Parameters
[in]uuidUUID of resource.
[out]report_formatReport Format return, 0 if no such report format.
Returns
FALSE on success (including if no such report format), TRUE on error.

◆ get_sysconf_gpghome()

static const char* get_sysconf_gpghome ( )
static

Return the name of the sysconf GnuPG home directory.

Returns the name of the GnuPG home directory to use when checking signatures. It is the directory openvas/gnupg under the sysconfdir that was set by configure (usually $prefix/etc).

Returns
Static name of the Sysconf GnuPG home directory.

◆ get_trustedkeys_name()

static const char* get_trustedkeys_name ( )
static

Return the name of the trusted keys file name.

We currently use the name pubring.gpg to be compatible with previous installations. That file should best be installed read-only so that it is not accidentally accessed while we are running a verification. All files in that keyring are assumed to be fully trustworthy.

Returns
Static file name.

◆ lookup_report_format()

gboolean lookup_report_format ( const char *  name,
report_format_t *  report_format 
)

Find a report format given a name.

Parameters
[in]nameName of report_format.
[out]report_formatReport format return, 0 if successfully failed to find report_format.
Returns
FALSE on success (including if failed to find report format), TRUE on error.

◆ modify_report_format()

int modify_report_format ( const char *  report_format_id,
const char *  name,
const char *  summary,
const char *  active,
const char *  param_name,
const char *  param_value 
)

Modify a report format.

Parameters
[in]report_format_idUUID of report format.
[in]nameName of report format.
[in]summarySummary of report format.
[in]activeActive flag.
[in]param_nameParameter to modify.
[in]param_valueValue of parameter.
Returns
0 success, 1 failed to find report format, 2 report_format_id required, 3 failed to find report format parameter, 4 parameter value validation failed, 99 permission denied, -1 internal error.

◆ move_report_format_dir()

static int move_report_format_dir ( const char *  dir,
const char *  new_dir 
)
static

Move a report format directory.

Parameters
[in]dirOld dir.
[in]new_dirNew dir.
Returns
0 success, -1 error.

◆ report_format_active()

int report_format_active ( report_format_t  report_format)

Return whether a report format is active.

Parameters
[in]report_formatReport format.
Returns
-1 on error, 1 if active, else 0.

◆ report_format_content_type()

char* report_format_content_type ( report_format_t  report_format)

Return the content type of a report format.

Parameters
[in]report_formatReport format.
Returns
Newly allocated content type.

◆ report_format_extension()

char* report_format_extension ( report_format_t  report_format)

Return the extension of a report format.

Parameters
[in]report_formatReport format.
Returns
Newly allocated extension.

◆ report_format_in_use()

int report_format_in_use ( report_format_t  report_format)

Return whether a report format is referenced by an alert.

Parameters
[in]report_formatReport Format.
Returns
1 if in use, else 0.

◆ report_format_name()

char* report_format_name ( report_format_t  report_format)

Return the name of a report format.

Parameters
[in]report_formatReport format.
Returns
Newly allocated name.

◆ report_format_owner_uuid()

char* report_format_owner_uuid ( report_format_t  report_format)

Return the UUID of the owner of a report format.

Parameters
[in]report_formatReport format.
Returns
Newly allocated owner UUID if there is an owner, else NULL.

◆ report_format_param_type()

static report_format_param_type_t report_format_param_type ( report_format_t  report_format,
const char *  name 
)
static

Return the type max of a report format param.

Parameters
[in]report_formatReport format.
[in]nameName of param.
Returns
Param type.

◆ report_format_param_type_max()

static long long int report_format_param_type_max ( report_format_t  report_format,
const char *  name 
)
static

Return the type max of a report format param.

Parameters
[in]report_formatReport format.
[in]nameName of param.
Returns
Max.

◆ report_format_param_type_min()

static long long int report_format_param_type_min ( report_format_t  report_format,
const char *  name 
)
static

Return the type min of a report format param.

Parameters
[in]report_formatReport format.
[in]nameName of param.
Returns
Min.

◆ report_format_predefined()

int report_format_predefined ( report_format_t  report_format)

Return whether a report format is predefined.

Parameters
[in]report_formatReport format.
Returns
1 if predefined, else 0.

◆ report_format_predefined_uuid()

static int report_format_predefined_uuid ( const gchar *  report_format_id)
static

Return whether a report format is predefined.

Parameters
[in]report_format_idUUID of report format.
Returns
1 if predefined, else 0.

◆ report_format_trash_dir()

static gchar* report_format_trash_dir ( const gchar *  report_format_id)
static

Get trash directory of a report format.

Parameters
[in]report_format_idUUID of report format. NULL for the base dir that holds the report format trash.
Returns
Freshly allocated trash dir.

◆ report_format_uuid()

char* report_format_uuid ( report_format_t  report_format)

Return the UUID of a report format.

Parameters
[in]report_formatReport format.
Returns
Newly allocated UUID.

◆ resource_predefined()

int resource_predefined ( const gchar *  type,
resource_t  resource 
)

Return whether a resource is predefined.

Parameters
[in]typeType of resource.
[in]resourceResource.
Returns
1 if predefined, else 0.

◆ restore_report_format()

int restore_report_format ( const char *  report_format_id)

Try restore a report format.

If success, ends transaction for caller before exiting.

Parameters
[in]report_format_idUUID of resource.
Returns
0 success, 1 fail because resource is in use, 2 failed to find resource, 4 fail because resource with UUID exists, -1 error.

◆ save_report_format_files()

static int save_report_format_files ( const gchar *  report_id,
array_t *  files,
gchar **  report_format_dir 
)
static

Save files of a report format.

Parameters
[in]report_idUUID of format.
[in]filesArray of memory. Each item is a file name string, a terminating NULL, the file contents in base64 and a terminating NULL.
[out]report_format_dirAddress for dir, or NULL.
Returns
0 success, 2 empty file name, -1 error.

◆ set_report_format_active()

static void set_report_format_active ( report_format_t  report_format,
int  active 
)
static

Set the active flag of a report format.

Parameters
[in]report_formatThe report format.
[in]activeActive flag.

◆ set_report_format_name()

static void set_report_format_name ( report_format_t  report_format,
const char *  name 
)
static

Set the name of the report format.

Parameters
[in]report_formatThe report format.
[in]nameName.

◆ set_report_format_summary()

static void set_report_format_summary ( report_format_t  report_format,
const char *  summary 
)
static

Set the summary of the report format.

Parameters
[in]report_formatThe report format.
[in]summarySummary.

◆ sync_report_formats_with_feed()

int sync_report_formats_with_feed ( gboolean  rebuild)

Sync all report formats with the feed.

Create report formats that exists in the feed but not in the db. Update report formats in the db that have changed on the feed. Do nothing to report formats in db that have been removed from the feed.

Parameters
[in]rebuildWhether ignore timestamps to force a rebuild.
Returns
0 success, 1 no feed directory, 2 no feed owner, -1 error.

◆ trash_report_format_in_use()

int trash_report_format_in_use ( report_format_t  report_format)

Return whether a report format in trash is referenced by an alert.

Parameters
[in]report_formatReport Format.
Returns
1 if in use, else 0.

◆ trash_report_format_predefined()

int trash_report_format_predefined ( report_format_t  report_format)

Return whether a trash report format is predefined.

Parameters
[in]report_formatReport format.
Returns
1 if predefined, else 0.

◆ validate_param_value()

static int validate_param_value ( report_format_t  report_format,
report_format_param_t  param,
const char *  name,
const char *  value 
)
static

Validate a value for a report format param.

Parameters
[in]report_formatReport format.
[in]paramParam.
[in]nameName of param.
[in]valuePotential value of param.
Returns
0 success, 1 fail.

◆ verify_signature()

static int verify_signature ( const gchar *  installer,
gsize  installer_size,
const gchar *  signature,
gsize  signature_size,
int *  trust 
)
static

Execute gpg to verify an installer signature.

Parameters
[in]installerInstaller.
[in]installer_sizeSize of installer.
[in]signatureInstaller signature.
[in]signature_sizeSize of installer signature.
[out]trustTrust value.
Returns
0 success, -1 error.