2 * Hotspot 2.0 - OSU client
3 * Copyright (c) 2013-2014, Qualcomm Atheros, Inc.
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
12 #define SPP_NS_URI "http://www.wi-fi.org/specifications/hotspot2dot0/v1.0/spp"
14 #define URN_OMA_DM_DEVINFO "urn:oma:mo:oma-dm-devinfo:1.0"
15 #define URN_OMA_DM_DEVDETAIL "urn:oma:mo:oma-dm-devdetail:1.0"
16 #define URN_HS20_DEVDETAIL_EXT "urn:wfa:mo-ext:hotspot2dot0-devdetail-ext:1.0"
17 #define URN_HS20_PPS "urn:wfa:mo:hotspot2dot0-perprovidersubscription:1.0"
20 #define MAX_OSU_VALS 10
22 struct osu_lang_text {
27 struct hs20_osu_client {
28 struct xml_node_ctx *xml;
29 struct http_ctx *http;
33 const char *result_file;
34 const char *summary_file;
37 int no_osu_cert_validation; /* for EST operations */
40 struct osu_lang_text friendly_name[MAX_OSU_VALS];
41 size_t friendly_name_count;
43 char icon_filename[MAX_OSU_VALS][256];
44 u8 icon_hash[MAX_OSU_VALS][32];
47 int client_cert_present;
48 char **server_dnsname;
49 size_t server_dnsname_count;
50 #define WORKAROUND_OCSP_OPTIONAL 0x00000001
51 unsigned long int workarounds;
57 void write_result(struct hs20_osu_client *ctx, const char *fmt, ...)
58 __attribute__ ((format (printf, 2, 3)));
59 void write_summary(struct hs20_osu_client *ctx, const char *fmt, ...)
60 __attribute__ ((format (printf, 2, 3)));
62 void debug_dump_node(struct hs20_osu_client *ctx, const char *title,
64 int osu_get_certificate(struct hs20_osu_client *ctx, xml_node_t *getcert);
65 int hs20_add_pps_mo(struct hs20_osu_client *ctx, const char *uri,
66 xml_node_t *add_mo, char *fname, size_t fname_len);
67 void get_user_pw(struct hs20_osu_client *ctx, xml_node_t *pps,
68 const char *alt_loc, char **user, char **pw);
69 int update_pps_file(struct hs20_osu_client *ctx, const char *pps_fname,
71 void cmd_set_pps(struct hs20_osu_client *ctx, const char *pps_fname);
76 void spp_sub_rem(struct hs20_osu_client *ctx, const char *address,
77 const char *pps_fname,
78 const char *client_cert, const char *client_key,
79 const char *cred_username, const char *cred_password,
81 void spp_pol_upd(struct hs20_osu_client *ctx, const char *address,
82 const char *pps_fname,
83 const char *client_cert, const char *client_key,
84 const char *cred_username, const char *cred_password,
86 int cmd_prov(struct hs20_osu_client *ctx, const char *url);
87 int cmd_sim_prov(struct hs20_osu_client *ctx, const char *url);
92 int cmd_oma_dm_prov(struct hs20_osu_client *ctx, const char *url);
93 int cmd_oma_dm_sim_prov(struct hs20_osu_client *ctx, const char *url);
94 void oma_dm_sub_rem(struct hs20_osu_client *ctx, const char *address,
95 const char *pps_fname,
96 const char *client_cert, const char *client_key,
97 const char *cred_username, const char *cred_password,
99 void oma_dm_pol_upd(struct hs20_osu_client *ctx, const char *address,
100 const char *pps_fname,
101 const char *client_cert, const char *client_key,
102 const char *cred_username, const char *cred_password,
104 void cmd_oma_dm_sub_rem(struct hs20_osu_client *ctx, const char *address,
105 const char *pps_fname);
106 void cmd_oma_dm_add(struct hs20_osu_client *ctx, const char *pps_fname,
107 const char *add_fname);
108 void cmd_oma_dm_replace(struct hs20_osu_client *ctx, const char *pps_fname,
109 const char *replace_fname);
113 int est_load_cacerts(struct hs20_osu_client *ctx, const char *url);
114 int est_build_csr(struct hs20_osu_client *ctx, const char *url);
115 int est_simple_enroll(struct hs20_osu_client *ctx, const char *url,
116 const char *user, const char *pw);
118 #endif /* OSU_CLIENT_H */