OpenVAS Libraries
9.0.1
|
Implementation of an API for X.509 certificates. More...
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <ksba.h>
#include <gcrypt.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include "../misc/openvas_logging.h"
#include "nasl_tree.h"
#include "nasl_global_ctxt.h"
#include "nasl_func.h"
#include "nasl_var.h"
#include "nasl_lex_ctxt.h"
#include "nasl_debug.h"
#include "nasl_cert.h"
Data Structures | |
struct | object_desc_s |
Macros | |
#define | DIM(v) (sizeof(v)/sizeof((v)[0])) |
#define | DIMof(type, member) DIM(((type *)0)->member) |
#define | spacep(p) (*(p) == ' ' || *(p) == '\t') |
#define | digitp(p) (*(p) >= '0' && *(p) <= '9') |
#define | hexdigitp(a) |
#define | atoi_1(p) (*(p) - '0' ) |
#define | atoi_2(p) ((atoi_1(p) * 10) + atoi_1((p)+1)) |
#define | atoi_4(p) ((atoi_2(p) * 100) + atoi_2((p)+2)) |
#define | xtoi_1(p) |
#define | xtoi_2(p) |
#define | tohex(n) ((n) < 10 ? ((n) + '0') : (((n) - 10) + 'A')) |
Typedefs | |
typedef struct object_desc_s * | object_desc_t |
Functions | |
tree_cell * | nasl_cert_open (lex_ctxt *lexic) |
Create a certificate object. More... | |
tree_cell * | nasl_cert_close (lex_ctxt *lexic) |
Release a certificate object. More... | |
tree_cell * | nasl_cert_query (lex_ctxt *lexic) |
Query a certificate object. More... | |
Implementation of an API for X.509 certificates.
This file contains the implementation of the cert_* NASL builtin functions.
#define atoi_1 | ( | p | ) | (*(p) - '0' ) |
#define digitp | ( | p | ) | (*(p) >= '0' && *(p) <= '9') |
#define DIM | ( | v | ) | (sizeof(v)/sizeof((v)[0])) |
#define DIMof | ( | type, | |
member | |||
) | DIM(((type *)0)->member) |
#define hexdigitp | ( | a | ) |
#define spacep | ( | p | ) | (*(p) == ' ' || *(p) == '\t') |
#define tohex | ( | n | ) | ((n) < 10 ? ((n) + '0') : (((n) - 10) + 'A')) |
#define xtoi_1 | ( | p | ) |
#define xtoi_2 | ( | p | ) |
typedef struct object_desc_s* object_desc_t |
Release a certificate object.
Takes a cert identifier as returned by cert_open and releases the associated resources.
[in] | lexic | Lexical context of the NASL interpreter. |
Create a certificate object.
Takes a string/data as unnamed argument and returns an identifier used with the other cert functions. The data is usually the BER encoded certificate but the function will also try a PEM encoding on failure to parse BER encoded one.
[in] | lexic | Lexical context of the NASL interpreter. |
Query a certificate object.
Takes a cert identifier as first unnamed argument and a command string as second argument. That command is used to select specific information from the certificate. For certain commands the named argument idx is used as well. Depending on this command the return value may be a number, a string, or an array of strings. Supported commands are:
[in] | lexic | Lexical context of the NASL interpreter. |