17#define NASL_PRINT_KRB_ERROR(lexic, credential, result) \
20 char *error_str = okrb5_error_code_to_string (result); \
22 lexic, "%s[config_path: '%s' realm: '%s' user: '%s'] => %s (%d)", \
23 __func__, credential.config_path.data, credential.realm.data, \
24 credential.user.user.data, error_str, result); \
51#define SET_SLICE_FROM_LEX_OR_ENV(lexic, slice, name, env_name) \
54 okrb5_set_slice_from_str (slice, get_str_var_by_name (lexic, name)); \
57 okrb5_set_slice_from_str (slice, getenv (env_name)); \
62#define PERROR_SET_SLICE_FROM_LEX_OR_ENV(lexic, slice, name, env_name) \
65 SET_SLICE_FROM_LEX_OR_ENV (lexic, slice, name, env_name); \
68 nasl_perror (lexic, "Expected %s or env variable %s", name, \
167 retc->
size = strlen (kdc);
179 kdc = getenv (
"KRB5_KDC");
tree_cell * nasl_okrb5_is_failure(lex_ctxt *lexic)
Returns 0 if the krb5 function was successful and 1 if it failed.
static struct OKrb5Slice * to_application
tree_cell * nasl_okrb5_find_kdc(lex_ctxt *lexic)
Returns the defined KDC of a given Realm.
tree_cell * nasl_okrb5_gss_session_key_context(lex_ctxt *lexic)
tree_cell * nasl_okrb5_add_realm(lex_ctxt *lexic)
Adds the given KDC to the given Realm.
tree_cell * nasl_okrb5_gss_update_context_out(lex_ctxt *lexic)
tree_cell * nasl_okrb5_gss_update_context_needs_more(lex_ctxt *lexic)
#define PERROR_SET_SLICE_FROM_LEX_OR_ENV(lexic, slice, name, env_name)
static struct OKrb5GSSContext * cached_gss_context
tree_cell * nasl_okrb5_gss_update_context(lex_ctxt *lexic)
tree_cell * nasl_okrb5_gss_prepare_context(lex_ctxt *lexic)
tree_cell * nasl_okrb5_error_code_to_string(lex_ctxt *lexic)
#define SET_SLICE_FROM_LEX_OR_ENV(lexic, slice, name, env_name)
tree_cell * nasl_okrb5_gss_init(lex_ctxt *lexic)
static OKrb5ErrorCode last_okrb5_result
tree_cell * nasl_okrb5_is_success(lex_ctxt *lexic)
Returns 1 if the krb5 function was successful 0 otherwise.
void nasl_okrb5_clean(void)
#define NASL_PRINT_KRB_ERROR(lexic, credential, result)
static OKrb5Credential build_krb5_credential(lex_ctxt *lexic)
static bool gss_update_context_more
static tree_cell * okrb5_slice_to_tree_cell(struct OKrb5Slice *slice)
long int get_var_size_by_num(lex_ctxt *, int)
struct struct_lex_ctxt lex_ctxt
char * get_str_var_by_name(lex_ctxt *, const char *)
char * get_str_var_by_num(lex_ctxt *, int)
long int get_int_var_by_num(lex_ctxt *, int, int)
tree_cell * alloc_typed_cell(int typ)
char * okrb5_error_code_to_string(const OKrb5ErrorCode code)
void okrb5_gss_free_context(struct OKrb5GSSContext *context)
OKrb5ErrorCode o_krb5_add_realm(const OKrb5Credential *creds, const char *kdc)
OKrb5ErrorCode o_krb5_find_kdc(const OKrb5Credential *creds, char **kdc)
OKrb5ErrorCode o_krb5_gss_prepare_context(const OKrb5Credential *creds, struct OKrb5GSSContext *gss_context)
OKrb5ErrorCode o_krb5_gss_session_key_context(struct OKrb5GSSContext *gss_context, struct OKrb5Slice **out)
struct OKrb5GSSContext * okrb5_gss_init_context(void)
OKrb5ErrorCode o_krb5_gss_update_context(struct OKrb5GSSContext *gss_context, const struct OKrb5Slice *in_data, struct OKrb5Slice **out_data, bool *more)
@ O_KRB5_EXPECTED_NOT_NULL
#define okrb5_set_slice_from_str(slice, str)
struct OKrb5Target target
struct OKrb5Slice config_path
struct OKrb5Slice service
struct OKrb5Slice host_name
struct OKrb5Slice password
union TC::@332262321161220155002104006201360276211317150140 x