|
OpenVAS Scanner 23.40.3
|
#include "nasl_krb5.h"#include "../misc/openvas-krb5.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 <stdio.h>
Go to the source code of this file.
Macros | |
| #define | NASL_PRINT_KRB_ERROR(lexic, credential, result) |
| #define | SET_SLICE_FROM_LEX_OR_ENV(lexic, slice, name, env_name) |
| #define | PERROR_SET_SLICE_FROM_LEX_OR_ENV(lexic, slice, name, env_name) |
Variables | |
| static OKrb5ErrorCode | last_okrb5_result |
| static struct OKrb5GSSContext * | cached_gss_context = NULL |
| static struct OKrb5Slice * | to_application = NULL |
| static bool | gss_update_context_more = false |
| #define NASL_PRINT_KRB_ERROR | ( | lexic, | |
| credential, | |||
| result ) |
Definition at line 17 of file nasl_krb5.c.
Referenced by build_krb5_credential(), nasl_okrb5_add_realm(), and nasl_okrb5_find_kdc().
| #define PERROR_SET_SLICE_FROM_LEX_OR_ENV | ( | lexic, | |
| slice, | |||
| name, | |||
| env_name ) |
Definition at line 62 of file nasl_krb5.c.
Referenced by build_krb5_credential().
| #define SET_SLICE_FROM_LEX_OR_ENV | ( | lexic, | |
| slice, | |||
| name, | |||
| env_name ) |
Definition at line 51 of file nasl_krb5.c.
Referenced by build_krb5_credential().
|
static |
Definition at line 76 of file nasl_krb5.c.
References code, OKrb5Credential::config_path, OKrb5Slice::data, OKrb5Target::domain, free(), OKrb5Target::host_name, OKrb5Credential::kdc, OKrb5Slice::len, NASL_PRINT_KRB_ERROR, o_krb5_add_realm(), O_KRB5_CONF_NOT_FOUND, o_krb5_find_kdc(), O_KRB5_REALM_NOT_FOUND, okrb5_set_slice_from_str, OKrb5User::password, PERROR_SET_SLICE_FROM_LEX_OR_ENV, OKrb5Credential::realm, OKrb5Target::service, SET_SLICE_FROM_LEX_OR_ENV, OKrb5Credential::target, OKrb5Credential::user, and OKrb5User::user.
Referenced by nasl_okrb5_add_realm(), nasl_okrb5_find_kdc(), and nasl_okrb5_gss_prepare_context().


Adds the given KDC to the given Realm.
This function returns 0 on success. To retrieve a human readable error message, the function okrb5_result can be used.
The nasl function has three optional parameter:
This function should only be used for debug purposes.
| [in] | lexic | NASL lexer. |
Definition at line 172 of file nasl_krb5.c.
References alloc_typed_cell(), build_krb5_credential(), CONST_INT, get_str_var_by_name(), TC::i_val, last_okrb5_result, NASL_PRINT_KRB_ERROR, o_krb5_add_realm(), O_KRB5_EXPECTED_NOT_NULL, and TC::x.

| void nasl_okrb5_clean | ( | void | ) |
Definition at line 314 of file nasl_krb5.c.
References cached_gss_context, free(), okrb5_gss_free_context(), and to_application.
Referenced by openvas().


Definition at line 381 of file nasl_krb5.c.
References alloc_typed_cell(), CONST_STR, last_okrb5_result, okrb5_error_code_to_string(), TC::size, TC::str_val, and TC::x.

Returns the defined KDC of a given Realm.
This function returns the KDC of a given Realm. The Realm is defined in the krb5.conf file. If there is no KDC for the given Realm, the function returns NULL within the tree_cell to the script.
The nasl function has two optional parameter:
This function should only be used for debug purposes.
| [in] | lexic | NASL lexer. |
Definition at line 151 of file nasl_krb5.c.
References alloc_typed_cell(), build_krb5_credential(), CONST_DATA, FAKE_CELL, last_okrb5_result, NASL_PRINT_KRB_ERROR, o_krb5_find_kdc(), TC::size, TC::str_val, and TC::x.

Definition at line 245 of file nasl_krb5.c.
References alloc_typed_cell(), cached_gss_context, CONST_INT, TC::i_val, last_okrb5_result, O_KRB5_EXPECTED_NOT_NULL, O_KRB5_SUCCESS, okrb5_gss_init_context(), and TC::x.

Definition at line 262 of file nasl_krb5.c.
References alloc_typed_cell(), build_krb5_credential(), cached_gss_context, CONST_INT, TC::i_val, last_okrb5_result, o_krb5_gss_prepare_context(), O_KRB5_SUCCESS, okrb5_gss_init_context(), and TC::x.

Definition at line 362 of file nasl_krb5.c.
References cached_gss_context, FAKE_CELL, last_okrb5_result, O_KRB5_EXPECTED_NOT_NULL, o_krb5_gss_session_key_context(), O_KRB5_SUCCESS, and okrb5_slice_to_tree_cell().

Definition at line 282 of file nasl_krb5.c.
References alloc_typed_cell(), cached_gss_context, CONST_INT, OKrb5Slice::data, free(), get_str_var_by_num(), get_var_size_by_num(), gss_update_context_more, TC::i_val, last_okrb5_result, OKrb5Slice::len, O_KRB5_EXPECTED_NOT_NULL, o_krb5_gss_update_context(), O_KRB5_SUCCESS, to_application, and TC::x.

Definition at line 329 of file nasl_krb5.c.
References alloc_typed_cell(), CONST_INT, gss_update_context_more, TC::i_val, and TC::x.

Definition at line 347 of file nasl_krb5.c.
References FAKE_CELL, okrb5_slice_to_tree_cell(), and to_application.

Returns 0 if the krb5 function was successful and 1 if it failed.
The nasl function has one optional parameter:
| [in] | lexic | NASL lexer. |
Definition at line 235 of file nasl_krb5.c.
References alloc_typed_cell(), CONST_INT, get_int_var_by_num(), TC::i_val, last_okrb5_result, O_KRB5_SUCCESS, and TC::x.

Returns 1 if the krb5 function was successful 0 otherwise.
The nasl function has one optional parameter:
| [in] | lexic | NASL lexer. |
Definition at line 214 of file nasl_krb5.c.
References alloc_typed_cell(), CONST_INT, get_int_var_by_num(), TC::i_val, last_okrb5_result, O_KRB5_SUCCESS, and TC::x.

|
inlinestatic |
Definition at line 338 of file nasl_krb5.c.
References alloc_typed_cell(), CONST_DATA, OKrb5Slice::data, OKrb5Slice::len, TC::size, TC::str_val, and TC::x.
Referenced by nasl_okrb5_gss_session_key_context(), and nasl_okrb5_gss_update_context_out().


|
static |
Definition at line 41 of file nasl_krb5.c.
Referenced by nasl_okrb5_clean(), nasl_okrb5_gss_init(), nasl_okrb5_gss_prepare_context(), nasl_okrb5_gss_session_key_context(), and nasl_okrb5_gss_update_context().
|
static |
Definition at line 49 of file nasl_krb5.c.
Referenced by nasl_okrb5_gss_update_context(), and nasl_okrb5_gss_update_context_needs_more().
|
static |
Definition at line 33 of file nasl_krb5.c.
Referenced by nasl_okrb5_add_realm(), nasl_okrb5_error_code_to_string(), nasl_okrb5_find_kdc(), nasl_okrb5_gss_init(), nasl_okrb5_gss_prepare_context(), nasl_okrb5_gss_session_key_context(), nasl_okrb5_gss_update_context(), nasl_okrb5_is_failure(), and nasl_okrb5_is_success().
|
static |
Definition at line 45 of file nasl_krb5.c.
Referenced by nasl_okrb5_clean(), nasl_okrb5_gss_update_context(), and nasl_okrb5_gss_update_context_out().