Lines Matching defs:auth_context

1 /*	$NetBSD: auth_context.c,v 1.5 2023/06/19 21:41:44 christos Exp $	*/
42 * @param auth_context The authentication context to be initialized.
50 krb5_auth_context *auth_context)
73 *auth_context = p;
82 * @param auth_context The authentication context to be deallocated.
88 krb5_auth_context auth_context)
90 if (auth_context != NULL) {
91 krb5_free_authenticator(context, &auth_context->authenticator);
92 if(auth_context->local_address){
93 free_HostAddress(auth_context->local_address);
94 free(auth_context->local_address);
96 if(auth_context->remote_address){
97 free_HostAddress(auth_context->remote_address);
98 free(auth_context->remote_address);
100 krb5_free_keyblock(context, auth_context->keyblock);
101 krb5_free_keyblock(context, auth_context->remote_subkey);
102 krb5_free_keyblock(context, auth_context->local_subkey);
103 if (auth_context->auth_data) {
104 free_AuthorizationData(auth_context->auth_data);
105 free(auth_context->auth_data);
107 free (auth_context);
114 krb5_auth_context auth_context,
117 auth_context->flags = flags;
124 krb5_auth_context auth_context,
127 *flags = auth_context->flags;
133 krb5_auth_context auth_context,
138 *flags = auth_context->flags;
139 auth_context->flags |= addflags;
145 krb5_auth_context auth_context,
150 *flags = auth_context->flags;
151 auth_context->flags &= ~removeflags;
157 krb5_auth_context auth_context,
162 if (auth_context->local_address)
163 krb5_free_address (context, auth_context->local_address);
165 if ((auth_context->local_address = malloc(sizeof(krb5_address))) == NULL)
167 krb5_copy_address(context, local_addr, auth_context->local_address);
170 if (auth_context->remote_address)
171 krb5_free_address (context, auth_context->remote_address);
173 if ((auth_context->remote_address = malloc(sizeof(krb5_address))) == NULL)
175 krb5_copy_address(context, remote_addr, auth_context->remote_address);
181 * Update the authentication context \a auth_context with the local
188 krb5_auth_context auth_context,
200 if (auth_context->local_address == NULL) {
212 krb5_sockaddr2port (context, local, &auth_context->local_port);
214 auth_context->local_port = 0;
230 krb5_sockaddr2port (context, remote, &auth_context->remote_port);
232 auth_context->remote_port = 0;
236 auth_context,
250 krb5_auth_context auth_context,
255 if(auth_context->local_address == NULL)
257 if(auth_context->remote_address == NULL)
259 return krb5_auth_con_genaddrs(context, auth_context, fd, flags);
264 krb5_auth_context auth_context,
274 auth_context->local_address,
286 auth_context->remote_address,
305 krb5_auth_context auth_context,
308 return copy_key(context, auth_context->keyblock, keyblock);
313 krb5_auth_context auth_context,
316 return copy_key(context, auth_context->local_subkey, keyblock);
322 krb5_auth_context auth_context,
325 return copy_key(context, auth_context->remote_subkey, keyblock);
330 krb5_auth_context auth_context,
333 if(auth_context->keyblock)
334 krb5_free_keyblock(context, auth_context->keyblock);
335 return copy_key(context, keyblock, &auth_context->keyblock);
340 krb5_auth_context auth_context,
343 if(auth_context->local_subkey)
344 krb5_free_keyblock(context, auth_context->local_subkey);
345 return copy_key(context, keyblock, &auth_context->local_subkey);
350 krb5_auth_context auth_context,
357 auth_context->keytype,
361 if(auth_context->local_subkey)
362 krb5_free_keyblock(context, auth_context->local_subkey);
363 auth_context->local_subkey = subkey;
370 krb5_auth_context auth_context,
373 if(auth_context->remote_subkey)
374 krb5_free_keyblock(context, auth_context->remote_subkey);
375 return copy_key(context, keyblock, &auth_context->remote_subkey);
380 krb5_auth_context auth_context,
383 auth_context->cksumtype = cksumtype;
389 krb5_auth_context auth_context,
392 *cksumtype = auth_context->cksumtype;
398 krb5_auth_context auth_context,
401 auth_context->keytype = keytype;
407 krb5_auth_context auth_context,
410 *keytype = auth_context->keytype;
416 krb5_auth_context auth_context,
422 if (auth_context->auth_data == NULL) {
423 auth_context->auth_data = calloc(1, sizeof(*auth_context->auth_data));
424 if (auth_context->auth_data == NULL)
431 return add_AuthorizationData(auth_context->auth_data, &el);
439 krb5_auth_context auth_context,
442 if(auth_context->keyblock)
443 krb5_free_keyblock(context, auth_context->keyblock);
444 ALLOC(auth_context->keyblock, 1);
445 if(auth_context->keyblock == NULL)
447 auth_context->keyblock->keytype = etype;
453 krb5_auth_context auth_context,
462 krb5_auth_context auth_context,
465 *seqnumber = auth_context->local_seqnumber;
471 krb5_auth_context auth_context,
474 auth_context->local_seqnumber = seqnumber;
480 krb5_auth_context auth_context,
483 *seqnumber = auth_context->remote_seqnumber;
489 krb5_auth_context auth_context,
492 auth_context->remote_seqnumber = seqnumber;
499 krb5_auth_context auth_context,
506 copy_Authenticator(auth_context->authenticator,
524 krb5_auth_context auth_context,
527 if(auth_context->keyblock)
528 krb5_free_keyblock(context, auth_context->keyblock);
529 return krb5_copy_keyblock(context, keyblock, &auth_context->keyblock);
534 krb5_auth_context auth_context,
537 *rcache = auth_context->rcache;
543 krb5_auth_context auth_context,
546 auth_context->rcache = rcache;
554 krb5_auth_context auth_context)
562 krb5_auth_context auth_context,