Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 273) sorted by relevance

1234567891011

/hostap-latest/hs20/server/
Dspp_server.c49 static char * db_get_session_val(struct hs20_svc *ctx, const char *user,
52 static char * db_get_osu_config_val(struct hs20_svc *ctx, const char *realm,
54 static xml_node_t * build_policy(struct hs20_svc *ctx, const char *user,
56 static xml_node_t * spp_exec_get_certificate(struct hs20_svc *ctx,
63 static int db_add_session(struct hs20_svc *ctx, in db_add_session() argument
86 addr, ctx->test); in db_add_session()
89 debug_print(ctx, 1, "DB: %s", sql); in db_add_session()
90 if (sqlite3_exec(ctx->db, sql, NULL, NULL, NULL) != SQLITE_OK) { in db_add_session()
91 debug_print(ctx, 1, "Failed to add session entry into sqlite " in db_add_session()
92 "database: %s", sqlite3_errmsg(ctx->db)); in db_add_session()
[all …]
Dhs20_spp_server.c33 void debug_print(struct hs20_svc *ctx, int print, const char *fmt, ...) in debug_print() argument
37 if (ctx->debug_log == NULL) in debug_print()
40 write_timestamp(ctx->debug_log); in debug_print()
42 vfprintf(ctx->debug_log, fmt, ap); in debug_print()
45 fprintf(ctx->debug_log, "\n"); in debug_print()
49 void debug_dump_node(struct hs20_svc *ctx, const char *title, xml_node_t *node) in debug_dump_node() argument
53 if (ctx->debug_log == NULL) in debug_dump_node()
55 str = xml_node_to_str(ctx->xml, node); in debug_dump_node()
59 write_timestamp(ctx->debug_log); in debug_dump_node()
60 fprintf(ctx->debug_log, "%s: '%s'\n", title, str); in debug_dump_node()
[all …]
/hostap-latest/hs20/client/
Dspp_client.c26 static int hs20_spp_update_response(struct hs20_osu_client *ctx,
31 struct hs20_osu_client *ctx, const char *pps_fname);
34 static char * get_spp_attr_value(struct xml_node_ctx *ctx, xml_node_t *node, in get_spp_attr_value() argument
37 return xml_node_get_attr_value_ns(ctx, node, SPP_NS_URI, attr_name); in get_spp_attr_value()
41 static int hs20_spp_validate(struct hs20_osu_client *ctx, xml_node_t *node, in hs20_spp_validate() argument
44 struct xml_node_ctx *xctx = ctx->xml; in hs20_spp_validate()
59 write_summary(ctx, "Unexpected SOAP method name '%s' (expected '%s')", in hs20_spp_validate()
67 write_summary(ctx, "SPP XML schema validation failed"); in hs20_spp_validate()
74 static void add_mo_container(struct xml_node_ctx *ctx, xml_namespace_t *ns, in add_mo_container() argument
83 fnode = node_from_file(ctx, fname); in add_mo_container()
[all …]
Doma_dm_client.c66 static void add_item(struct hs20_osu_client *ctx, xml_node_t *parent,
78 static char * oma_dm_get_target_locuri(struct hs20_osu_client *ctx, in oma_dm_get_target_locuri() argument
84 locuri = get_node(ctx->xml, node, "Item/Target/LocURI"); in oma_dm_get_target_locuri()
88 uri = xml_node_get_text(ctx->xml, locuri); in oma_dm_get_target_locuri()
91 xml_node_get_text_free(ctx->xml, uri); in oma_dm_get_target_locuri()
96 static void oma_dm_add_locuri(struct hs20_osu_client *ctx, xml_node_t *parent, in oma_dm_add_locuri() argument
101 node = xml_node_create(ctx->xml, parent, NULL, element); in oma_dm_add_locuri()
104 xml_node_create_text(ctx->xml, node, NULL, "LocURI", uri); in oma_dm_add_locuri()
108 static xml_node_t * oma_dm_build_hdr(struct hs20_osu_client *ctx, in oma_dm_build_hdr() argument
114 if (!ctx->devid) { in oma_dm_build_hdr()
[all …]
Dosu_client.c31 void write_result(struct hs20_osu_client *ctx, const char *fmt, ...) in write_result() argument
40 write_summary(ctx, "%s", buf); in write_result()
42 if (!ctx->result_file) in write_result()
45 f = fopen(ctx->result_file, "w"); in write_result()
57 void write_summary(struct hs20_osu_client *ctx, const char *fmt, ...) in write_summary() argument
62 if (!ctx->summary_file) in write_summary()
65 f = fopen(ctx->summary_file, "a"); in write_summary()
77 void debug_dump_node(struct hs20_osu_client *ctx, const char *title, in debug_dump_node() argument
80 char *str = xml_node_to_str(ctx->xml, node); in debug_dump_node()
137 int osu_get_certificate(struct hs20_osu_client *ctx, xml_node_t *getcert) in osu_get_certificate() argument
[all …]
Dosu_client.h60 void write_result(struct hs20_osu_client *ctx, const char *fmt, ...)
62 void write_summary(struct hs20_osu_client *ctx, const char *fmt, ...)
65 void debug_dump_node(struct hs20_osu_client *ctx, const char *title,
67 int osu_get_certificate(struct hs20_osu_client *ctx, xml_node_t *getcert);
68 int hs20_add_pps_mo(struct hs20_osu_client *ctx, const char *uri,
70 void get_user_pw(struct hs20_osu_client *ctx, xml_node_t *pps,
72 int update_pps_file(struct hs20_osu_client *ctx, const char *pps_fname,
74 void cmd_set_pps(struct hs20_osu_client *ctx, const char *pps_fname);
79 void spp_sub_rem(struct hs20_osu_client *ctx, const char *address,
84 void spp_pol_upd(struct hs20_osu_client *ctx, const char *address,
[all …]
Dest.c28 static int pkcs7_to_cert(struct hs20_osu_client *ctx, const u8 *pkcs7, in pkcs7_to_cert() argument
49 write_result(ctx, "Could not parse PKCS#7 object from EST"); in pkcs7_to_cert()
57 write_result(ctx, "Could not parse PKCS#7 object from EST"); in pkcs7_to_cert()
76 write_result(ctx, "No certificates found in PKCS#7 object"); in pkcs7_to_cert()
118 int est_load_cacerts(struct hs20_osu_client *ctx, const char *url) in est_load_cacerts() argument
133 write_summary(ctx, "Download EST cacerts from %s", buf); in est_load_cacerts()
134 ctx->no_osu_cert_validation = 1; in est_load_cacerts()
135 http_ocsp_set(ctx->http, 1); in est_load_cacerts()
136 res = http_download_file(ctx->http, buf, "Cert/est-cacerts.txt", in est_load_cacerts()
137 ctx->ca_fname); in est_load_cacerts()
[all …]
/hostap-latest/tests/hwsim/
Dtest_eap_proto.py118 eap_req = self.eap_handler(self.ctx, eap)
143 self.ctx = {}
186 def eap_handler(ctx, req): argument
188 if 'num' not in ctx:
189 ctx['num'] = 0
190 ctx['num'] = ctx['num'] + 1
191 if 'id' not in ctx:
192 ctx['id'] = 1
193 ctx['id'] = (ctx['id'] + 1) % 256
197 if ctx['num'] == idx:
[all …]
/hostap-latest/src/crypto/
Dcrypto_internal.c42 struct crypto_hash *ctx; in crypto_hash_init() local
47 ctx = os_zalloc(sizeof(*ctx)); in crypto_hash_init()
48 if (ctx == NULL) in crypto_hash_init()
51 ctx->alg = alg; in crypto_hash_init()
55 MD5Init(&ctx->u.md5); in crypto_hash_init()
58 SHA1Init(&ctx->u.sha1); in crypto_hash_init()
62 sha256_init(&ctx->u.sha256); in crypto_hash_init()
67 sha384_init(&ctx->u.sha384); in crypto_hash_init()
72 sha512_init(&ctx->u.sha512); in crypto_hash_init()
77 MD5Init(&ctx->u.md5); in crypto_hash_init()
[all …]
Dcrypto_internal-cipher.c47 struct crypto_cipher *ctx; in crypto_cipher_init() local
49 ctx = os_zalloc(sizeof(*ctx)); in crypto_cipher_init()
50 if (ctx == NULL) in crypto_cipher_init()
53 ctx->alg = alg; in crypto_cipher_init()
57 if (key_len > sizeof(ctx->u.rc4.key)) { in crypto_cipher_init()
58 os_free(ctx); in crypto_cipher_init()
61 ctx->u.rc4.keylen = key_len; in crypto_cipher_init()
62 os_memcpy(ctx->u.rc4.key, key, key_len); in crypto_cipher_init()
65 ctx->u.aes.ctx_enc = aes_encrypt_init(key, key_len); in crypto_cipher_init()
66 if (ctx->u.aes.ctx_enc == NULL) { in crypto_cipher_init()
[all …]
Dcrypto_nettle.c31 struct des_ctx ctx; in des_encrypt() local
44 nettle_des_set_key(&ctx, pkey); in des_encrypt()
45 nettle_des_encrypt(&ctx, DES_BLOCK_SIZE, cypher, clear); in des_encrypt()
46 os_memset(&ctx, 0, sizeof(ctx)); in des_encrypt()
54 void *ctx; in nettle_digest_vector() local
60 ctx = os_malloc(alg->context_size); in nettle_digest_vector()
61 if (!ctx) in nettle_digest_vector()
63 alg->init(ctx); in nettle_digest_vector()
65 alg->update(ctx, len[i], addr[i]); in nettle_digest_vector()
66 alg->digest(ctx, alg->digest_size, mac); in nettle_digest_vector()
[all …]
Dcrypto_openssl.c57 HMAC_CTX *ctx; in HMAC_CTX_new() local
59 ctx = os_zalloc(sizeof(*ctx)); in HMAC_CTX_new()
60 if (ctx) in HMAC_CTX_new()
61 HMAC_CTX_init(ctx); in HMAC_CTX_new()
62 return ctx; in HMAC_CTX_new()
66 static void HMAC_CTX_free(HMAC_CTX *ctx) in HMAC_CTX_free() argument
68 if (!ctx) in HMAC_CTX_free()
70 HMAC_CTX_cleanup(ctx); in HMAC_CTX_free()
71 bin_clear_free(ctx, sizeof(*ctx)); in HMAC_CTX_free()
77 EVP_MD_CTX *ctx; in EVP_MD_CTX_new() local
[all …]
Dcrypto_libtomcrypt.c100 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument
102 symmetric_key *skey = ctx; in aes_encrypt()
107 void aes_encrypt_deinit(void *ctx) in aes_encrypt_deinit() argument
109 symmetric_key *skey = ctx; in aes_encrypt_deinit()
129 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument
131 symmetric_key *skey = ctx; in aes_decrypt()
136 void aes_decrypt_deinit(void *ctx) in aes_decrypt_deinit() argument
138 symmetric_key *skey = ctx; in aes_decrypt_deinit()
157 struct crypto_hash *ctx; in crypto_hash_init() local
159 ctx = os_zalloc(sizeof(*ctx)); in crypto_hash_init()
[all …]
/hostap-latest/src/rsn_supp/
Dwpa_i.h59 struct wpa_sm_ctx *ctx; member
243 WPA_ASSERT(sm->ctx->set_state); in wpa_sm_set_state()
244 sm->ctx->set_state(sm->ctx->ctx, state); in wpa_sm_set_state()
249 WPA_ASSERT(sm->ctx->get_state); in wpa_sm_get_state()
250 return sm->ctx->get_state(sm->ctx->ctx); in wpa_sm_get_state()
255 WPA_ASSERT(sm->ctx->deauthenticate); in wpa_sm_deauthenticate()
256 sm->ctx->deauthenticate(sm->ctx->ctx, reason_code); in wpa_sm_deauthenticate()
265 WPA_ASSERT(sm->ctx->set_key); in wpa_sm_set_key()
266 return sm->ctx->set_key(sm->ctx->ctx, link_id, alg, addr, key_idx, in wpa_sm_set_key()
272 WPA_ASSERT(sm->ctx->reconnect); in wpa_sm_reconnect()
[all …]
/hostap-latest/src/utils/
Dbrowser.c31 static void win_cb_destroy(GtkWidget *win, struct browser_context *ctx) in win_cb_destroy() argument
34 if (ctx->gtk_main_started) in win_cb_destroy()
39 static void browser_update_title(struct browser_context *ctx) in browser_update_title() argument
43 if (ctx->hover_link) { in browser_update_title()
44 gtk_window_set_title(GTK_WINDOW(ctx->win), ctx->hover_link); in browser_update_title()
48 if (ctx->progress == 100) { in browser_update_title()
49 gtk_window_set_title(GTK_WINDOW(ctx->win), in browser_update_title()
50 ctx->title ? ctx->title : in browser_update_title()
55 snprintf(buf, sizeof(buf), "[%d%%] %s", ctx->progress, in browser_update_title()
56 ctx->title ? ctx->title : "Hotspot 2.0 client"); in browser_update_title()
[all …]
Dxml-utils.c15 static xml_node_t * get_node_uri_iter(struct xml_node_ctx *ctx, in get_node_uri_iter() argument
27 xml_node_for_each_sibling(ctx, node) { in get_node_uri_iter()
28 xml_node_for_each_check(ctx, node); in get_node_uri_iter()
29 name = xml_node_get_localname(ctx, node); in get_node_uri_iter()
38 return get_node_uri_iter(ctx, xml_node_first_child(ctx, node), in get_node_uri_iter()
46 xml_node_t * get_node_uri(struct xml_node_ctx *ctx, xml_node_t *root, in get_node_uri() argument
56 node = get_node_uri_iter(ctx, root, search); in get_node_uri()
63 static xml_node_t * get_node_iter(struct xml_node_ctx *ctx, in get_node_iter() argument
74 xml_node_for_each_child(ctx, node, root) { in get_node_iter()
75 xml_node_for_each_check(ctx, node); in get_node_iter()
[all …]
Dxml-utils.h18 int xml_validate(struct xml_node_ctx *ctx, xml_node_t *node,
20 int xml_validate_dtd(struct xml_node_ctx *ctx, xml_node_t *node,
22 void xml_node_free(struct xml_node_ctx *ctx, xml_node_t *node);
23 xml_node_t * xml_node_get_parent(struct xml_node_ctx *ctx, xml_node_t *node);
24 xml_node_t * xml_node_from_buf(struct xml_node_ctx *ctx, const char *buf);
25 const char * xml_node_get_localname(struct xml_node_ctx *ctx,
27 char * xml_node_to_str(struct xml_node_ctx *ctx, xml_node_t *node);
28 void xml_node_detach(struct xml_node_ctx *ctx, xml_node_t *node);
29 void xml_node_add_child(struct xml_node_ctx *ctx, xml_node_t *parent,
31 xml_node_t * xml_node_create_root(struct xml_node_ctx *ctx, const char *ns_uri,
[all …]
Dhttp_curl.c43 void *ctx; member
56 int (*cert_cb)(void *ctx, struct http_cert *cert);
71 static void clear_curl(struct http_ctx *ctx) in clear_curl() argument
73 if (ctx->curl) { in clear_curl()
74 curl_easy_cleanup(ctx->curl); in clear_curl()
75 ctx->curl = NULL; in clear_curl()
77 if (ctx->curl_hdr) { in clear_curl()
78 curl_slist_free_all(ctx->curl_hdr); in clear_curl()
79 ctx->curl_hdr = NULL; in clear_curl()
94 static void debug_dump(struct http_ctx *ctx, const char *title, in debug_dump() argument
[all …]
/hostap-latest/tests/fuzzing/eapol-supp/
Deapol-supp.c29 struct arg_ctx *ctx = eloop_data; in test_send_eapol() local
34 wpa_hexdump(MSG_MSGDUMP, "fuzzer - EAPOL", ctx->data, ctx->data_len); in test_send_eapol()
36 eapol_sm_notify_portEnabled(ctx->eapol, true); in test_send_eapol()
38 wpa_sm_set_param(ctx->wpa, WPA_PARAM_PROTO, WPA_PROTO_RSN); in test_send_eapol()
39 wpa_sm_set_param(ctx->wpa, WPA_PARAM_RSN_ENABLED, 1); in test_send_eapol()
40 wpa_sm_set_param(ctx->wpa, WPA_PARAM_KEY_MGMT, WPA_KEY_MGMT_PSK); in test_send_eapol()
41 wpa_sm_set_param(ctx->wpa, WPA_PARAM_PAIRWISE, WPA_CIPHER_CCMP); in test_send_eapol()
42 wpa_sm_set_param(ctx->wpa, WPA_PARAM_GROUP, WPA_CIPHER_CCMP); in test_send_eapol()
45 wpa_sm_set_assoc_wpa_ie_default(ctx->wpa, wpa_ie, &wpa_ie_len); in test_send_eapol()
47 if (eapol_sm_rx_eapol(ctx->eapol, src, ctx->data, ctx->data_len, in test_send_eapol()
[all …]
/hostap-latest/tests/fuzzing/wnm/
Dwnm.c36 struct arg_ctx *ctx = eloop_data; in test_send_wnm() local
39 wpa_hexdump(MSG_MSGDUMP, "fuzzer - WNM", ctx->data, ctx->data_len); in test_send_wnm()
41 mgmt = (const struct ieee80211_mgmt *) ctx->data; in test_send_wnm()
42 ieee802_11_rx_wnm_action(&ctx->wpa_s, mgmt, ctx->data_len); in test_send_wnm()
48 static int init_wpa(struct arg_ctx *ctx) in init_wpa() argument
50 ctx->wpa_s.wpa_state = WPA_COMPLETED; in init_wpa()
51 os_memcpy(ctx->wpa_s.bssid, "\x02\x00\x00\x00\x03\x00", ETH_ALEN); in init_wpa()
52 ctx->wpa_s.current_bss = &ctx->bss; in init_wpa()
53 ctx->wpa_s.driver = &ctx->driver; in init_wpa()
54 ctx->wpa_s.wpa = &ctx->wpa; in init_wpa()
[all …]
/hostap-latest/tests/fuzzing/p2p/
Dp2p.c18 static void debug_print(void *ctx, int level, const char *msg) in debug_print() argument
24 static void find_stopped(void *ctx) in find_stopped() argument
29 static int start_listen(void *ctx, unsigned int freq, in start_listen() argument
37 static void stop_listen(void *ctx) in stop_listen() argument
42 static void dev_found(void *ctx, const u8 *addr, in dev_found() argument
49 static void dev_lost(void *ctx, const u8 *dev_addr) in dev_lost() argument
54 static int send_action(void *ctx, unsigned int freq, const u8 *dst, in send_action() argument
63 static void send_action_done(void *ctx) in send_action_done() argument
68 static void go_neg_req_rx(void *ctx, const u8 *src, u16 dev_passwd_id, in go_neg_req_rx() argument
110 struct arg_ctx *ctx = eloop_data; in test_send() local
[all …]
/hostap-latest/src/pae/
Dieee802_1x_secy_ops.c37 ops = kay->ctx; in secy_cp_control_protect_frames()
44 return ops->enable_protect_frames(ops->ctx, enabled); in secy_cp_control_protect_frames()
57 ops = kay->ctx; in secy_cp_control_encrypt()
64 return ops->enable_encrypt(ops->ctx, enabled); in secy_cp_control_encrypt()
77 ops = kay->ctx; in secy_cp_control_replay()
84 return ops->set_replay_protect(ops->ctx, enabled, win); in secy_cp_control_replay()
97 ops = kay->ctx; in secy_cp_control_offload()
104 return ops->set_offload(ops->ctx, offload); in secy_cp_control_offload()
117 ops = kay->ctx; in secy_cp_control_current_cipher_suite()
124 return ops->set_current_cipher_suite(ops->ctx, cs); in secy_cp_control_current_cipher_suite()
[all …]
/hostap-latest/wpa_supplicant/
Dwpas_glue.c36 static void wpa_supplicant_set_config_blob(void *ctx, in wpa_supplicant_set_config_blob() argument
39 struct wpa_supplicant *wpa_s = ctx; in wpa_supplicant_set_config_blob()
52 wpa_supplicant_get_config_blob(void *ctx, const char *name) in wpa_supplicant_get_config_blob() argument
54 struct wpa_supplicant *wpa_s = ctx; in wpa_supplicant_get_config_blob()
146 static int wpa_supplicant_eapol_send(void *ctx, int type, const u8 *buf, in wpa_supplicant_eapol_send() argument
149 struct wpa_supplicant *wpa_s = ctx; in wpa_supplicant_eapol_send()
241 static int wpa_eapol_set_wep_key(void *ctx, int unicast, int keyidx, in wpa_eapol_set_wep_key() argument
244 struct wpa_supplicant *wpa_s = ctx; in wpa_eapol_set_wep_key()
262 static void wpa_supplicant_aborted_cached(void *ctx) in wpa_supplicant_aborted_cached() argument
264 struct wpa_supplicant *wpa_s = ctx; in wpa_supplicant_aborted_cached()
[all …]
/hostap-latest/radius_example/
Dradius_example.c24 static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module, in hostapd_logger_cb() argument
51 struct radius_ctx *ctx = eloop_ctx; in start_example() local
56 ctx->radius_identifier = radius_client_get_id(ctx->radius); in start_example()
58 ctx->radius_identifier); in start_example()
75 ctx->conf.auth_server->shared_secret, in start_example()
76 ctx->conf.auth_server->shared_secret_len)) { in start_example()
83 (u8 *) &ctx->own_ip_addr, 4)) { in start_example()
89 if (radius_client_send(ctx->radius, msg, RADIUS_AUTH, NULL) < 0) in start_example()
96 struct radius_ctx ctx; in main() local
104 os_memset(&ctx, 0, sizeof(ctx)); in main()
[all …]
/hostap-latest/src/eapol_supp/
Deapol_supp_sm.c136 struct eapol_ctx *ctx; member
205 if (!sm->ctx->confirm_auth_cb) in eapol_sm_confirm_auth()
208 return sm->ctx->confirm_auth_cb(sm->ctx->ctx); in eapol_sm_confirm_auth()
264 if (sm->ctx->preauth) in SM_STATE()
416 if (sm->ctx->eapol_done_cb) in SM_STEP()
417 sm->ctx->eapol_done_cb(sm->ctx->ctx); in SM_STEP()
667 sm->ctx->eapol_send(sm->ctx->eapol_send_ctx, in eapol_sm_txLogoff()
677 sm->ctx->eapol_send(sm->ctx->eapol_send_ctx, in eapol_sm_txStart()
844 if (sm->ctx->set_wep_key && in eapol_sm_processKey()
845 sm->ctx->set_wep_key(sm->ctx->ctx, in eapol_sm_processKey()
[all …]

1234567891011