gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xfinish.c
Go to the documentation of this file.
1 /* xfinish.c --- Finish libgsasl session.
2  * Copyright (C) 2002-2021 Simon Josefsson
3  *
4  * This file is part of GNU SASL Library.
5  *
6  * GNU SASL Library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation; either version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * GNU SASL Library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License License along with GNU SASL Library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "internal.h"
24 
25 /**
26  * gsasl_finish:
27  * @sctx: libgsasl session handle.
28  *
29  * Destroy a libgsasl client or server handle. The handle must not be
30  * used with other libgsasl functions after this call.
31  **/
32 void
34 {
35  if (sctx == NULL)
36  return;
37 
38  if (sctx->clientp)
39  {
40  if (sctx->mech && sctx->mech->client.finish)
41  sctx->mech->client.finish (sctx, sctx->mech_data);
42  }
43  else
44  {
45  if (sctx->mech && sctx->mech->server.finish)
46  sctx->mech->server.finish (sctx, sctx->mech_data);
47  }
48 
49  free (sctx->anonymous_token);
50  free (sctx->authid);
51  free (sctx->authzid);
52  free (sctx->password);
53  free (sctx->passcode);
54  free (sctx->pin);
55  free (sctx->suggestedpin);
56  free (sctx->service);
57  free (sctx->hostname);
58  free (sctx->gssapi_display_name);
59  free (sctx->realm);
60  free (sctx->digest_md5_hashed_password);
61  free (sctx->qops);
62  free (sctx->qop);
63  free (sctx->scram_iter);
64  free (sctx->scram_salt);
65  free (sctx->scram_salted_password);
66  free (sctx->scram_serverkey);
67  free (sctx->scram_storedkey);
68  free (sctx->cb_tls_unique);
69  free (sctx->saml20_idp_identifier);
70  free (sctx->saml20_redirect_url);
71  free (sctx->openid20_redirect_url);
72  free (sctx->openid20_outcome_data);
73  /* If you add anything here, remember to change change
74  gsasl_finish() in xfinish.c and Gsasl_session in internal.h. */
75 
76  free (sctx);
77 }
#define NULL
Definition: stddef.in.h:72
Gsasl_finish_function finish
Definition: gsasl-mech.h:45
struct Gsasl_mechanism_functions server
Definition: gsasl-mech.h:57
struct Gsasl_mechanism_functions client
Definition: gsasl-mech.h:56
void * mech_data
Definition: internal.h:83
char * qops
Definition: internal.h:99
Gsasl_mechanism * mech
Definition: internal.h:82
char * hostname
Definition: internal.h:95
char * authid
Definition: internal.h:88
char * openid20_redirect_url
Definition: internal.h:109
char * service
Definition: internal.h:94
char * qop
Definition: internal.h:100
char * scram_salted_password
Definition: internal.h:103
char * gssapi_display_name
Definition: internal.h:96
char * pin
Definition: internal.h:92
char * cb_tls_unique
Definition: internal.h:106
char * scram_storedkey
Definition: internal.h:105
char * saml20_redirect_url
Definition: internal.h:108
char * scram_salt
Definition: internal.h:102
char * scram_iter
Definition: internal.h:101
char * passcode
Definition: internal.h:91
char * anonymous_token
Definition: internal.h:87
char * password
Definition: internal.h:90
char * openid20_outcome_data
Definition: internal.h:110
char * suggestedpin
Definition: internal.h:93
char * digest_md5_hashed_password
Definition: internal.h:98
char * authzid
Definition: internal.h:89
char * realm
Definition: internal.h:97
char * scram_serverkey
Definition: internal.h:104
char * saml20_idp_identifier
Definition: internal.h:107
void gsasl_finish(Gsasl_session *sctx)
Definition: xfinish.c:33