OpenVAS Libraries  9.0.2
Functions
nasl_signature.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include "nasl_signature.h"
#include "nasl_tree.h"
#include "nasl_var.h"
#include "nasl_func.h"
#include "nasl_lex_ctxt.h"
#include "nasl_debug.h"

Functions

int nasl_verify_signature (const char *filename)
 

Function Documentation

§ nasl_verify_signature()

int nasl_verify_signature ( const char *  filename)

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.

Parameters
filenameFilename (e.g. 1.txt) for which to check signature (e.g. 1.txt.asc).
Returns
Zero, if files exists and at least one signature is fully trusted. 1 if all signatures are invalid or untrusted key. -1 on missing file or error.