/hostap-3.7.0/src/tls/ |
D | tlsv1_client_ocsp.c | 116 struct asn1_hdr hdr; in tls_process_ocsp_single_response() local 141 if (asn1_get_next(resp, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in tls_process_ocsp_single_response() 142 asn1_unexpected(&hdr, "OCSP: Expected SEQUENCE (CertID)"); in tls_process_ocsp_single_response() 145 pos = hdr.payload; in tls_process_ocsp_single_response() 146 end = hdr.payload + hdr.length; in tls_process_ocsp_single_response() 161 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response() 162 !asn1_is_octetstring(&hdr)) { in tls_process_ocsp_single_response() 163 asn1_unexpected(&hdr, in tls_process_ocsp_single_response() 167 name_hash = hdr.payload; in tls_process_ocsp_single_response() 168 name_hash_len = hdr.length; in tls_process_ocsp_single_response() [all …]
|
D | tlsv1_cred.c | 446 struct asn1_hdr hdr; in pkcs12_certbag() local 458 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs12_certbag() 459 asn1_unexpected(&hdr, "PKCS #12: Expected SEQUENCE (CertBag)"); in pkcs12_certbag() 463 pos = hdr.payload; in pkcs12_certbag() 464 end = hdr.payload + hdr.length; in pkcs12_certbag() 481 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in pkcs12_certbag() 482 !asn1_is_cs_tag(&hdr, 0)) { in pkcs12_certbag() 483 asn1_unexpected(&hdr, in pkcs12_certbag() 488 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 || in pkcs12_certbag() 489 !asn1_is_octetstring(&hdr)) { in pkcs12_certbag() [all …]
|
D | asn1.c | 106 static int asn1_valid_der_boolean(struct asn1_hdr *hdr) in asn1_valid_der_boolean() argument 109 if (hdr->length != 1) { in asn1_valid_der_boolean() 111 hdr->length); in asn1_valid_der_boolean() 115 if (hdr->payload[0] != 0 && hdr->payload[0] != 0xff) { in asn1_valid_der_boolean() 118 hdr->payload[0]); in asn1_valid_der_boolean() 126 static int asn1_valid_der(struct asn1_hdr *hdr) in asn1_valid_der() argument 128 if (hdr->class != ASN1_CLASS_UNIVERSAL) in asn1_valid_der() 130 if (hdr->tag == ASN1_TAG_BOOLEAN && !asn1_valid_der_boolean(hdr)) in asn1_valid_der() 132 if (hdr->tag == ASN1_TAG_NULL && hdr->length != 0) in asn1_valid_der() 136 if (hdr->constructed && in asn1_valid_der() [all …]
|
D | x509v3.c | 185 struct asn1_hdr hdr; in x509_parse_algorithm_identifier() local 195 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in x509_parse_algorithm_identifier() 196 asn1_unexpected(&hdr, in x509_parse_algorithm_identifier() 200 if (hdr.length > buf + len - hdr.payload) in x509_parse_algorithm_identifier() 202 pos = hdr.payload; in x509_parse_algorithm_identifier() 203 end = pos + hdr.length; in x509_parse_algorithm_identifier() 220 struct asn1_hdr hdr; in x509_parse_public_key() local 233 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in x509_parse_public_key() 234 !asn1_is_sequence(&hdr)) { in x509_parse_public_key() 235 asn1_unexpected(&hdr, in x509_parse_public_key() [all …]
|
D | asn1.h | 62 int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr); 63 void asn1_print_hdr(const struct asn1_hdr *hdr, const char *title); 64 void asn1_unexpected(const struct asn1_hdr *hdr, const char *title); 72 int asn1_get_sequence(const u8 *buf, size_t len, struct asn1_hdr *hdr, 88 static inline bool asn1_is_oid(const struct asn1_hdr *hdr) in asn1_is_oid() argument 90 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_oid() 91 hdr->tag == ASN1_TAG_OID; in asn1_is_oid() 94 static inline bool asn1_is_boolean(const struct asn1_hdr *hdr) in asn1_is_boolean() argument 96 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_boolean() 97 hdr->tag == ASN1_TAG_BOOLEAN; in asn1_is_boolean() [all …]
|
D | pkcs8.c | 21 struct asn1_hdr hdr; in pkcs8_key_import() local 30 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_key_import() 31 asn1_unexpected(&hdr, in pkcs8_key_import() 35 pos = hdr.payload; in pkcs8_key_import() 36 end = pos + hdr.length; in pkcs8_key_import() 39 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !asn1_is_integer(&hdr)) { in pkcs8_key_import() 40 asn1_unexpected(&hdr, "PKCS #8: Expected INTEGER"); in pkcs8_key_import() 48 if (bignum_set_unsigned_bin(zero, hdr.payload, hdr.length) < 0) { in pkcs8_key_import() 53 pos = hdr.payload + hdr.length; in pkcs8_key_import() 66 if (asn1_get_next(pos, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_key_import() [all …]
|
D | pkcs5.c | 93 struct asn1_hdr hdr; in pkcs5_get_params_pbes2() local 109 if (asn1_get_next(pos, enc_alg_end - pos, &hdr) < 0 || in pkcs5_get_params_pbes2() 110 !asn1_is_sequence(&hdr)) { in pkcs5_get_params_pbes2() 111 asn1_unexpected(&hdr, in pkcs5_get_params_pbes2() 115 pos = hdr.payload; in pkcs5_get_params_pbes2() 116 end = hdr.payload + hdr.length; in pkcs5_get_params_pbes2() 118 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs5_get_params_pbes2() 119 !asn1_is_sequence(&hdr)) { in pkcs5_get_params_pbes2() 120 asn1_unexpected(&hdr, in pkcs5_get_params_pbes2() 125 pos = hdr.payload; in pkcs5_get_params_pbes2() [all …]
|
D | pkcs1.c | 209 struct asn1_hdr hdr; in pkcs1_v15_sig_ver() local 238 if (asn1_get_next(decrypted, decrypted_len, &hdr) < 0 || in pkcs1_v15_sig_ver() 239 !asn1_is_sequence(&hdr)) { in pkcs1_v15_sig_ver() 240 asn1_unexpected(&hdr, in pkcs1_v15_sig_ver() 246 hdr.payload, hdr.length); in pkcs1_v15_sig_ver() 248 pos = hdr.payload; in pkcs1_v15_sig_ver() 249 end = pos + hdr.length; in pkcs1_v15_sig_ver() 259 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs1_v15_sig_ver() 260 !asn1_is_sequence(&hdr)) { in pkcs1_v15_sig_ver() 261 asn1_unexpected(&hdr, in pkcs1_v15_sig_ver() [all …]
|
D | rsa.c | 34 struct asn1_hdr hdr; in crypto_rsa_parse_integer() local 39 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in crypto_rsa_parse_integer() 40 !asn1_is_integer(&hdr)) { in crypto_rsa_parse_integer() 41 asn1_unexpected(&hdr, "RSA: Expected INTEGER"); in crypto_rsa_parse_integer() 45 if (bignum_set_unsigned_bin(num, hdr.payload, hdr.length) < 0) { in crypto_rsa_parse_integer() 50 return hdr.payload + hdr.length; in crypto_rsa_parse_integer() 64 struct asn1_hdr hdr; in crypto_rsa_import_public_key() local 86 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in crypto_rsa_import_public_key() 87 asn1_unexpected(&hdr, "RSA: Expected SEQUENCE (public key)"); in crypto_rsa_import_public_key() 90 pos = hdr.payload; in crypto_rsa_import_public_key() [all …]
|
/hostap-3.7.0/tests/fuzzing/asn1/ |
D | asn1.c | 38 struct asn1_hdr hdr; in asn1_parse() local 52 if (asn1_get_next(pos, end - pos, &hdr) < 0) in asn1_parse() 56 pos = hdr.payload; in asn1_parse() 60 prefix, hdr.class, asn1_class_str(hdr.class), in asn1_parse() 61 hdr.constructed, in asn1_parse() 62 hdr.constructed ? "Constructed" : "Primitive", in asn1_parse() 63 hdr.tag, hdr.length); in asn1_parse() 65 if (hdr.class == ASN1_CLASS_CONTEXT_SPECIFIC && in asn1_parse() 66 hdr.constructed) { in asn1_parse() 67 if (asn1_parse(pos, hdr.length, level + 1) < 0) in asn1_parse() [all …]
|
/hostap-3.7.0/src/common/ |
D | dpp_backup.c | 538 struct asn1_hdr hdr; in dpp_parse_recipient_infos() local 559 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in dpp_parse_recipient_infos() 560 !asn1_is_cs_tag(&hdr, 3)) { in dpp_parse_recipient_infos() 561 asn1_unexpected(&hdr, "DPP: Expected CHOICE [3] (pwri)"); in dpp_parse_recipient_infos() 565 hdr.payload, hdr.length); in dpp_parse_recipient_infos() 566 pos = hdr.payload; in dpp_parse_recipient_infos() 567 end = pos + hdr.length; in dpp_parse_recipient_infos() 580 if (asn1_get_sequence(pos, end - pos, &hdr, &end) < 0) in dpp_parse_recipient_infos() 582 pos = hdr.payload; in dpp_parse_recipient_infos() 594 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in dpp_parse_recipient_infos() [all …]
|
/hostap-3.7.0/wlantest/ |
D | rx_data.c | 154 struct wpa_ptk *ptk, const struct ieee80211_hdr *hdr, in try_ptk() argument 163 decrypted = ccmp_decrypt(ptk->tk, hdr, data, in try_ptk() 167 decrypted = ccmp_256_decrypt(ptk->tk, hdr, data, in try_ptk() 173 decrypted = gcmp_decrypt(ptk->tk, tk_len, hdr, in try_ptk() 179 decrypted = tkip_decrypt(ptk->tk, hdr, data, data_len, in try_ptk() 193 const struct ieee80211_hdr *hdr, int keyid, in try_all_ptk() argument 202 decrypted = try_ptk(wt, pairwise_cipher, &ptk->ptk, hdr, in try_all_ptk() 220 const struct ieee80211_hdr *hdr, in check_plaintext_prot() argument 231 wt->frame_num, MAC2STR(hdr->addr2), in check_plaintext_prot() 232 WLAN_GET_SEQ_SEQ(le_to_host16(hdr->seq_ctrl))); in check_plaintext_prot() [all …]
|
D | readpcap.c | 54 struct pcap_pkthdr *hdr; in read_cap_file() local 80 res = pcap_next_ex(pcap, &hdr, &data); in read_cap_file() 98 (int) hdr->ts.tv_sec, (int) hdr->ts.tv_usec, in read_cap_file() 99 hdr->caplen, hdr->len); in read_cap_file() 101 wt->write_pcap_time = hdr->ts; in read_cap_file() 103 write_pcap_with_radiotap(wt, data, hdr->caplen); in read_cap_file() 105 pcap_dump(wt->write_pcap_dumper, hdr, data); in read_cap_file() 109 if (hdr->caplen < hdr->len) { in read_cap_file() 112 hdr->caplen, hdr->len); in read_cap_file() 113 write_pcapng_write_read(wt, dlt, hdr, data); in read_cap_file() [all …]
|
D | process.c | 21 const struct ieee80211_hdr *hdr, in rx_get_sta() argument 29 if (hdr->addr1[0] & 0x01) in rx_get_sta() 32 fc = le_to_host16(hdr->frame_control); in rx_get_sta() 37 bssid = hdr->addr3; in rx_get_sta() 38 if (os_memcmp(bssid, hdr->addr2, ETH_ALEN) == 0) { in rx_get_sta() 39 sta_addr = hdr->addr1; in rx_get_sta() 42 if (os_memcmp(bssid, hdr->addr1, ETH_ALEN) != 0) in rx_get_sta() 44 sta_addr = hdr->addr2; in rx_get_sta() 55 sta_addr = hdr->addr1; in rx_get_sta() 56 bssid = hdr->addr2; in rx_get_sta() [all …]
|
D | ccmp.c | 18 static void ccmp_aad_nonce(const struct ieee80211_hdr *hdr, const u8 *data, in ccmp_aad_nonce() argument 27 fc = le_to_host16(hdr->frame_control); in ccmp_aad_nonce() 39 qc = (const u8 *) (hdr + 1); in ccmp_aad_nonce() 51 os_memcpy(pos, hdr->addr1, 3 * ETH_ALEN); in ccmp_aad_nonce() 53 seq = le_to_host16(hdr->seq_ctrl); in ccmp_aad_nonce() 58 os_memcpy(pos, hdr + 1, addr4 * ETH_ALEN + qos * 2); in ccmp_aad_nonce() 70 os_memcpy(nonce + 1, hdr->addr2, ETH_ALEN); in ccmp_aad_nonce() 80 static void ccmp_aad_nonce_pv1(const u8 *hdr, const u8 *a1, const u8 *a2, in ccmp_aad_nonce_pv1() argument 90 fc = WPA_GET_LE16(hdr); in ccmp_aad_nonce_pv1() 110 sc = hdr + 2 + 2 + ETH_ALEN; in ccmp_aad_nonce_pv1() [all …]
|
D | tkip.c | 204 static void michael_mic(const u8 *key, const u8 *hdr, const u8 *data, in michael_mic() argument 214 l ^= WPA_GET_LE32(hdr); in michael_mic() 216 l ^= WPA_GET_LE32(&hdr[4]); in michael_mic() 218 l ^= WPA_GET_LE32(&hdr[8]); in michael_mic() 220 l ^= WPA_GET_LE32(&hdr[12]); in michael_mic() 256 static void michael_mic_hdr(const struct ieee80211_hdr *hdr11, u8 *hdr) in michael_mic_hdr() argument 263 os_memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */ in michael_mic_hdr() 264 os_memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */ in michael_mic_hdr() 267 os_memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */ in michael_mic_hdr() 268 os_memcpy(hdr + ETH_ALEN, hdr11->addr3, ETH_ALEN); /* SA */ in michael_mic_hdr() [all …]
|
D | rx_eapol.c | 39 struct ieee802_1x_hdr *hdr; in check_mic() local 47 hdr = (struct ieee802_1x_hdr *) buf; in check_mic() 48 key = (struct wpa_eapol_key *) (hdr + 1); in check_mic() 70 const struct wpa_eapol_key *hdr; in rx_data_eapol_key_1_of_4() local 82 hdr = (const struct wpa_eapol_key *) (eapol + 1); in rx_data_eapol_key_1_of_4() 83 if (is_zero(hdr->key_nonce, WPA_NONCE_LEN)) { in rx_data_eapol_key_1_of_4() 87 if (!is_zero(hdr->key_rsc, 8)) { in rx_data_eapol_key_1_of_4() 91 os_memcpy(sta->anonce, hdr->key_nonce, WPA_NONCE_LEN); in rx_data_eapol_key_1_of_4() 246 const struct wpa_eapol_key *hdr; in rx_data_eapol_key_2_of_4() local 262 hdr = (const struct wpa_eapol_key *) (eapol + 1); in rx_data_eapol_key_2_of_4() [all …]
|
D | gcmp.c | 18 static void gcmp_aad_nonce(const struct ieee80211_hdr *hdr, const u8 *data, in gcmp_aad_nonce() argument 25 fc = le_to_host16(hdr->frame_control); in gcmp_aad_nonce() 37 qc = (const u8 *) (hdr + 1); in gcmp_aad_nonce() 46 os_memcpy(pos, hdr->addr1, 3 * ETH_ALEN); in gcmp_aad_nonce() 48 seq = le_to_host16(hdr->seq_ctrl); in gcmp_aad_nonce() 53 os_memcpy(pos, hdr + 1, addr4 * ETH_ALEN + qos * 2); in gcmp_aad_nonce() 65 os_memcpy(nonce, hdr->addr2, ETH_ALEN); in gcmp_aad_nonce() 75 u8 * gcmp_decrypt(const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr, in gcmp_decrypt() argument 93 gcmp_aad_nonce(hdr, data, aad, &aad_len, nonce); in gcmp_decrypt() 99 u16 seq_ctrl = le_to_host16(hdr->seq_ctrl); in gcmp_decrypt() [all …]
|
D | writepcap.c | 164 struct pcapng_section_header hdr; in write_pcapng_init() local 173 os_memset(&hdr, 0, sizeof(hdr)); in write_pcapng_init() 174 hdr.block_type = PCAPNG_BLOCK_SECTION_HEADER; in write_pcapng_init() 175 hdr.block_total_len = sizeof(hdr); in write_pcapng_init() 176 hdr.byte_order_magic = PCAPNG_BYTE_ORDER_MAGIC; in write_pcapng_init() 177 hdr.major_version = 1; in write_pcapng_init() 178 hdr.minor_version = 0; in write_pcapng_init() 179 hdr.section_len = -1; in write_pcapng_init() 180 hdr.block_total_len2 = hdr.block_total_len; in write_pcapng_init() 181 fwrite(&hdr, sizeof(hdr), 1, wt->pcapng); in write_pcapng_init() [all …]
|
/hostap-3.7.0/src/eap_common/ |
D | eap_common.c | 27 const struct eap_hdr *hdr; in eap_hdr_len_valid() local 33 hdr = wpabuf_head(msg); in eap_hdr_len_valid() 35 if (wpabuf_len(msg) < sizeof(*hdr)) { in eap_hdr_len_valid() 40 len = be_to_host16(hdr->length); in eap_hdr_len_valid() 41 if (len < sizeof(*hdr) + min_payload || len > wpabuf_len(msg)) { in eap_hdr_len_valid() 69 const struct eap_hdr *hdr; in eap_hdr_validate() local 76 hdr = wpabuf_head(msg); in eap_hdr_validate() 77 len = be_to_host16(hdr->length); in eap_hdr_validate() 78 pos = (const u8 *) (hdr + 1); in eap_hdr_validate() 83 if (len < sizeof(*hdr) + 8) { in eap_hdr_validate() [all …]
|
/hostap-3.7.0/src/crypto/ |
D | crypto_linux.c | 454 struct cmsghdr *hdr; in linux_af_alg_skcipher_oper() local 466 hdr = CMSG_FIRSTHDR(&msg); in linux_af_alg_skcipher_oper() 467 hdr->cmsg_level = SOL_ALG; in linux_af_alg_skcipher_oper() 468 hdr->cmsg_type = ALG_SET_OP; in linux_af_alg_skcipher_oper() 469 hdr->cmsg_len = CMSG_LEN(sizeof(u32)); in linux_af_alg_skcipher_oper() 470 op = (u32 *) CMSG_DATA(hdr); in linux_af_alg_skcipher_oper() 545 struct cmsghdr *hdr; in rc4_skip() local 568 hdr = CMSG_FIRSTHDR(&msg); in rc4_skip() 569 hdr->cmsg_level = SOL_ALG; in rc4_skip() 570 hdr->cmsg_type = ALG_SET_OP; in rc4_skip() [all …]
|
/hostap-3.7.0/src/radius/ |
D | radius.c | 30 struct radius_hdr *hdr; member 54 return msg->hdr; in radius_msg_get_hdr() 74 msg->hdr->code = code; in radius_msg_set_hdr() 75 msg->hdr->identifier = identifier; in radius_msg_set_hdr() 115 msg->hdr = wpabuf_put(msg->buf, sizeof(struct radius_hdr)); in radius_msg_new() 280 static void radius_msg_dump_attr(struct radius_attr_hdr *hdr) in radius_msg_dump_attr() argument 287 attr = radius_get_attr_type(hdr->type); in radius_msg_dump_attr() 290 hdr->type, attr ? attr->name : "?Unknown?", hdr->length); in radius_msg_dump_attr() 292 if (attr == NULL || hdr->length < sizeof(struct radius_attr_hdr)) in radius_msg_dump_attr() 295 len = hdr->length - sizeof(struct radius_attr_hdr); in radius_msg_dump_attr() [all …]
|
/hostap-3.7.0/src/drivers/ |
D | driver_wired.c | 83 struct ieee8023_hdr *hdr; in handle_data() local 96 hdr = (struct ieee8023_hdr *) buf; in handle_data() 98 switch (ntohs(hdr->ethertype)) { in handle_data() 101 sa = hdr->src; in handle_data() 106 pos = (u8 *) (hdr + 1); in handle_data() 107 left = len - sizeof(*hdr); in handle_data() 113 ntohs(hdr->ethertype)); in handle_data() 291 struct ieee8023_hdr *hdr; in wired_send_eapol() local 296 len = sizeof(*hdr) + data_len; in wired_send_eapol() 297 hdr = os_zalloc(len); in wired_send_eapol() [all …]
|
/hostap-3.7.0/src/wps/ |
D | httpread.c | 62 char hdr[HTTPREAD_HEADER_MAX_SIZE+1]; /* headers stored here */ member 201 char *hbp = h->hdr; /* pointer into h->hdr */ in httpread_hdr_analyze() 418 hbp = h->hdr + h->hdr_nbytes; in httpread_read_handler() 465 if (!os_strncasecmp(h->hdr, "SUBSCRIBE", 9) || in httpread_read_handler() 466 !os_strncasecmp(h->hdr, "UNSUBSCRIBE", 11) || in httpread_read_handler() 467 !os_strncasecmp(h->hdr, "HEAD", 4) || in httpread_read_handler() 468 !os_strncasecmp(h->hdr, "GET", 3)) { in httpread_read_handler() 816 return h->hdr; in httpread_hdr_get() 831 char *hdr = h->hdr; in httpread_hdr_line_get() local 832 hdr = os_strchr(hdr, '\n'); in httpread_hdr_line_get() [all …]
|
/hostap-3.7.0/tests/fuzzing/eapol-supp/ |
D | eapol-supp.c | 74 struct ieee802_1x_hdr *hdr; in alloc_eapol() local 76 *msg_len = sizeof(*hdr) + data_len; in alloc_eapol() 77 hdr = os_malloc(*msg_len); in alloc_eapol() 78 if (hdr == NULL) in alloc_eapol() 81 hdr->version = 2; in alloc_eapol() 82 hdr->type = type; in alloc_eapol() 83 hdr->length = host_to_be16(data_len); in alloc_eapol() 86 os_memcpy(hdr + 1, data, data_len); in alloc_eapol() 88 os_memset(hdr + 1, 0, data_len); in alloc_eapol() 91 *data_pos = hdr + 1; in alloc_eapol() [all …]
|