Skip to content

Commit

Permalink
Make many functions in auth.c static
Browse files Browse the repository at this point in the history
Now that cstp_obtain_cookie() has moved here where it arguably belongs,
that cleanup means we can stop exporting a whole bunch of the other
things it needed.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 26, 2015
1 parent 3a22e11 commit 317061d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 32 deletions.
47 changes: 24 additions & 23 deletions auth.c
Expand Up @@ -600,12 +600,30 @@ static void parse_config_node(struct openconnect_info *vpninfo, xmlNode *xml_nod
}
}

static void free_auth_form(struct oc_auth_form *form)
{
if (!form)
return;
while (form->opts) {
struct oc_form_opt *tmp = form->opts->next;
free_opt(form->opts);
form->opts = tmp;
}
free(form->error);
free(form->message);
free(form->banner);
free(form->auth_id);
free(form->method);
free(form->action);
free(form);
}

/* Return value:
* < 0, on error
* = 0, on success; *form is populated
*/
int parse_xml_response(struct openconnect_info *vpninfo, char *response, struct oc_auth_form **formp, int *cert_rq)
static int parse_xml_response(struct openconnect_info *vpninfo, char *response,
struct oc_auth_form **formp, int *cert_rq)
{
struct oc_auth_form *form;
xmlDocPtr xml_doc;
Expand Down Expand Up @@ -705,9 +723,9 @@ int parse_xml_response(struct openconnect_info *vpninfo, char *response, struct
* = OC_FORM_RESULT_CANCELLED, when response was cancelled by user
* = OC_FORM_RESULT_LOGGEDIN, when form indicates that login was already successful
*/
int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_form *form,
struct oc_text_buf *request_body, const char **method,
const char **request_body_type)
static int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_form *form,
struct oc_text_buf *request_body, const char **method,
const char **request_body_type)
{
int ret;
struct oc_vpn_option *opt, *next;
Expand Down Expand Up @@ -763,24 +781,6 @@ int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_form *form
return ret;
}

void free_auth_form(struct oc_auth_form *form)
{
if (!form)
return;
while (form->opts) {
struct oc_form_opt *tmp = form->opts->next;
free_opt(form->opts);
form->opts = tmp;
}
free(form->error);
free(form->message);
free(form->banner);
free(form->auth_id);
free(form->method);
free(form->action);
free(form);
}

/*
* Old submission format is just an HTTP query string:
*
Expand Down Expand Up @@ -875,7 +875,8 @@ static int xmlpost_complete(xmlDocPtr doc, struct oc_text_buf *body)
return ret;
}

int xmlpost_initial_req(struct openconnect_info *vpninfo, struct oc_text_buf *request_body, int cert_fail)
static int xmlpost_initial_req(struct openconnect_info *vpninfo,
struct oc_text_buf *request_body, int cert_fail)
{
xmlNodePtr root, node;
xmlDocPtr doc = xmlpost_new_query(vpninfo, "init", &root);
Expand Down
9 changes: 0 additions & 9 deletions openconnect-internal.h
Expand Up @@ -781,15 +781,6 @@ int do_gen_yubikey_code(struct openconnect_info *vpninfo,
struct oc_form_opt *opt);

/* auth.c */
int parse_xml_response(struct openconnect_info *vpninfo, char *response,
struct oc_auth_form **form, int *cert_rq);
int handle_auth_form(struct openconnect_info *vpninfo,
struct oc_auth_form *form,
struct oc_text_buf *request_body, const char **method,
const char **request_body_type);
void free_auth_form(struct oc_auth_form *form);
int xmlpost_initial_req(struct openconnect_info *vpninfo,
struct oc_text_buf *request_body, int cert_fail);
int cstp_obtain_cookie(struct openconnect_info *vpninfo);

/* http.c */
Expand Down

0 comments on commit 317061d

Please sign in to comment.