Lines Matching refs:packet_size

633 			     size_t *packet_size,  in ecryptfs_write_tag_70_packet()  argument
645 (*packet_size) = 0; in ecryptfs_write_tag_70_packet()
689 (*packet_size) = s->max_packet_size; in ecryptfs_write_tag_70_packet()
851 (*packet_size) = s->i; in ecryptfs_write_tag_70_packet()
852 (*remaining_bytes) -= (*packet_size); in ecryptfs_write_tag_70_packet()
907 size_t *packet_size, in ecryptfs_parse_tag_70_packet() argument
915 (*packet_size) = 0; in ecryptfs_parse_tag_70_packet()
937 if (data[(*packet_size)++] != ECRYPTFS_TAG_70_PACKET_TYPE) { in ecryptfs_parse_tag_70_packet()
940 data[((*packet_size) - 1)], ECRYPTFS_TAG_70_PACKET_TYPE); in ecryptfs_parse_tag_70_packet()
944 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], in ecryptfs_parse_tag_70_packet()
963 (*packet_size) += s->packet_size_len; in ecryptfs_parse_tag_70_packet()
964 ecryptfs_to_hex(s->fnek_sig_hex, &data[(*packet_size)], in ecryptfs_parse_tag_70_packet()
967 (*packet_size) += ECRYPTFS_SIG_SIZE; in ecryptfs_parse_tag_70_packet()
968 s->cipher_code = data[(*packet_size)++]; in ecryptfs_parse_tag_70_packet()
994 rc = virt_to_scatterlist(&data[(*packet_size)], in ecryptfs_parse_tag_70_packet()
1003 (*packet_size) += s->block_aligned_filename_size; in ecryptfs_parse_tag_70_packet()
1097 (*packet_size) = 0; in ecryptfs_parse_tag_70_packet()
1240 size_t *packet_size, size_t max_packet_size) in parse_tag_1_packet() argument
1247 (*packet_size) = 0; in parse_tag_1_packet()
1267 if (data[(*packet_size)++] != ECRYPTFS_TAG_1_PACKET_TYPE) { in parse_tag_1_packet()
1284 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], &body_size, in parse_tag_1_packet()
1296 (*packet_size) += length_size; in parse_tag_1_packet()
1297 if (unlikely((*packet_size) + body_size > max_packet_size)) { in parse_tag_1_packet()
1302 if (unlikely(data[(*packet_size)++] != 0x03)) { in parse_tag_1_packet()
1304 data[(*packet_size) - 1]); in parse_tag_1_packet()
1309 &data[(*packet_size)], ECRYPTFS_SIG_SIZE); in parse_tag_1_packet()
1310 *packet_size += ECRYPTFS_SIG_SIZE; in parse_tag_1_packet()
1313 (*packet_size)++; in parse_tag_1_packet()
1324 &data[(*packet_size)], (body_size - (ECRYPTFS_SIG_SIZE + 2))); in parse_tag_1_packet()
1325 (*packet_size) += (*new_auth_tok)->session_key.encrypted_key_size; in parse_tag_1_packet()
1346 (*packet_size) = 0; in parse_tag_1_packet()
1372 size_t *packet_size, size_t max_packet_size) in parse_tag_3_packet() argument
1379 (*packet_size) = 0; in parse_tag_3_packet()
1402 if (data[(*packet_size)++] != ECRYPTFS_TAG_3_PACKET_TYPE) { in parse_tag_3_packet()
1418 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], &body_size, in parse_tag_3_packet()
1430 (*packet_size) += length_size; in parse_tag_3_packet()
1431 if (unlikely((*packet_size) + body_size > max_packet_size)) { in parse_tag_3_packet()
1445 if (unlikely(data[(*packet_size)++] != 0x04)) { in parse_tag_3_packet()
1447 data[(*packet_size) - 1]); in parse_tag_3_packet()
1452 (u16)data[(*packet_size)]); in parse_tag_3_packet()
1457 switch(data[(*packet_size)++]) { in parse_tag_3_packet()
1468 if (unlikely(data[(*packet_size)++] != 0x03)) { in parse_tag_3_packet()
1474 switch (data[(*packet_size)++]) { in parse_tag_3_packet()
1478 &data[(*packet_size)], ECRYPTFS_SALT_SIZE); in parse_tag_3_packet()
1479 (*packet_size) += ECRYPTFS_SALT_SIZE; in parse_tag_3_packet()
1482 ((u32) 16 + (data[(*packet_size)] & 15)) in parse_tag_3_packet()
1483 << ((data[(*packet_size)] >> 4) + 6); in parse_tag_3_packet()
1484 (*packet_size)++; in parse_tag_3_packet()
1489 &data[(*packet_size)], in parse_tag_3_packet()
1491 (*packet_size) += in parse_tag_3_packet()
1501 "[%d]\n", data[(*packet_size) - 1]); in parse_tag_3_packet()
1522 (*packet_size) = 0; in parse_tag_3_packet()
1545 size_t *packet_size, size_t max_packet_size) in parse_tag_11_packet() argument
1551 (*packet_size) = 0; in parse_tag_11_packet()
1572 if (data[(*packet_size)++] != ECRYPTFS_TAG_11_PACKET_TYPE) { in parse_tag_11_packet()
1577 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], &body_size, in parse_tag_11_packet()
1588 (*packet_size) += length_size; in parse_tag_11_packet()
1590 if (unlikely((*packet_size) + body_size + 1 > max_packet_size)) { in parse_tag_11_packet()
1601 if (data[(*packet_size)++] != 0x62) { in parse_tag_11_packet()
1606 if (data[(*packet_size)++] != 0x08) { in parse_tag_11_packet()
1611 (*packet_size) += 12; /* Ignore filename and modification date */ in parse_tag_11_packet()
1612 memcpy(contents, &data[(*packet_size)], (*tag_11_contents_size)); in parse_tag_11_packet()
1613 (*packet_size) += (*tag_11_contents_size); in parse_tag_11_packet()
1616 (*packet_size) = 0; in parse_tag_11_packet()
1777 size_t packet_size; in ecryptfs_parse_packet_set() local
1798 &packet_size, max_packet_size); in ecryptfs_parse_packet_set()
1805 i += packet_size; in ecryptfs_parse_packet_set()
1842 &packet_size, max_packet_size); in ecryptfs_parse_packet_set()
1849 i += packet_size; in ecryptfs_parse_packet_set()
2035 struct ecryptfs_key_record *key_rec, size_t *packet_size) in write_tag_1_packet() argument
2043 (*packet_size) = 0; in write_tag_1_packet()
2088 dest[(*packet_size)++] = ECRYPTFS_TAG_1_PACKET_TYPE; in write_tag_1_packet()
2089 rc = ecryptfs_write_packet_length(&dest[(*packet_size)], in write_tag_1_packet()
2097 (*packet_size) += packet_size_length; in write_tag_1_packet()
2098 dest[(*packet_size)++] = 0x03; /* version 3 */ in write_tag_1_packet()
2099 memcpy(&dest[(*packet_size)], key_rec->sig, ECRYPTFS_SIG_SIZE); in write_tag_1_packet()
2100 (*packet_size) += ECRYPTFS_SIG_SIZE; in write_tag_1_packet()
2101 dest[(*packet_size)++] = RFC2440_CIPHER_RSA; in write_tag_1_packet()
2102 memcpy(&dest[(*packet_size)], key_rec->enc_key, in write_tag_1_packet()
2104 (*packet_size) += key_rec->enc_key_size; in write_tag_1_packet()
2107 (*packet_size) = 0; in write_tag_1_packet()
2109 (*remaining_bytes) -= (*packet_size); in write_tag_1_packet()
2190 struct ecryptfs_key_record *key_rec, size_t *packet_size) in write_tag_3_packet() argument
2207 (*packet_size) = 0; in write_tag_3_packet()
2353 dest[(*packet_size)++] = ECRYPTFS_TAG_3_PACKET_TYPE; in write_tag_3_packet()
2356 rc = ecryptfs_write_packet_length(&dest[(*packet_size)], in write_tag_3_packet()
2364 (*packet_size) += packet_size_length; in write_tag_3_packet()
2365 dest[(*packet_size)++] = 0x04; /* version 4 */ in write_tag_3_packet()
2376 dest[(*packet_size)++] = cipher_code; in write_tag_3_packet()
2377 dest[(*packet_size)++] = 0x03; /* S2K */ in write_tag_3_packet()
2378 dest[(*packet_size)++] = 0x01; /* MD5 (TODO: parameterize) */ in write_tag_3_packet()
2379 memcpy(&dest[(*packet_size)], auth_tok->token.password.salt, in write_tag_3_packet()
2381 (*packet_size) += ECRYPTFS_SALT_SIZE; /* salt */ in write_tag_3_packet()
2382 dest[(*packet_size)++] = 0x60; /* hash iterations (65536) */ in write_tag_3_packet()
2383 memcpy(&dest[(*packet_size)], key_rec->enc_key, in write_tag_3_packet()
2385 (*packet_size) += key_rec->enc_key_size; in write_tag_3_packet()
2388 (*packet_size) = 0; in write_tag_3_packet()
2390 (*remaining_bytes) -= (*packet_size); in write_tag_3_packet()