OpenVAS Scanner 23.43.1
openvas-krb5.h File Reference
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for openvas-krb5.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  OKrb5Slice
struct  OKrb5User
struct  OKrb5Target
struct  OKrb5Credential

Macros

#define OPENVAS_KRB5_CACHED   1
#define okrb5_slice_from_str(str)
#define okrb5_set_slice_from_str(slice, str)

Typedefs

typedef struct OKrb5GSSContext OKrb5GSSContext

Enumerations

enum  OKrb5ErrorCode {
  O_KRB5_SUCCESS , O_KRB5_CONF_NOT_FOUND , O_KRB5_CONF_NOT_CREATED , O_KRB5_TMP_CONF_NOT_CREATED ,
  O_KRB5_TMP_CONF_NOT_MOVED , O_KRB5_REALM_NOT_FOUND , O_KRB5_EXPECTED_NULL , O_KRB5_EXPECTED_NOT_NULL ,
  O_KRB5_UNABLE_TO_WRITE , O_KRB5_NOMEM , O_KRB5_ERROR
}

Functions

OKrb5ErrorCode o_krb5_find_kdc (const OKrb5Credential *creds, char **kdc)
OKrb5ErrorCode o_krb5_add_realm (const OKrb5Credential *creds, const char *kdc)
OKrb5ErrorCode o_krb5_gss_session_key_context (struct OKrb5GSSContext *gss_context, struct OKrb5Slice **out)
struct OKrb5GSSContextokrb5_gss_init_context (void)
void okrb5_gss_free_context (struct OKrb5GSSContext *context)
OKrb5ErrorCode o_krb5_gss_prepare_context (const OKrb5Credential *creds, struct OKrb5GSSContext *gss_context)
OKrb5ErrorCode o_krb5_gss_update_context (struct OKrb5GSSContext *gss_context, const struct OKrb5Slice *in_data, struct OKrb5Slice **out_data, bool *more)
char * okrb5_error_code_to_string (const OKrb5ErrorCode code)

Macro Definition Documentation

◆ okrb5_set_slice_from_str

#define okrb5_set_slice_from_str ( slice,
str )
Value:
do \
{ \
slice.data = (void *) str; \
slice.len = str == NULL ? 0 : strlen (str); \
} \
while (0)

Definition at line 86 of file openvas-krb5.h.

86#define okrb5_set_slice_from_str(slice, str) \
87 do \
88 { \
89 slice.data = (void *) str; \
90 slice.len = str == NULL ? 0 : strlen (str); \
91 } \
92 while (0)

Referenced by build_krb5_credential().

◆ okrb5_slice_from_str

#define okrb5_slice_from_str ( str)
Value:
(struct OKrb5Slice) \
{ \
.data = (void *) str, .len = str == NULL ? 0 : strlen (str) \
}
uint8_t len

Definition at line 80 of file openvas-krb5.h.

80#define okrb5_slice_from_str(str) \
81 (struct OKrb5Slice) \
82 { \
83 .data = (void *) str, .len = str == NULL ? 0 : strlen (str) \
84 }

◆ OPENVAS_KRB5_CACHED

#define OPENVAS_KRB5_CACHED   1

Definition at line 14 of file openvas-krb5.h.

Typedef Documentation

◆ OKrb5GSSContext

typedef struct OKrb5GSSContext OKrb5GSSContext

Definition at line 94 of file openvas-krb5.h.

Enumeration Type Documentation

◆ OKrb5ErrorCode

Enumerator
O_KRB5_SUCCESS 
O_KRB5_CONF_NOT_FOUND 
O_KRB5_CONF_NOT_CREATED 
O_KRB5_TMP_CONF_NOT_CREATED 
O_KRB5_TMP_CONF_NOT_MOVED 
O_KRB5_REALM_NOT_FOUND 
O_KRB5_EXPECTED_NULL 
O_KRB5_EXPECTED_NOT_NULL 
O_KRB5_UNABLE_TO_WRITE 
O_KRB5_NOMEM 
O_KRB5_ERROR 

Definition at line 16 of file openvas-krb5.h.

17{
19 // Is returned when the krb5.conf was not found
28 // can only happen when GFP_ATOMIC is set on the kernel.
30
31 // Is an transitive error code to indicate an error originating from the
32 // underlying krb5 implementation. It must be last and can not check by equals
33 // operation as each krb5 error return will be added with that number
34 // representation,
OKrb5ErrorCode
@ O_KRB5_EXPECTED_NULL
@ O_KRB5_SUCCESS
@ O_KRB5_EXPECTED_NOT_NULL
@ O_KRB5_ERROR
@ O_KRB5_UNABLE_TO_WRITE
@ O_KRB5_NOMEM
@ O_KRB5_CONF_NOT_CREATED
@ O_KRB5_REALM_NOT_FOUND
@ O_KRB5_TMP_CONF_NOT_MOVED
@ O_KRB5_TMP_CONF_NOT_CREATED
@ O_KRB5_CONF_NOT_FOUND

Function Documentation

◆ o_krb5_add_realm()

OKrb5ErrorCode o_krb5_add_realm ( const OKrb5Credential * creds,
const char * kdc )

Definition at line 247 of file openvas-krb5.c.

248{
250 FILE *file = NULL, *tmp = NULL;
251 char line[MAX_LINE_LENGTH] = {0};
252 char tmpfn[MAX_LINE_LENGTH] = {0};
253 int state, i;
254 char *cp = (char *) creds->config_path.data;
255
256 if ((file = fopen (cp, "r")) == NULL)
257 {
258 if ((file = fopen (cp, "w")) == NULL)
259 {
261 goto result;
262 }
263 CHECK_FPRINT (result, file, "[realms]\n");
264 o_krb5_write_realm (file, creds, kdc);
265 goto result;
266 }
267 snprintf (tmpfn, MAX_LINE_LENGTH, "%s.tmp", cp);
268 if ((tmp = fopen (tmpfn, "w")) == NULL)
269 {
271 goto result;
272 }
273 state = 0;
274 while (fgets (line, MAX_LINE_LENGTH, file))
275 {
276 fputs (line, tmp);
277 if (state == 0)
278 {
279 SKIP_WS (line, MAX_LINE_LENGTH, 0, i);
280 if (IS_STR_EQUAL (line, MAX_LINE_LENGTH, i, "[realms]", 8) == 1)
281 {
282 o_krb5_write_realm (file, creds, kdc);
283
284 state = 1;
285 }
286 }
287 }
288
289 if (rename (tmpfn, cp) != 0)
290 {
292 }
293
294result:
295 if (tmp != NULL)
296 fclose (tmp);
297 if (file != NULL)
298 fclose (file);
299 return result;
300}
#define IS_STR_EQUAL(line, line_len, start, cmp, cmp_len)
#define CHECK_FPRINT(result, writer, fmt)
#define SKIP_WS(line, line_len, start, i)
#define MAX_LINE_LENGTH
static OKrb5ErrorCode o_krb5_write_realm(FILE *file, const OKrb5Credential *creds, const char *kdc)
struct OKrb5Slice config_path
void * data

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ o_krb5_find_kdc()

OKrb5ErrorCode o_krb5_find_kdc ( const OKrb5Credential * creds,
char ** kdc )

Definition at line 85 of file openvas-krb5.c.

86{
88 char line[MAX_LINE_LENGTH];
89 int state = 0;
90 size_t last_element;
91 size_t i, j;
92 FILE *file = NULL;
93
94 // we don't know if we should free it or just override it.
95 // aborting instead.
96 GUARD_NULL (*kdc, result);
97 if ((file = fopen ((char *) creds->config_path.data, "r")) == NULL)
98 {
99 result = O_KRB5_CONF_NOT_FOUND;
100 goto result;
101 }
102
103 while (fgets (line, MAX_LINE_LENGTH, file))
104 {
105 line[strcspn (line, "\n")] = 0;
106 last_element = strlen (line) - 1;
107 SKIP_WS (line, last_element, 0, i);
108 if (line[i] == '[' && line[last_element] == ']')
109 {
110 if (state != 0)
111 {
112 result = O_KRB5_REALM_NOT_FOUND;
113 goto result;
114 }
115 if (IS_STR_EQUAL (line, last_element + 1, i, "[realms]", 8) == 1)
116 {
117 state = 1;
118 }
119 }
120 else
121 {
122 if (line[i] == '}' || line[last_element] == '}')
123 {
124 state = 1;
125 }
126 else if (state == 1)
127 {
128 for (j = i; j <= last_element; j++)
129 {
130 if (line[j] != ((char *) creds->realm.data)[j - i])
131 {
132 state = 2;
133 break;
134 }
135 if (j - i >= creds->realm.len)
136 {
137 break;
138 }
139 }
140 if (j - i == creds->realm.len)
141 {
142 state = 3;
143 }
144 }
145 else if (state == 3)
146 {
147 if (IS_STR_EQUAL (line, last_element + 1, i, "kdc", 3))
148 {
149 SKIP_WS (line, last_element, i + 3, i);
150 if (line[i] == '=')
151 {
152 SKIP_WS (line, last_element, i + 1, i);
153 ALLOCATE_AND_CHECK (*kdc, char, (last_element - i) + 1,
154 result);
155 for (j = i; j <= last_element; j++)
156 {
157 (*kdc)[j - i] = line[j];
158 }
159
160 result = O_KRB5_SUCCESS;
161 goto result;
162 }
163 }
164 }
165 }
166 }
167
168result:
169 if (file != NULL)
170 {
171 fclose (file);
172 }
173 return result;
174}
#define GUARD_NULL(var, return_var)
#define ALLOCATE_AND_CHECK(var, type, n, return_var)
struct OKrb5Slice realm

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().

Here is the caller graph for this function:

◆ o_krb5_gss_prepare_context()

OKrb5ErrorCode o_krb5_gss_prepare_context ( const OKrb5Credential * creds,
struct OKrb5GSSContext * gss_context )

Definition at line 446 of file openvas-krb5.c.

448{
449 char *target_principal_str = NULL;
451
452 gss_name_t gss_target = GSS_C_NO_NAME;
453 OM_uint32 maj_stat;
454 OM_uint32 min_stat;
455 gss_buffer_desc targetbuf = GSS_C_EMPTY_BUFFER;
456 const struct OKrb5Target *target = &creds->target;
457
458 if (gss_context->gss_creds == GSS_C_NO_CREDENTIAL)
459 {
460 if ((result = okrb5_gss_authenticate (creds, gss_context)))
461 {
462 goto result;
463 }
464 }
465
466 if (target->domain.len != 0)
467 {
468 ALLOCATE_AND_CHECK (target_principal_str, char,
469 target->host_name.len + target->domain.len
470 + target->service.len + creds->realm.len + 4,
471 result);
472 snprintf (target_principal_str,
473 target->host_name.len + target->domain.len + target->service.len
474 + creds->realm.len + 4,
475 "%.*s/%.*s/%.*s@%.*s", (int) target->service.len,
476 (char *) target->service.data, (int) target->host_name.len,
477 (char *) target->host_name.data, (int) target->domain.len,
478 (char *) target->domain.data, (int) creds->realm.len,
479 (char *) creds->realm.data);
480 }
481 else
482 {
483 ALLOCATE_AND_CHECK (target_principal_str, char,
484 target->host_name.len + target->service.len
485 + creds->realm.len + 3,
486 result);
487 snprintf (target_principal_str,
488 target->host_name.len + target->service.len + creds->realm.len
489 + 3,
490 "%.*s/%.*s@%.*s", (int) target->service.len,
491 (char *) target->service.data, (int) target->host_name.len,
492 (char *) target->host_name.data, (int) creds->realm.len,
493 (char *) creds->realm.data);
494 }
495
496 targetbuf = (gss_buffer_desc) {
497 .value = target_principal_str,
498 .length = strlen (target_principal_str),
499 };
500
501 maj_stat = gss_import_name (&min_stat, &targetbuf,
502 // might also be GSS_C_NT_HOSTBASED_SERVICE,
503 // but samba uses GSS_C_NT_USER_NAME
504 GSS_C_NT_USER_NAME, &gss_target);
505 if (maj_stat != GSS_S_COMPLETE)
506 {
507 result = O_KRB5_ERROR + maj_stat;
508 goto result;
509 }
510
511 gss_context->gss_target = gss_target;
512 gss_context->gss_mech = gss_mech_spnego;
513 gss_context->gss_want_flags = GSS_C_MUTUAL_FLAG | GSS_C_DELEG_POLICY_FLAG
514 | GSS_C_REPLAY_FLAG | GSS_C_SEQUENCE_FLAG
515 | GSS_C_INTEG_FLAG | GSS_C_CONF_FLAG;
516 gss_context->gss_got_flags = 0;
517 gss_context->gss_channel_bindings = GSS_C_NO_CHANNEL_BINDINGS;
518 gss_context->gss_time_req = 0;
519 gss_context->gss_time_rec = 0;
520 gss_context->gss_actual_mech_type = NULL;
521result:
522 if (target_principal_str != NULL)
523 free (target_principal_str);
524
525 return result;
526}
void free(void *)
#define gss_mech_spnego
static OKrb5ErrorCode okrb5_gss_authenticate(const OKrb5Credential *creds, struct OKrb5GSSContext *gss_creds)
struct OKrb5Target target
OM_uint32 gss_want_flags
gss_cred_id_t gss_creds
gss_name_t gss_target
gss_channel_bindings_t gss_channel_bindings
OM_uint32 gss_time_req
OM_uint32 gss_got_flags
OM_uint32 gss_time_rec
gss_OID gss_actual_mech_type
struct OKrb5Slice service
struct OKrb5Slice domain
struct OKrb5Slice host_name

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ o_krb5_gss_session_key_context()

OKrb5ErrorCode o_krb5_gss_session_key_context ( struct OKrb5GSSContext * gss_context,
struct OKrb5Slice ** out )

Definition at line 571 of file openvas-krb5.c.

573{
574 OM_uint32 maj_stat;
575 OM_uint32 min_stat;
577 gss_OID_desc gse_sesskey_inq_oid = {
580 };
581 gss_buffer_set_t set = GSS_C_NO_BUFFER_SET;
582
583 maj_stat = gss_inquire_sec_context_by_oid (&min_stat, gss_context->gss_ctx,
584 &gse_sesskey_inq_oid, &set);
585 if (maj_stat != GSS_S_COMPLETE)
586 {
587 result = O_KRB5_ERROR + maj_stat;
588 goto result;
589 }
590
591 if ((set == GSS_C_NO_BUFFER_SET) || (set->count == 0)
592 || (set->elements[0].length == 0))
593 {
594 result = O_KRB5_ERROR + GSS_S_BAD_SIG;
595 goto result;
596 }
597
598 *out = calloc (1, sizeof (struct OKrb5Slice));
599 (*out)->data = malloc (set->elements[0].length);
600 memcpy ((*out)->data, set->elements[0].value, set->elements[0].length);
601 (*out)->len = set->elements[0].length;
602 gss_release_buffer_set (&min_stat, &set);
603result:
604 return result;
605}
void * malloc(YYSIZE_T)
#define GSS_KRB5_INQ_SSPI_SESSION_KEY_OID_LENGTH
#define GSS_KRB5_INQ_SSPI_SESSION_KEY_OID
gss_ctx_id_t gss_ctx

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ o_krb5_gss_update_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 529 of file openvas-krb5.c.

532{
533 OM_uint32 maj_stat;
534 OM_uint32 min_stat;
536 gss_buffer_desc in_buf = {
537 .length = in_data->len,
538 .value = in_data->data,
539 };
540 gss_buffer_desc out_buf = GSS_C_EMPTY_BUFFER;
541
542 maj_stat = gss_init_sec_context (
543 &min_stat, gss_context->gss_creds, &gss_context->gss_ctx,
544 gss_context->gss_target, gss_context->gss_mech, gss_context->gss_want_flags,
545 gss_context->gss_time_req, gss_context->gss_channel_bindings, &in_buf,
546 &gss_context->gss_actual_mech_type, &out_buf, &gss_context->gss_got_flags,
547 &gss_context->gss_time_rec);
548 if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED)
549 {
550 result = O_KRB5_ERROR + maj_stat;
551 goto result;
552 }
553 if ((*out_data = malloc (sizeof (struct OKrb5Slice))) == NULL)
554 {
555 result = O_KRB5_NOMEM;
556 gss_release_buffer (&min_stat, &out_buf);
557 goto result;
558 }
559 // transfers ownership of out_buf.value into out_data->data.
560 // This simplifies the code as we don't have to alloc and check if the system
561 // had sufficient memory and don't have to memcpy.
562 (*out_data)->data = out_buf.value;
563 (*out_data)->len = out_buf.length;
564
565 *more = maj_stat == GSS_S_CONTINUE_NEEDED;
566result:
567 return result;
568}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ okrb5_error_code_to_string()

char * okrb5_error_code_to_string ( const OKrb5ErrorCode code)

Definition at line 608 of file openvas-krb5.c.

609{
610#define HEAP_STRING(var, s) \
611 do \
612 { \
613 var = calloc (1, strlen (s) + 1); \
614 snprintf (var, strlen (s) + 1, s); \
615 goto result; \
616 } \
617 while (0)
618
619 char *result = NULL;
620 switch (code)
621 {
622 case O_KRB5_SUCCESS:
623 HEAP_STRING (result, "success");
625 HEAP_STRING (result, "krb5.conf not found");
627 HEAP_STRING (result, "krb5.conf not created");
629 HEAP_STRING (result, "tmp krb5.conf not created");
631 HEAP_STRING (result, "tmp krb5.conf not moved");
633 HEAP_STRING (result, "realm not found");
635 HEAP_STRING (result, "expected null");
637 HEAP_STRING (result, "expected not null");
639 HEAP_STRING (result, "unable to write");
640 case O_KRB5_NOMEM:
641 HEAP_STRING (result, "no memory");
642 default:
643 if (code >= O_KRB5_ERROR)
644 {
645 int maj_stat = code - O_KRB5_ERROR;
646 OM_uint32 min_stat;
647 gss_buffer_desc msg;
648 OM_uint32 msg_ctx = 0;
649
650 (void) gss_display_status (&min_stat, maj_stat, GSS_C_GSS_CODE,
651 GSS_C_NULL_OID, &msg_ctx, &msg);
652 // Instead of calling gss_release_buffer, we transfer ownership of
653 // msg.value (a heap-allocated string) directly to result.
654 // The caller is responsible for freeing result later, this conforms
655 // to other values as well.
656 //
657 // msg itself is stack-allocated, but msg.value is dynamically
658 // allocated, so we must not call gss_release_buffer on msg after
659 // ownership transfer.
660 result = msg.value;
661 }
662 else
663 {
664 goto result;
665 }
666 }
667result:
668 return result;
669}
#define code
#define HEAP_STRING(var, s)

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().

Here is the caller graph for this function:

◆ okrb5_gss_free_context()

void okrb5_gss_free_context ( struct OKrb5GSSContext * context)

Definition at line 405 of file openvas-krb5.c.

406{
407 OM_uint32 min_stat;
408 if (context != NULL)
409 {
410 if (context->gss_creds != GSS_C_NO_CREDENTIAL)
411 {
412 gss_release_cred (&min_stat, &context->gss_creds);
413 }
414 if (context->gss_ctx != GSS_C_NO_CONTEXT)
415 {
416 gss_delete_sec_context (&min_stat, &context->gss_ctx,
417 GSS_C_NO_BUFFER);
418 }
419 if (context->gss_target != GSS_C_NO_NAME)
420 {
421 gss_release_name (&min_stat, &context->gss_target);
422 }
423 if (context->gss_mech != NULL && context->gss_mech != gss_mech_spnego)
424 {
425 gss_release_oid (&min_stat, &context->gss_mech);
426 }
427 if (context->gss_channel_bindings != GSS_C_NO_CHANNEL_BINDINGS)
428 {
429 gss_release_buffer (
430 NULL, &context->gss_channel_bindings->initiator_address);
431 gss_release_buffer (&min_stat,
432 &context->gss_channel_bindings->acceptor_address);
433 gss_release_buffer (&min_stat,
434 &context->gss_channel_bindings->application_data);
435 free (context->gss_channel_bindings);
436 }
437 if (context->gss_actual_mech_type != NULL)
438 {
439 gss_release_oid (&min_stat, &context->gss_actual_mech_type);
440 }
441 free (context);
442 }
443}

References free(), OKrb5GSSContext::gss_actual_mech_type, OKrb5GSSContext::gss_channel_bindings, OKrb5GSSContext::gss_creds, OKrb5GSSContext::gss_ctx, OKrb5GSSContext::gss_mech, gss_mech_spnego, and OKrb5GSSContext::gss_target.

Referenced by nasl_okrb5_clean().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ okrb5_gss_init_context()

struct OKrb5GSSContext * okrb5_gss_init_context ( void )

Definition at line 392 of file openvas-krb5.c.

393{
394 struct OKrb5GSSContext *context = calloc (1, sizeof (struct OKrb5GSSContext));
395 if (context == NULL)
396 {
397 return NULL;
398 }
399 context->gss_creds = GSS_C_NO_CREDENTIAL;
400 context->gss_ctx = GSS_C_NO_CONTEXT;
401 return context;
402}

References OKrb5GSSContext::gss_creds, and OKrb5GSSContext::gss_ctx.

Referenced by nasl_okrb5_gss_init(), and nasl_okrb5_gss_prepare_context().

Here is the caller graph for this function: