OpenVAS Scanner
7.0.1~git
|
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>
Go to the source code of this file.
Macros | |
#define | G_LOG_DOMAIN "lib nasl" |
GLib logging domain. More... | |
Functions | |
static tree_cell * | nasl_gcrypt_hash (lex_ctxt *lexic, int algorithm, void *data, size_t datalen, void *key, size_t keylen) |
static tree_cell * | nasl_hash (lex_ctxt *lexic, int algorithm) |
tree_cell * | nasl_md2 (lex_ctxt *lexic) |
tree_cell * | nasl_md4 (lex_ctxt *lexic) |
tree_cell * | nasl_md5 (lex_ctxt *lexic) |
tree_cell * | nasl_sha1 (lex_ctxt *lexic) |
tree_cell * | nasl_sha256 (lex_ctxt *lexic) |
tree_cell * | nasl_ripemd160 (lex_ctxt *lexic) |
static tree_cell * | nasl_cipher (int algorithm, void *data, size_t dlen, void *key, size_t klen) |
tree_cell * | nasl_cipher_des (lex_ctxt *lexic) |
static tree_cell * | nasl_hmac (lex_ctxt *lexic, int algorithm) |
tree_cell * | nasl_hmac_md2 (lex_ctxt *lexic) |
tree_cell * | nasl_hmac_md5 (lex_ctxt *lexic) |
tree_cell * | nasl_hmac_sha1 (lex_ctxt *lexic) |
tree_cell * | nasl_hmac_sha384 (lex_ctxt *lexic) |
tree_cell * | nasl_hmac_ripemd160 (lex_ctxt *lexic) |
tree_cell * | nasl_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_cell * | nasl_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_cell * | nasl_prf (lex_ctxt *lexic, int hmac) |
tree_cell * | nasl_prf_sha256 (lex_ctxt *lexic) |
tree_cell * | nasl_prf_sha384 (lex_ctxt *lexic) |
tree_cell * | nasl_tls1_prf (lex_ctxt *lexic) |
tree_cell * | nasl_hmac_sha512 (lex_ctxt *lexic) |
tree_cell * | nasl_get_smb2_sign (lex_ctxt *lexic) |
tree_cell * | nasl_ntlmv2_response (lex_ctxt *lexic) |
tree_cell * | nasl_ntlm2_response (lex_ctxt *lexic) |
tree_cell * | nasl_ntlm_response (lex_ctxt *lexic) |
tree_cell * | nasl_keyexchg (lex_ctxt *lexic) |
tree_cell * | nasl_ntlmv1_hash (lex_ctxt *lexic) |
tree_cell * | nasl_nt_owf_gen (lex_ctxt *lexic) |
tree_cell * | nasl_lm_owf_gen (lex_ctxt *lexic) |
tree_cell * | nasl_insert_hexzeros (lex_ctxt *lexic) |
tree_cell * | nasl_ntv2_owf_gen (lex_ctxt *lexic) |
tree_cell * | nasl_ntlmv2_hash (lex_ctxt *lexic) |
This file contains all the cryptographic functions NASL has.
Definition in file nasl_crypto.c.
#define G_LOG_DOMAIN "lib nasl" |
GLib logging domain.
Definition at line 64 of file nasl_crypto.c.
|
static |
Definition at line 272 of file nasl_crypto.c.
Referenced by tls_prf().
|
static |
Definition at line 286 of file nasl_crypto.c.
Referenced by tls_prf().
|
static |
Definition at line 300 of file nasl_crypto.c.
Referenced by nasl_get_smb2_sign(), nasl_hmac_sha256(), and tls_prf().
|
static |
Definition at line 314 of file nasl_crypto.c.
Referenced by tls_prf().
|
static |
Definition at line 157 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, TC::size, TC::str_val, and TC::x.
Referenced by nasl_cipher_des().
Definition at line 189 of file nasl_crypto.c.
References get_str_var_by_num(), get_var_size_by_num(), and nasl_cipher().
|
static |
Definition at line 68 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, nasl_perror(), TC::size, TC::str_val, and TC::x.
Referenced by nasl_hash(), nasl_hmac(), and nasl_nt_owf_gen().
Definition at line 246 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_int_var_by_name(), get_str_var_by_name(), nasl_perror(), simple_packet_signature_ntlmssp(), TC::size, TC::str_val, and TC::x.
Definition at line 571 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), hmac_sha256(), nasl_perror(), TC::size, TC::str_val, and TC::x.
Definition at line 112 of file nasl_crypto.c.
References get_str_var_by_num(), get_var_size_by_num(), and nasl_gcrypt_hash().
Referenced by nasl_md2(), nasl_md4(), nasl_md5(), nasl_ripemd160(), nasl_sha1(), and nasl_sha256().
Definition at line 204 of file nasl_crypto.c.
References get_str_var_by_name(), get_var_size_by_name(), and nasl_gcrypt_hash().
Referenced by nasl_hmac_md2(), nasl_hmac_md5(), nasl_hmac_ripemd160(), nasl_hmac_sha1(), nasl_hmac_sha384(), and nasl_hmac_sha512().
Definition at line 215 of file nasl_crypto.c.
References nasl_hmac().
Definition at line 221 of file nasl_crypto.c.
References nasl_hmac().
Definition at line 239 of file nasl_crypto.c.
References nasl_hmac().
Definition at line 227 of file nasl_crypto.c.
References nasl_hmac().
Definition at line 349 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), hmac_sha256(), nasl_perror(), TC::size, TC::str_val, and TC::x.
Definition at line 233 of file nasl_crypto.c.
References nasl_hmac().
Definition at line 565 of file nasl_crypto.c.
References nasl_hmac().
Definition at line 835 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), TC::size, TC::str_val, uchar, val, and TC::x.
Definition at line 725 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), nasl_perror(), ntlmssp_genauth_keyexchg(), TC::size, TC::str_val, and TC::x.
Definition at line 806 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, E_P16(), get_str_var_by_num(), get_var_size_by_num(), nasl_perror(), TC::size, TC::str_val, uchar, and TC::x.
Definition at line 121 of file nasl_crypto.c.
References nasl_hash().
Definition at line 127 of file nasl_crypto.c.
References nasl_hash().
Definition at line 133 of file nasl_crypto.c.
References nasl_hash().
Definition at line 787 of file nasl_crypto.c.
References get_str_var_by_num(), nasl_gcrypt_hash(), and nasl_perror().
Definition at line 652 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), ntlmssp_genauth_ntlm2(), TC::size, TC::str_val, and TC::x.
Definition at line 687 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), ntlmssp_genauth_ntlm(), TC::size, TC::str_val, and TC::x.
Definition at line 755 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, E_P24(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), TC::size, TC::str_val, uchar, and TC::x.
Definition at line 963 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), TC::size, SMBOWFencrypt_ntv2_ntlmssp(), TC::str_val, uchar, and TC::x.
Definition at line 608 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_int_var_by_name(), get_str_var_by_name(), nasl_perror(), ntlmssp_genauth_ntlmv2(), TC::size, TC::str_val, and TC::x.
Definition at line 876 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_str_var_by_name(), get_var_size_by_name(), hmac_md5_final(), hmac_md5_init_limK_to_64(), hmac_md5_update(), nasl_perror(), TC::size, TC::str_val, strupper_w(), uchar, and TC::x.
Definition at line 513 of file nasl_crypto.c.
References alloc_typed_cell(), CONST_DATA, get_int_var_by_name(), get_str_var_by_name(), get_var_size_by_name(), nasl_perror(), TC::size, TC::str_val, tls1_prf(), tls_prf(), and TC::x.
Referenced by nasl_prf_sha256(), nasl_prf_sha384(), and nasl_tls1_prf().
Definition at line 547 of file nasl_crypto.c.
References nasl_prf().
Definition at line 553 of file nasl_crypto.c.
References nasl_prf().
Definition at line 151 of file nasl_crypto.c.
References nasl_hash().
Definition at line 139 of file nasl_crypto.c.
References nasl_hash().
Definition at line 145 of file nasl_crypto.c.
References nasl_hash().
Definition at line 559 of file nasl_crypto.c.
References nasl_prf().
|
static |
Definition at line 461 of file nasl_crypto.c.
References tls_prf().
Referenced by nasl_prf().
|
static |
Definition at line 378 of file nasl_crypto.c.
References hmac_md5_for_prf(), hmac_sha1(), hmac_sha256(), and hmac_sha384().
Referenced by nasl_prf(), and tls1_prf().