Home
last modified time | relevance | path

Searched refs:plain (Results 1 – 25 of 50) sorted by relevance

12

/hostap-latest/src/crypto/
Dcrypto_internal-cipher.c103 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument
110 if (plain != crypt) in crypto_cipher_encrypt()
111 os_memcpy(crypt, plain, len); in crypto_cipher_encrypt()
122 ctx->u.aes.cbc[j] ^= plain[j]; in crypto_cipher_encrypt()
126 plain += AES_BLOCK_SIZE; in crypto_cipher_encrypt()
136 ctx->u.des3.cbc[j] ^= plain[j]; in crypto_cipher_encrypt()
140 plain += 8; in crypto_cipher_encrypt()
150 ctx->u.des3.cbc[j] ^= plain[j]; in crypto_cipher_encrypt()
154 plain += 8; in crypto_cipher_encrypt()
167 u8 *plain, size_t len) in crypto_cipher_decrypt() argument
[all …]
Dcrypto_libtomcrypt.c100 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument
103 return aes_ecb_encrypt(plain, crypt, skey) == CRYPT_OK ? 0 : -1; in aes_encrypt()
129 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument
132 return aes_ecb_encrypt(plain, (u8 *) crypt, skey) == CRYPT_OK ? 0 : -1; in aes_decrypt()
354 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument
360 if (plain != crypt) in crypto_cipher_encrypt()
361 os_memcpy(crypt, plain, len); in crypto_cipher_encrypt()
368 res = cbc_encrypt(plain, crypt, len, &ctx->u.cbc); in crypto_cipher_encrypt()
379 u8 *plain, size_t len) in crypto_cipher_decrypt() argument
384 if (plain != crypt) in crypto_cipher_decrypt()
[all …]
Ddes-internal.c435 void des_block_encrypt(const u8 *plain, const u32 *ek, u8 *crypt) in des_block_encrypt() argument
438 work[0] = WPA_GET_BE32(plain); in des_block_encrypt()
439 work[1] = WPA_GET_BE32(plain + 4); in des_block_encrypt()
446 void des_block_decrypt(const u8 *crypt, const u32 *dk, u8 *plain) in des_block_decrypt() argument
452 WPA_PUT_BE32(plain, work[0]); in des_block_decrypt()
453 WPA_PUT_BE32(plain + 4, work[1]); in des_block_decrypt()
469 void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt) in des3_encrypt() argument
473 work[0] = WPA_GET_BE32(plain); in des3_encrypt()
474 work[1] = WPA_GET_BE32(plain + 4); in des3_encrypt()
483 void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain) in des3_decrypt() argument
[all …]
Ddes_i.h18 void des_block_encrypt(const u8 *plain, const u32 *ek, u8 *crypt);
19 void des_block_decrypt(const u8 *crypt, const u32 *dk, u8 *plain);
22 void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt);
23 void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain);
Daes_wrap.h21 int __must_check aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain,
24 const u8 *cipher, u8 *plain);
54 const u8 *plain, size_t plain_len,
61 u8 *plain);
66 size_t M, const u8 *plain, size_t plain_len,
71 u8 *plain);
Daes-ccm.c149 size_t M, const u8 *plain, size_t plain_len, in aes_ccm_ae() argument
164 aes_ccm_auth(aes, plain, plain_len, x); in aes_ccm_ae()
168 aes_ccm_encr(aes, L, plain, plain_len, crypt, a); in aes_ccm_ae()
180 const u8 *aad, size_t aad_len, const u8 *auth, u8 *plain) in aes_ccm_ad() argument
199 aes_ccm_encr(aes, L, crypt, crypt_len, plain, a); in aes_ccm_ad()
202 aes_ccm_auth(aes, plain, crypt_len, x); in aes_ccm_ad()
Daes-unwrap.c27 u8 *plain) in aes_unwrap() argument
36 r = plain; in aes_unwrap()
51 r = plain + (n - 1) * 8; in aes_unwrap()
Dcrypto_nettle.c261 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument
264 nettle_aes_encrypt(actx, AES_BLOCK_SIZE, crypt, plain); in aes_encrypt()
292 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument
295 nettle_aes_decrypt(actx, AES_BLOCK_SIZE, plain, crypt); in aes_decrypt()
436 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument
441 nettle_arcfour_crypt(&ctx->u.arcfour_ctx, len, crypt, plain); in crypto_cipher_encrypt()
452 u8 *plain, size_t len) in crypto_cipher_decrypt() argument
456 nettle_arcfour_crypt(&ctx->u.arcfour_ctx, len, plain, crypt); in crypto_cipher_decrypt()
Dcrypto_gnutls.c237 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument
240 gcry_cipher_encrypt(hd, crypt, 16, plain, 16); in aes_encrypt()
271 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument
274 gcry_cipher_decrypt(hd, plain, 16, crypt, 16); in aes_decrypt()
481 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument
484 if (gcry_cipher_encrypt(ctx->enc, crypt, len, plain, len) != in crypto_cipher_encrypt()
492 u8 *plain, size_t len) in crypto_cipher_decrypt() argument
494 if (gcry_cipher_decrypt(ctx->dec, plain, len, crypt, len) != in crypto_cipher_decrypt()
Daes.h15 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt);
18 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain);
Daes-wrap.c26 int aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, u8 *cipher) in aes_wrap() argument
38 os_memcpy(r, plain, 8 * n); in aes_wrap()
/hostap-latest/wlantest/
Dwep.c47 size_t data_len, u8 *plain) in try_wep() argument
60 os_memcpy(plain, data, data_len); in try_wep()
61 wep_crypt(k, plain, data_len); in try_wep()
62 icv = ieee80211_crc32(plain, data_len - 4); in try_wep()
63 rx_icv = WPA_GET_LE32(plain + data_len - 4); in try_wep()
74 u8 *plain; in wep_decrypt() local
84 plain = os_malloc(data_len - 4); in wep_decrypt()
85 if (plain == NULL) in wep_decrypt()
91 if (try_wep(key, 3 + w->key_len, data + 4, data_len - 4, plain) in wep_decrypt()
98 os_free(plain); in wep_decrypt()
[all …]
Dtest_vectors.c46 u8 *enc, *plain; in test_vector_tkip() local
65 plain = tkip_decrypt(tk, (const struct ieee80211_hdr *) enc, in test_vector_tkip()
70 if (plain == NULL) { in test_vector_tkip()
76 os_memcmp(plain, frame + 24, plain_len) != 0) { in test_vector_tkip()
78 plain, plain_len); in test_vector_tkip()
81 os_free(plain); in test_vector_tkip()
98 u8 *enc, *plain; in test_vector_ccmp() local
122 plain = ccmp_decrypt(tk, (const struct ieee80211_hdr *) enc, in test_vector_ccmp()
128 if (plain == NULL) { in test_vector_ccmp()
134 os_memcmp(plain, frame + 24, plain_len) != 0) { in test_vector_ccmp()
[all …]
Dtkip.c300 u8 *plain; in tkip_decrypt() local
327 plain = os_memdup(data + 8, plain_len); in tkip_decrypt()
328 if (plain == NULL) in tkip_decrypt()
330 wep_crypt(rc4key, plain, plain_len); in tkip_decrypt()
332 icv = ieee80211_crc32(plain, plain_len - 4); in tkip_decrypt()
333 rx_icv = WPA_GET_LE32(plain + plain_len - 4); in tkip_decrypt()
339 os_free(plain); in tkip_decrypt()
344 full_payload = plain; in tkip_decrypt()
356 frag->buf = wpabuf_alloc_copy(plain, plain_len); in tkip_decrypt()
369 wpabuf_put_data(frag->buf, plain, plain_len); in tkip_decrypt()
[all …]
Dccmp.c161 u8 *plain; in ccmp_decrypt() local
166 plain = os_malloc(data_len + AES_BLOCK_SIZE); in ccmp_decrypt()
167 if (plain == NULL) in ccmp_decrypt()
178 data + 8 + mlen, plain) < 0) { in ccmp_decrypt()
186 os_free(plain); in ccmp_decrypt()
189 wpa_hexdump(MSG_EXCESSIVE, "CCMP decrypted", plain, mlen); in ccmp_decrypt()
192 return plain; in ccmp_decrypt()
305 u8 *plain; in ccmp_256_decrypt() local
310 plain = os_malloc(data_len + AES_BLOCK_SIZE); in ccmp_256_decrypt()
311 if (plain == NULL) in ccmp_256_decrypt()
[all …]
Dgcmp.c89 u8 aad[30], nonce[12], *plain; in gcmp_decrypt() local
96 plain = os_malloc(data_len + AES_BLOCK_SIZE); in gcmp_decrypt()
97 if (plain == NULL) in gcmp_decrypt()
109 m + mlen, plain) < 0) { in gcmp_decrypt()
117 os_free(plain); in gcmp_decrypt()
122 return plain; in gcmp_decrypt()
/hostap-latest/src/tls/
Dpkcs1.c136 u8 *plain, size_t *plain_len) in pkcs1_decrypt_public_key() argument
142 if (crypto_rsa_exptmod(crypt, crypt_len, plain, &len, key, 0) < 0) in pkcs1_decrypt_public_key()
157 plain[0] != 0x00 || plain[1] != 0x01) { in pkcs1_decrypt_public_key()
160 wpa_hexdump_key(MSG_DEBUG, "Signature EB", plain, len); in pkcs1_decrypt_public_key()
164 pos = plain + 3; in pkcs1_decrypt_public_key()
166 if (plain[2] != 0xff) { in pkcs1_decrypt_public_key()
169 wpa_hexdump_key(MSG_DEBUG, "Signature EB", plain, len); in pkcs1_decrypt_public_key()
172 while (pos < plain + len && *pos == 0xff) in pkcs1_decrypt_public_key()
175 if (pos - plain - 2 < 8) { in pkcs1_decrypt_public_key()
179 wpa_hexdump_key(MSG_DEBUG, "Signature EB", plain, len); in pkcs1_decrypt_public_key()
[all …]
/hostap-latest/src/wps/
Dwps_enrollee.c210 struct wpabuf *msg, *plain; in wps_build_m5() local
214 plain = wpabuf_alloc(200); in wps_build_m5()
215 if (plain == NULL) in wps_build_m5()
220 wpabuf_free(plain); in wps_build_m5()
227 wps_build_e_snonce1(wps, plain) || in wps_build_m5()
228 wps_build_key_wrap_auth(wps, plain) || in wps_build_m5()
229 wps_build_encr_settings(wps, msg, plain) || in wps_build_m5()
232 wpabuf_clear_free(plain); in wps_build_m5()
236 wpabuf_clear_free(plain); in wps_build_m5()
349 static int wps_build_ap_settings(struct wps_data *wps, struct wpabuf *plain) in wps_build_ap_settings() argument
[all …]
Dwps_registrar.c1850 struct wpabuf *msg, *plain; in wps_build_ap_cred() local
1856 plain = wpabuf_alloc(200); in wps_build_ap_cred()
1857 if (plain == NULL) { in wps_build_ap_cred()
1862 if (wps_build_ap_settings(wps, plain)) { in wps_build_ap_cred()
1863 wpabuf_clear_free(plain); in wps_build_ap_cred()
1869 wpabuf_put_be16(msg, wpabuf_len(plain)); in wps_build_ap_cred()
1870 wpabuf_put_buf(msg, plain); in wps_build_ap_cred()
1871 wpabuf_clear_free(plain); in wps_build_ap_cred()
1925 struct wpabuf *plain = wpabuf_alloc(500); in wps_build_m2() local
1926 if (plain == NULL || in wps_build_m2()
[all …]
Dwps_common.c360 struct wpabuf *plain; in wps_get_oob_cred() local
362 plain = wpabuf_alloc(500); in wps_get_oob_cred()
363 if (plain == NULL) { in wps_get_oob_cred()
373 if (wps_build_cred(&data, plain) || in wps_get_oob_cred()
374 (rf_band && wps_build_rf_bands_attr(plain, rf_band)) || in wps_get_oob_cred()
375 (channel && wps_build_ap_channel(plain, channel)) || in wps_get_oob_cred()
376 wps_build_mac_addr(plain, wps->dev.mac_addr) || in wps_get_oob_cred()
377 wps_build_wfa_ext(plain, 0, NULL, 0, 0)) { in wps_get_oob_cred()
379 wpabuf_clear_free(plain); in wps_get_oob_cred()
408 return plain; in wps_get_oob_cred()
Dwps_attr_build.c394 struct wpabuf *plain) in wps_build_encr_settings() argument
403 pad_len = block_size - wpabuf_len(plain) % block_size; in wps_build_encr_settings()
404 os_memset(wpabuf_put(plain, pad_len), pad_len, pad_len); in wps_build_encr_settings()
407 wpabuf_put_be16(msg, block_size + wpabuf_len(plain)); in wps_build_encr_settings()
414 wpabuf_put_buf(msg, plain); in wps_build_encr_settings()
415 if (aes_128_cbc_encrypt(wps->keywrapkey, iv, data, wpabuf_len(plain))) in wps_build_encr_settings()
/hostap-latest/src/eap_peer/
Dikev2.c1110 struct wpabuf *plain = wpabuf_alloc(data->IDr_len + 1000); in ikev2_build_sa_init() local
1111 if (plain == NULL) { in ikev2_build_sa_init()
1115 if (ikev2_build_idr(data, plain, in ikev2_build_sa_init()
1119 &data->keys, 0, msg, plain, in ikev2_build_sa_init()
1121 wpabuf_free(plain); in ikev2_build_sa_init()
1125 wpabuf_free(plain); in ikev2_build_sa_init()
1143 struct wpabuf *msg, *plain; in ikev2_build_sa_auth() local
1152 plain = wpabuf_alloc(data->IDr_len + 1000); in ikev2_build_sa_auth()
1153 if (plain == NULL) { in ikev2_build_sa_auth()
1158 if (ikev2_build_idr(data, plain, IKEV2_PAYLOAD_AUTHENTICATION) || in ikev2_build_sa_auth()
[all …]
/hostap-latest/src/eap_common/
Dikev2_common.c176 const u8 *plain, u8 *crypt, size_t len) in ikev2_encr_encrypt() argument
199 if (crypto_cipher_encrypt(cipher, plain, crypt, len) < 0) { in ikev2_encr_encrypt()
211 const u8 *crypt, u8 *plain, size_t len) in ikev2_encr_decrypt() argument
234 if (crypto_cipher_decrypt(cipher, crypt, plain, len) < 0) { in ikev2_encr_decrypt()
532 struct wpabuf *plain, u8 next_payload) in ikev2_build_encrypted() argument
580 pad_len = iv_len - (wpabuf_len(plain) + 1) % iv_len; in ikev2_build_encrypted()
583 wpabuf_put(plain, pad_len); in ikev2_build_encrypted()
584 wpabuf_put_u8(plain, pad_len); in ikev2_build_encrypted()
587 wpabuf_head(plain), wpabuf_mhead(plain), in ikev2_build_encrypted()
588 wpabuf_len(plain)) < 0) in ikev2_build_encrypted()
[all …]
/hostap-latest/src/eap_server/
Deap_server_tls_common.c387 struct wpabuf *plain, *encr; in eap_server_tls_phase1() local
408 plain = wpabuf_alloc(1); in eap_server_tls_phase1()
409 if (!plain) in eap_server_tls_phase1()
411 wpabuf_put_u8(plain, 0); in eap_server_tls_phase1()
412 encr = eap_server_tls_encrypt(sm, data, plain); in eap_server_tls_phase1()
413 wpabuf_free(plain); in eap_server_tls_phase1()
514 const struct wpabuf *plain) in eap_server_tls_encrypt() argument
518 buf = tls_connection_encrypt(sm->cfg->ssl_ctx, data->conn, plain); in eap_server_tls_encrypt()
/hostap-latest/src/ap/
Dwpa_auth_ft.c78 u8 **plain, size_t *plain_size) in wpa_ft_rrb_decrypt() argument
90 *plain = os_memdup(enc, enc_len); in wpa_ft_rrb_decrypt()
91 if (enc_len > 0 && !*plain) in wpa_ft_rrb_decrypt()
99 *plain = NULL; in wpa_ft_rrb_decrypt()
105 *plain = os_zalloc(enc_len - AES_BLOCK_SIZE); in wpa_ft_rrb_decrypt()
106 if (!*plain) in wpa_ft_rrb_decrypt()
110 *plain) < 0) { in wpa_ft_rrb_decrypt()
119 *plain) < 0) in wpa_ft_rrb_decrypt()
125 *plain, *plain_size); in wpa_ft_rrb_decrypt()
128 os_free(*plain); in wpa_ft_rrb_decrypt()
[all …]

12