|
OpenVAS Scanner 23.32.3
|
#include "openvas-krb5.h"#include <ctype.h>#include <gssapi/gssapi.h>#include <gssapi/gssapi_krb5.h>#include <krb5/krb5.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>
Go to the source code of this file.
Data Structures | |
| struct | OKrb5GSSCredentials |
| struct | OKrb5GSSContext |
Macros | |
| #define | GUARD_NULL(var, return_var) |
| #define | GUARD_NOT_NULL(var, return_var) |
| #define | ALLOCATE_AND_CHECK(var, type, n, return_var) |
| #define | SKIP_WS(line, line_len, start, i) |
| #define | IS_STR_EQUAL(line, line_len, start, cmp, cmp_len) |
| #define | GSS_KRB5_INQ_SSPI_SESSION_KEY_OID_LENGTH 11 |
| #define | GSS_KRB5_INQ_SSPI_SESSION_KEY_OID "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x05\x05" |
| #define | gss_mech_spnego (&spnego_mech_oid_desc) |
| #define | ARRAY_SIZE(a) |
| #define | MAX_LINE_LENGTH 1024 |
| #define | CHECK_FPRINTF(result, writer, fmt, ...) |
| #define | CHECK_FPRINT(result, writer, fmt) |
| #define | CHECK_MAJOR_STAT() |
| #define | HEAP_STRING(var, s) |
Variables | |
| gss_OID_desc | spnego_mech_oid_desc = {6, (void *) "\x2b\x06\x01\x05\x05\x02"} |
| #define ALLOCATE_AND_CHECK | ( | var, | |
| type, | |||
| n, | |||
| return_var ) |
Definition at line 39 of file openvas-krb5.c.
Referenced by o_krb5_find_kdc(), o_krb5_gss_prepare_context(), and okrb5_gss_authenticate().
| #define ARRAY_SIZE | ( | a | ) |
Definition at line 80 of file openvas-krb5.c.
Referenced by okrb5_gss_authenticate().
| #define CHECK_FPRINT | ( | result, | |
| writer, | |||
| fmt ) |
Definition at line 187 of file openvas-krb5.c.
Referenced by o_krb5_add_realm(), and o_krb5_write_realm().
| #define CHECK_FPRINTF | ( | result, | |
| writer, | |||
| fmt, | |||
| ... ) |
Definition at line 176 of file openvas-krb5.c.
Referenced by o_krb5_write_realm(), and o_krb5_write_trimmed().
| #define CHECK_MAJOR_STAT | ( | ) |
Referenced by okrb5_gss_authenticate().
| #define GSS_KRB5_INQ_SSPI_SESSION_KEY_OID "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x05\x05" |
Definition at line 72 of file openvas-krb5.c.
Referenced by o_krb5_gss_session_key_context().
| #define GSS_KRB5_INQ_SSPI_SESSION_KEY_OID_LENGTH 11 |
Definition at line 70 of file openvas-krb5.c.
Referenced by o_krb5_gss_session_key_context().
| #define gss_mech_spnego (&spnego_mech_oid_desc) |
Definition at line 77 of file openvas-krb5.c.
Referenced by o_krb5_gss_prepare_context(), and okrb5_gss_authenticate().
| #define GUARD_NOT_NULL | ( | var, | |
| return_var ) |
Definition at line 28 of file openvas-krb5.c.
| #define GUARD_NULL | ( | var, | |
| return_var ) |
Definition at line 17 of file openvas-krb5.c.
Referenced by o_krb5_find_kdc().
| #define HEAP_STRING | ( | var, | |
| s ) |
Referenced by okrb5_error_code_to_string().
| #define IS_STR_EQUAL | ( | line, | |
| line_len, | |||
| start, | |||
| cmp, | |||
| cmp_len ) |
Definition at line 64 of file openvas-krb5.c.
Referenced by o_krb5_add_realm(), and o_krb5_find_kdc().
| #define MAX_LINE_LENGTH 1024 |
Definition at line 82 of file openvas-krb5.c.
Referenced by o_krb5_add_realm(), and o_krb5_find_kdc().
| #define SKIP_WS | ( | line, | |
| line_len, | |||
| start, | |||
| i ) |
Definition at line 51 of file openvas-krb5.c.
Referenced by o_krb5_add_realm(), and o_krb5_find_kdc().
| OKrb5ErrorCode o_krb5_add_realm | ( | const OKrb5Credential * | creds, |
| const char * | kdc ) |
Definition at line 247 of file openvas-krb5.c.
References CHECK_FPRINT, OKrb5Credential::config_path, OKrb5Slice::data, IS_STR_EQUAL, MAX_LINE_LENGTH, O_KRB5_CONF_NOT_CREATED, O_KRB5_SUCCESS, O_KRB5_TMP_CONF_NOT_CREATED, O_KRB5_TMP_CONF_NOT_MOVED, o_krb5_write_realm(), and SKIP_WS.
Referenced by build_krb5_credential(), and nasl_okrb5_add_realm().


| OKrb5ErrorCode o_krb5_find_kdc | ( | const OKrb5Credential * | creds, |
| char ** | kdc ) |
Definition at line 85 of file openvas-krb5.c.
References ALLOCATE_AND_CHECK, OKrb5Credential::config_path, OKrb5Slice::data, GUARD_NULL, IS_STR_EQUAL, OKrb5Slice::len, MAX_LINE_LENGTH, O_KRB5_CONF_NOT_FOUND, O_KRB5_REALM_NOT_FOUND, O_KRB5_SUCCESS, OKrb5Credential::realm, and SKIP_WS.
Referenced by build_krb5_credential(), and nasl_okrb5_find_kdc().

| OKrb5ErrorCode o_krb5_gss_prepare_context | ( | const OKrb5Credential * | creds, |
| struct OKrb5GSSContext * | gss_context ) |
Definition at line 445 of file openvas-krb5.c.
References ALLOCATE_AND_CHECK, OKrb5Slice::data, OKrb5Target::domain, free(), OKrb5GSSContext::gss_actual_mech_type, OKrb5GSSContext::gss_channel_bindings, OKrb5GSSContext::gss_creds, OKrb5GSSContext::gss_got_flags, OKrb5GSSContext::gss_mech, gss_mech_spnego, OKrb5GSSContext::gss_target, OKrb5GSSContext::gss_time_rec, OKrb5GSSContext::gss_time_req, OKrb5GSSContext::gss_want_flags, OKrb5Target::host_name, OKrb5Slice::len, O_KRB5_ERROR, O_KRB5_SUCCESS, okrb5_gss_authenticate(), OKrb5Credential::realm, OKrb5Target::service, and OKrb5Credential::target.
Referenced by nasl_okrb5_gss_prepare_context().


| OKrb5ErrorCode o_krb5_gss_session_key_context | ( | struct OKrb5GSSContext * | gss_context, |
| struct OKrb5Slice ** | out ) |
Definition at line 563 of file openvas-krb5.c.
References OKrb5GSSContext::gss_ctx, GSS_KRB5_INQ_SSPI_SESSION_KEY_OID, GSS_KRB5_INQ_SSPI_SESSION_KEY_OID_LENGTH, malloc(), O_KRB5_ERROR, and O_KRB5_SUCCESS.
Referenced by nasl_okrb5_gss_session_key_context().


| OKrb5ErrorCode o_krb5_gss_update_context | ( | struct OKrb5GSSContext * | gss_context, |
| const struct OKrb5Slice * | in_data, | ||
| struct OKrb5Slice ** | out_data, | ||
| bool * | more ) |
Definition at line 521 of file openvas-krb5.c.
References OKrb5Slice::data, OKrb5GSSContext::gss_actual_mech_type, OKrb5GSSContext::gss_channel_bindings, OKrb5GSSContext::gss_creds, OKrb5GSSContext::gss_ctx, OKrb5GSSContext::gss_got_flags, OKrb5GSSContext::gss_mech, OKrb5GSSContext::gss_target, OKrb5GSSContext::gss_time_rec, OKrb5GSSContext::gss_time_req, OKrb5GSSContext::gss_want_flags, OKrb5Slice::len, malloc(), O_KRB5_ERROR, O_KRB5_NOMEM, and O_KRB5_SUCCESS.
Referenced by nasl_okrb5_gss_update_context().


|
static |
Definition at line 215 of file openvas-krb5.c.
References CHECK_FPRINT, CHECK_FPRINTF, OKrb5Slice::data, O_KRB5_SUCCESS, o_krb5_write_trimmed(), and OKrb5Credential::realm.
Referenced by o_krb5_add_realm().


|
static |
Definition at line 199 of file openvas-krb5.c.
References CHECK_FPRINTF, O_KRB5_SUCCESS, and prefix().
Referenced by o_krb5_write_realm().


| char * okrb5_error_code_to_string | ( | const OKrb5ErrorCode | code | ) |
Definition at line 600 of file openvas-krb5.c.
References code, HEAP_STRING, O_KRB5_CONF_NOT_CREATED, O_KRB5_CONF_NOT_FOUND, O_KRB5_ERROR, O_KRB5_EXPECTED_NOT_NULL, O_KRB5_EXPECTED_NULL, O_KRB5_NOMEM, O_KRB5_REALM_NOT_FOUND, O_KRB5_SUCCESS, O_KRB5_TMP_CONF_NOT_CREATED, O_KRB5_TMP_CONF_NOT_MOVED, and O_KRB5_UNABLE_TO_WRITE.
Referenced by nasl_okrb5_error_code_to_string().

|
static |
Definition at line 322 of file openvas-krb5.c.
References ALLOCATE_AND_CHECK, ARRAY_SIZE, CHECK_MAJOR_STAT, OKrb5Slice::data, free(), OKrb5GSSContext::gss_creds, gss_mech_spnego, OKrb5Slice::len, O_KRB5_SUCCESS, OKrb5Credential::realm, OKrb5Credential::user, and OKrb5User::user.
Referenced by o_krb5_gss_prepare_context().


| void okrb5_gss_free_context | ( | struct OKrb5GSSContext * | context | ) |
Definition at line 405 of file openvas-krb5.c.
References free(), OKrb5GSSContext::gss_actual_mech_type, OKrb5GSSContext::gss_channel_bindings, OKrb5GSSContext::gss_creds, OKrb5GSSContext::gss_ctx, OKrb5GSSContext::gss_mech, and OKrb5GSSContext::gss_target.
Referenced by nasl_okrb5_clean().


| struct OKrb5GSSContext * okrb5_gss_init_context | ( | void | ) |
Definition at line 392 of file openvas-krb5.c.
References OKrb5GSSContext::gss_creds, and OKrb5GSSContext::gss_ctx.
Referenced by nasl_okrb5_gss_init(), and nasl_okrb5_gss_prepare_context().

| gss_OID_desc spnego_mech_oid_desc = {6, (void *) "\x2b\x06\x01\x05\x05\x02"} |
Definition at line 76 of file openvas-krb5.c.