OpenVAS Libraries  9.0.3
gpgme_util.h File Reference

Protos and data structures for GPGME utilities. More...

#include <gpgme.h>
Include dependency graph for gpgme_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

gpgme_ctx_t openvas_init_gpgme_ctx (const gchar *)
 Returns a new gpgme context. More...
 
gpgme_ctx_t openvas_init_gpgme_sysconf_ctx (void)
 Returns a new gpgme context using the sycconf directory. More...
 
void set_gpghome (const char *)
 

Detailed Description

Protos and data structures for GPGME utilities.

This file contains the protos for gpgme_util.c

Definition in file gpgme_util.h.

Function Documentation

◆ openvas_init_gpgme_ctx()

gpgme_ctx_t openvas_init_gpgme_ctx ( const gchar *  subdir)

Returns a new gpgme context.

Inits a gpgme context with the custom gpghome directory, protocol version etc. Returns the context or NULL if an error occurred. This function also does an gpgme initialization the first time it is called. It is advisable to call this function as early as possible to notice a bad installation (e.g. an too old gpg version).

Parameters
subdirDirectory to use in OPENVAS_STATE_DIR for gpghome, if environment OPENVAS_GPGHOME is not set.
Returns
The gpgme_ctx_t to the context or NULL if an error occurred.

Definition at line 224 of file gpgme_util.c.

225 {
226  char *path;
227  gpgme_ctx_t ctx;
228 
229  path = determine_gpghome (subdir);
230  ctx = openvas_init_gpgme_ctx_from_dir (path);
231  g_free (path);
232  return ctx;
233 }
gpgme_ctx_t openvas_init_gpgme_ctx_from_dir(const gchar *dir)
Returns a new gpgme context.
Definition: gpgme_util.c:102

◆ openvas_init_gpgme_sysconf_ctx()

gpgme_ctx_t openvas_init_gpgme_sysconf_ctx ( void  )

Returns a new gpgme context using the sycconf directory.

Inits a gpgme context with the systeconf gpghome directory, protocol version etc. Returns the context or NULL if an error occurred. This function also does an gpgme initialization the first time it is called. It is advisable to call this function (or openvas_init_gpgme_ctx) as early as possible to notice a bad installation (e.g. an too old gpg version).

Returns
The gpgme_ctx_t to the context or NULL if an error occurred.

Definition at line 277 of file gpgme_util.c.

278 {
279  gpgme_ctx_t ctx;
280  char *path;
281 
282  path = get_sysconf_gpghome ();
283  ctx = openvas_init_gpgme_ctx_from_dir (path);
284  g_free (path);
285  return ctx;
286 }
gpgme_ctx_t openvas_init_gpgme_ctx_from_dir(const gchar *dir)
Returns a new gpgme context.
Definition: gpgme_util.c:102

Referenced by nasl_verify_signature().

Here is the caller graph for this function:

◆ set_gpghome()

void set_gpghome ( const char *  )

Definition at line 236 of file gpgme_util.c.

237 {
238  gpghome = g_strdup (path);
239 }