Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching refs:rl

170  * @rl: Pointer to TLS record layer data
179 int tlsv1_record_set_cipher_suite(struct tlsv1_record_layer *rl,
187 rl->cipher_suite = cipher_suite;
194 rl->hash_alg = CRYPTO_HASH_ALG_HMAC_MD5;
195 rl->hash_size = MD5_MAC_LEN;
197 rl->hash_alg = CRYPTO_HASH_ALG_HMAC_SHA1;
198 rl->hash_size = SHA1_MAC_LEN;
205 rl->key_material_len = data->key_material;
206 rl->iv_size = data->block_size;
207 rl->cipher_alg = data->alg;
215 * @rl: Pointer to TLS record layer data
221 int tlsv1_record_change_write_cipher(struct tlsv1_record_layer *rl)
224 "0x%04x", rl->cipher_suite);
225 rl->write_cipher_suite = rl->cipher_suite;
226 os_memset(rl->write_seq_num, 0, TLS_SEQ_NUM_LEN);
228 if (rl->write_cbc) {
229 crypto_cipher_deinit(rl->write_cbc);
230 rl->write_cbc = NULL;
232 if (rl->cipher_alg != CRYPTO_CIPHER_NULL) {
233 rl->write_cbc = crypto_cipher_init(rl->cipher_alg,
234 rl->write_iv, rl->write_key,
235 rl->key_material_len);
236 if (rl->write_cbc == NULL) {
249 * @rl: Pointer to TLS record layer data
255 int tlsv1_record_change_read_cipher(struct tlsv1_record_layer *rl)
258 "0x%04x", rl->cipher_suite);
259 rl->read_cipher_suite = rl->cipher_suite;
260 os_memset(rl->read_seq_num, 0, TLS_SEQ_NUM_LEN);
262 if (rl->read_cbc) {
263 crypto_cipher_deinit(rl->read_cbc);
264 rl->read_cbc = NULL;
266 if (rl->cipher_alg != CRYPTO_CIPHER_NULL) {
267 rl->read_cbc = crypto_cipher_init(rl->cipher_alg,
268 rl->read_iv, rl->read_key,
269 rl->key_material_len);
270 if (rl->read_cbc == NULL) {
283 * @rl: Pointer to TLS record layer data
296 int tlsv1_record_send(struct tlsv1_record_layer *rl, u8 content_type, u8 *buf,
319 if (rl->write_cipher_suite != TLS_NULL_WITH_NULL_NULL) {
320 hmac = crypto_hash_init(rl->hash_alg, rl->write_mac_secret,
321 rl->hash_size);
327 crypto_hash_update(hmac, rl->write_seq_num, TLS_SEQ_NUM_LEN);
331 if (clen < rl->hash_size) {
346 if (rl->iv_size) {
349 pad = (len + 1) % rl->iv_size;
351 pad = rl->iv_size - pad;
361 if (crypto_cipher_encrypt(rl->write_cbc, payload,
367 inc_byte_array(rl->write_seq_num, TLS_SEQ_NUM_LEN);
377 * @rl: Pointer to TLS record layer data
389 int tlsv1_record_receive(struct tlsv1_record_layer *rl,
461 if (rl->read_cipher_suite != TLS_NULL_WITH_NULL_NULL) {
462 if (crypto_cipher_decrypt(rl->read_cbc, out_data,
467 if (rl->iv_size) {
502 if (*out_len < rl->hash_size) {
509 *out_len -= rl->hash_size;
511 hmac = crypto_hash_init(rl->hash_alg, rl->read_mac_secret,
512 rl->hash_size);
520 crypto_hash_update(hmac, rl->read_seq_num, TLS_SEQ_NUM_LEN);
532 if (hlen != rl->hash_size ||
549 inc_byte_array(rl->read_seq_num, TLS_SEQ_NUM_LEN);