|
OpenVAS Scanner 23.32.3
|
Unix SMB/CIFS implementation: Character set conversion Extensions. More...
#include "byteorder.h"#include "iconv.h"#include "proto.h"#include "smb.h"#include <gvm/base/logging.h>
Go to the source code of this file.
Macros | |
| #define | uint8 uint8_t |
| #define | uint16 uint16_t |
| #define | _PUBLIC_ |
| #define | G_LOG_DOMAIN "lib nasl" |
| GLib logging domain. | |
| #define | False 0 |
| #define | True 1 |
Typedefs | |
| typedef unsigned int | bool |
Functions | |
| size_t | convert_string_ntlmssp (charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen, bool allow_badcharcnv) |
| static int | check_dos_char_slowly_ntlmssp (uint16 c) |
| static char | lp_failed_convert_char_ntlmssp (void) |
| static void | init_valid_table_ntlmssp (void) |
| static size_t | strlen_w_ntlmssp (const uint16 *src) |
| static const char * | charset_name_ntlmssp (charset_t ch) |
| void | lazy_initialize_conv_ntlmssp (void) |
| void | init_iconv_ntlmssp (void) |
| static size_t | convert_string_internal_ntlmssp (charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen, bool allow_bad_conv) |
Variables | |
| static uint8 * | valid_table_ntlmssp |
| static bool | valid_table_use_unmap_ntlmssp |
| static smb_iconv_t | conv_handles_ntlmssp [NUM_CHARSETS][NUM_CHARSETS] |
| static bool | conv_silent_ntlmssp |
Unix SMB/CIFS implementation: Character set conversion Extensions.
Character-set conversion routines built on our iconv.
MODIFICATIONS: only those functions that are required for OpenVAS are retained, others are removed Modified By Preeti Subramanian spree.nosp@m.ti@s.nosp@m.ecpod.nosp@m..com
Definition in file charcnv.c.
| #define False 0 |
Definition at line 63 of file charcnv.c.
Referenced by check_dos_char_slowly_ntlmssp(), E_deshash_ntlmssp(), generate_random_buffer_ntlmssp(), init_iconv_ntlmssp(), init_valid_table_ntlmssp(), and lazy_initialize_conv_ntlmssp().
| #define True 1 |
Definition at line 64 of file charcnv.c.
Referenced by E_deshash_ntlmssp(), generate_random_buffer_ntlmssp(), init_iconv_ntlmssp(), and lazy_initialize_conv_ntlmssp().
| #define uint16 uint16_t |
Definition at line 49 of file charcnv.c.
Referenced by check_dos_char_slowly_ntlmssp(), convert_string_internal_ntlmssp(), and strlen_w_ntlmssp().
| #define uint8 uint8_t |
Definition at line 45 of file charcnv.c.
Referenced by init_valid_table_ntlmssp(), ntlmssp_genauth_keyexchg(), SMBOWFencrypt_ntv2_ntlmssp(), SMBsesskeygen_lm_sess_key_ntlmssp(), SMBsesskeygen_ntv1_ntlmssp(), and SMBsesskeygen_ntv2_ntlmssp().
|
static |
Definition at line 182 of file charcnv.c.
References CH_UTF16BE, CH_UTF16LE, CH_UTF8, smb_iconv_close_ntlmssp(), and smb_iconv_open_ntlmssp().
Referenced by init_iconv_ntlmssp().


|
static |
Definition at line 73 of file charcnv.c.
References CH_DOS, CH_UTF16LE, convert_string_ntlmssp(), False, and uint16.
Referenced by init_valid_table_ntlmssp().


|
static |
Convert string from one encoding to another, making error checking etc Slow path version - uses (slow) iconv.
| src | pointer to source string (multibyte or singlebyte) |
| srclen | length of the source string in bytes |
| dest | pointer to destination string (multibyte or singlebyte) |
| destlen | maximal length allowed for string |
| allow_bad_conv | determines if a "best effort" conversion is acceptable (never returns errors) |
Ensure the srclen contains the terminating zero.
Definition at line 325 of file charcnv.c.
References CH_UTF16BE, CH_UTF16LE, conv_handles_ntlmssp, conv_silent_ntlmssp, EILSEQ, lazy_initialize_conv_ntlmssp(), lp_failed_convert_char_ntlmssp(), smb_iconv_ntlmssp(), strlen_w_ntlmssp(), and uint16.
Referenced by convert_string_ntlmssp().


| size_t convert_string_ntlmssp | ( | charset_t | from, |
| charset_t | to, | ||
| void const * | src, | ||
| size_t | srclen, | ||
| void * | dest, | ||
| size_t | destlen, | ||
| bool | allow_bad_conv ) |
Convert string from one encoding to another, making error checking etc Fast path version - handles ASCII first.
| src | pointer to source string (multibyte or singlebyte) |
| srclen | length of the source string in bytes, or -1 for nul terminated. |
| dest | pointer to destination string (multibyte or singlebyte) |
| destlen | maximal length allowed for string - NEVER -1. |
| allow_bad_conv | determines if a "best effort" conversion is acceptable (never returns errors) |
Ensure the srclen contains the terminating zero.
This function has been hand-tuned to provide a fast path. Don't change unless you really know what you are doing. JRA.
Definition at line 493 of file charcnv.c.
References CH_UTF16BE, CH_UTF16LE, and convert_string_internal_ntlmssp().
Referenced by check_dos_char_slowly_ntlmssp().


| void init_iconv_ntlmssp | ( | void | ) |
Initialize iconv conversion descriptors.
This is called the first time it is needed, and also called again every time the configuration is reloaded, because the charset or codepage might have changed.
Definition at line 245 of file charcnv.c.
References CH_UNIX, CH_UTF16BE, CH_UTF16LE, charset_name_ntlmssp(), conv_handles_ntlmssp, conv_silent_ntlmssp, False, init_valid_table_ntlmssp(), NUM_CHARSETS, smb_iconv_close_ntlmssp(), smb_iconv_open_ntlmssp(), and True.
Referenced by lazy_initialize_conv_ntlmssp().


|
static |
Definition at line 124 of file charcnv.c.
References check_dos_char_slowly_ntlmssp(), False, lazy_initialize_conv_ntlmssp(), SSVAL, uint8, valid_table_ntlmssp, and valid_table_use_unmap_ntlmssp.
Referenced by init_iconv_ntlmssp().


| void lazy_initialize_conv_ntlmssp | ( | void | ) |
Definition at line 226 of file charcnv.c.
References False, init_iconv_ntlmssp(), and True.
Referenced by convert_string_internal_ntlmssp(), and init_valid_table_ntlmssp().


|
static |
Definition at line 99 of file charcnv.c.
Referenced by convert_string_internal_ntlmssp().

|
static |
Definition at line 165 of file charcnv.c.
References COPY_UCS2_CHAR, len, and uint16.
Referenced by convert_string_internal_ntlmssp().

|
static |
Definition at line 119 of file charcnv.c.
Referenced by convert_string_internal_ntlmssp(), and init_iconv_ntlmssp().
|
static |
Definition at line 121 of file charcnv.c.
Referenced by convert_string_internal_ntlmssp(), and init_iconv_ntlmssp().
|
static |
Definition at line 66 of file charcnv.c.
Referenced by init_valid_table_ntlmssp().
|
static |
Definition at line 67 of file charcnv.c.
Referenced by init_valid_table_ntlmssp().