OpenVAS Scanner
7.0.0~git
|
#include "nasl_debug.h"
#include "nasl_func.h"
#include "nasl_lex_ctxt.h"
#include "nasl_tree.h"
#include "nasl_var.h"
#include <gvm/util/gpgmeutils.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Functions | |
static void | print_gpgme_error (char *function, gpgme_error_t err) |
Prints an error message for errors returned by gpgme. More... | |
static int | examine_signatures (gpgme_verify_result_t result, int sig_count) |
Checks whether the signature verification result contains one. More... | |
int | nasl_verify_signature (const char *filename, const char *fcontent, size_t flen) |
|
static |
Checks whether the signature verification result contains one.
signature and whether signature is fully valid.
The function returns 1 if the signature is fully valid and 0 otherwise.
result | The verification result to examine. |
Definition at line 56 of file nasl_signature.c.
References nasl_trace(), and nasl_trace_enabled().
Referenced by nasl_verify_signature().
int nasl_verify_signature | ( | const char * | filename, |
const char * | fcontent, | ||
size_t | flen | ||
) |
Checks the detached OpenPGP signature of the file given by FILENAME. The name of the signature file is derived from FILENAME by appending ".asc".
If a signature file exists and it contains at least one fully valid signature, the function returns 0. If all of the signatures are not valid or were made by an unknown or untrusted key, the function returns 1. If an error occurs or the file does not have a corresponding detached signature the function returns -1.
filename | Filename (e.g. 1.txt) for which to check signature (e.g. 1.txt.asc). |
Definition at line 110 of file nasl_signature.c.
References examine_signatures(), nasl_trace(), and print_gpgme_error().
|
static |
Prints an error message for errors returned by gpgme.
function | Calling function name (debug info). |
err | The gpgme error that caused the problem. |
Definition at line 39 of file nasl_signature.c.
References nasl_perror().
Referenced by nasl_verify_signature().