OpenVAS Scanner  21.4.1
Macros | Functions
nasl_crypto.c File Reference

This file contains all the cryptographic functions NASL has. More...

#include "nasl_crypto.h"
#include "exec.h"
#include "hmacmd5.h"
#include "nasl_debug.h"
#include "nasl_func.h"
#include "nasl_global_ctxt.h"
#include "nasl_lex_ctxt.h"
#include "nasl_tree.h"
#include "nasl_var.h"
#include "ntlmssp.h"
#include "smb.h"
#include "smb_crypt.h"
#include "smb_signing.h"
#include <assert.h>
#include <ctype.h>
#include <gcrypt.h>
#include <glib.h>
#include <gvm/base/logging.h>
#include <stdlib.h>

Macros

#define G_LOG_DOMAIN   "lib nasl"
 GLib logging domain. More...
 

Functions

static tree_cellnasl_gcrypt_hash (lex_ctxt *lexic, int algorithm, void *data, size_t datalen, void *key, size_t keylen)
 
static tree_cellnasl_hash (lex_ctxt *lexic, int algorithm)
 
tree_cellnasl_md2 (lex_ctxt *lexic)
 
tree_cellnasl_md4 (lex_ctxt *lexic)
 
tree_cellnasl_md5 (lex_ctxt *lexic)
 
tree_cellnasl_sha1 (lex_ctxt *lexic)
 
tree_cellnasl_sha256 (lex_ctxt *lexic)
 
tree_cellnasl_ripemd160 (lex_ctxt *lexic)
 
static tree_cellnasl_cipher (int algorithm, void *data, size_t dlen, void *key, size_t klen)
 
tree_cellnasl_cipher_des (lex_ctxt *lexic)
 
static tree_cellnasl_hmac (lex_ctxt *lexic, int algorithm)
 
tree_cellnasl_hmac_md2 (lex_ctxt *lexic)
 
tree_cellnasl_hmac_md5 (lex_ctxt *lexic)
 
tree_cellnasl_hmac_sha1 (lex_ctxt *lexic)
 
tree_cellnasl_hmac_sha384 (lex_ctxt *lexic)
 
tree_cellnasl_hmac_ripemd160 (lex_ctxt *lexic)
 
tree_cellnasl_get_sign (lex_ctxt *lexic)
 
static void * hmac_md5_for_prf (const void *key, int keylen, const void *buf, int buflen)
 
static void * hmac_sha1 (const void *key, int keylen, const void *buf, int buflen)
 
static void * hmac_sha256 (const void *key, int keylen, const void *buf, int buflen)
 
static void * hmac_sha384 (const void *key, int keylen, const void *buf, int buflen)
 
tree_cellnasl_hmac_sha256 (lex_ctxt *lexic)
 
static void * tls_prf (const void *secret, size_t secret_len, const void *seed, size_t seed_len, const void *label, size_t outlen, int hmac)
 
static void * tls1_prf (const void *secret, size_t secret_len, const void *seed, size_t seed_len, const void *label, size_t outlen)
 
static tree_cellnasl_prf (lex_ctxt *lexic, int hmac)
 
tree_cellnasl_prf_sha256 (lex_ctxt *lexic)
 
tree_cellnasl_prf_sha384 (lex_ctxt *lexic)
 
tree_cellnasl_tls1_prf (lex_ctxt *lexic)
 
tree_cellnasl_hmac_sha512 (lex_ctxt *lexic)
 
tree_cellnasl_get_smb2_sign (lex_ctxt *lexic)
 
tree_cellnasl_ntlmv2_response (lex_ctxt *lexic)
 
tree_cellnasl_ntlm2_response (lex_ctxt *lexic)
 
tree_cellnasl_ntlm_response (lex_ctxt *lexic)
 
tree_cellnasl_keyexchg (lex_ctxt *lexic)
 
tree_cellnasl_ntlmv1_hash (lex_ctxt *lexic)
 
tree_cellnasl_nt_owf_gen (lex_ctxt *lexic)
 
tree_cellnasl_lm_owf_gen (lex_ctxt *lexic)
 
tree_cellnasl_insert_hexzeros (lex_ctxt *lexic)
 
tree_cellnasl_ntv2_owf_gen (lex_ctxt *lexic)
 
tree_cellnasl_ntlmv2_hash (lex_ctxt *lexic)
 

Detailed Description

This file contains all the cryptographic functions NASL has.

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

Function Documentation

◆ hmac_md5_for_prf()

static void* hmac_md5_for_prf ( const void *  key,
int  keylen,
const void *  buf,
int  buflen 
)
static

◆ hmac_sha1()

static void* hmac_sha1 ( const void *  key,
int  keylen,
const void *  buf,
int  buflen 
)
static

◆ hmac_sha256()

static void* hmac_sha256 ( const void *  key,
int  keylen,
const void *  buf,
int  buflen 
)
static

◆ hmac_sha384()

static void* hmac_sha384 ( const void *  key,
int  keylen,
const void *  buf,
int  buflen 
)
static

◆ nasl_cipher()

static tree_cell* nasl_cipher ( int  algorithm,
void *  data,
size_t  dlen,
void *  key,
size_t  klen 
)
static

◆ nasl_cipher_des()

tree_cell* nasl_cipher_des ( lex_ctxt lexic)

◆ nasl_gcrypt_hash()

static tree_cell* nasl_gcrypt_hash ( lex_ctxt lexic,
int  algorithm,
void *  data,
size_t  datalen,
void *  key,
size_t  keylen 
)
static

◆ nasl_get_sign()

tree_cell* nasl_get_sign ( lex_ctxt lexic)

◆ nasl_get_smb2_sign()

tree_cell* nasl_get_smb2_sign ( lex_ctxt lexic)

◆ nasl_hash()

static tree_cell* nasl_hash ( lex_ctxt lexic,
int  algorithm 
)
static

◆ nasl_hmac()

static tree_cell* nasl_hmac ( lex_ctxt lexic,
int  algorithm 
)
static

◆ nasl_hmac_md2()

tree_cell* nasl_hmac_md2 ( lex_ctxt lexic)

◆ nasl_hmac_md5()

tree_cell* nasl_hmac_md5 ( lex_ctxt lexic)

◆ nasl_hmac_ripemd160()

tree_cell* nasl_hmac_ripemd160 ( lex_ctxt lexic)

◆ nasl_hmac_sha1()

tree_cell* nasl_hmac_sha1 ( lex_ctxt lexic)

◆ nasl_hmac_sha256()

tree_cell * nasl_hmac_sha256 ( lex_ctxt lexic)

◆ nasl_hmac_sha384()

tree_cell* nasl_hmac_sha384 ( lex_ctxt lexic)

◆ nasl_hmac_sha512()

tree_cell* nasl_hmac_sha512 ( lex_ctxt lexic)

◆ nasl_insert_hexzeros()

tree_cell* nasl_insert_hexzeros ( lex_ctxt lexic)

◆ nasl_keyexchg()

tree_cell* nasl_keyexchg ( lex_ctxt lexic)

◆ nasl_lm_owf_gen()

tree_cell* nasl_lm_owf_gen ( lex_ctxt lexic)

◆ nasl_md2()

tree_cell* nasl_md2 ( lex_ctxt lexic)

◆ nasl_md4()

tree_cell* nasl_md4 ( lex_ctxt lexic)

◆ nasl_md5()

tree_cell* nasl_md5 ( lex_ctxt lexic)

◆ nasl_nt_owf_gen()

tree_cell* nasl_nt_owf_gen ( lex_ctxt lexic)

◆ nasl_ntlm2_response()

tree_cell* nasl_ntlm2_response ( lex_ctxt lexic)

◆ nasl_ntlm_response()

tree_cell* nasl_ntlm_response ( lex_ctxt lexic)

◆ nasl_ntlmv1_hash()

tree_cell* nasl_ntlmv1_hash ( lex_ctxt lexic)

◆ nasl_ntlmv2_hash()

tree_cell* nasl_ntlmv2_hash ( lex_ctxt lexic)

◆ nasl_ntlmv2_response()

tree_cell* nasl_ntlmv2_response ( lex_ctxt lexic)

◆ nasl_ntv2_owf_gen()

tree_cell* nasl_ntv2_owf_gen ( lex_ctxt lexic)

◆ nasl_prf()

static tree_cell* nasl_prf ( lex_ctxt lexic,
int  hmac 
)
static

◆ nasl_prf_sha256()

tree_cell* nasl_prf_sha256 ( lex_ctxt lexic)

◆ nasl_prf_sha384()

tree_cell* nasl_prf_sha384 ( lex_ctxt lexic)

◆ nasl_ripemd160()

tree_cell* nasl_ripemd160 ( lex_ctxt lexic)

◆ nasl_sha1()

tree_cell* nasl_sha1 ( lex_ctxt lexic)

◆ nasl_sha256()

tree_cell* nasl_sha256 ( lex_ctxt lexic)

◆ nasl_tls1_prf()

tree_cell* nasl_tls1_prf ( lex_ctxt lexic)

◆ tls1_prf()

static void* tls1_prf ( const void *  secret,
size_t  secret_len,
const void *  seed,
size_t  seed_len,
const void *  label,
size_t  outlen 
)
static

◆ tls_prf()

static void* tls_prf ( const void *  secret,
size_t  secret_len,
const void *  seed,
size_t  seed_len,
const void *  label,
size_t  outlen,
int  hmac 
)
static