Lines Matching refs:packet_size
622 size_t *packet_size, in ecryptfs_write_tag_70_packet() argument
634 (*packet_size) = 0; in ecryptfs_write_tag_70_packet()
678 (*packet_size) = s->max_packet_size; in ecryptfs_write_tag_70_packet()
839 (*packet_size) = s->i; in ecryptfs_write_tag_70_packet()
840 (*remaining_bytes) -= (*packet_size); in ecryptfs_write_tag_70_packet()
895 size_t *packet_size, in ecryptfs_parse_tag_70_packet() argument
903 (*packet_size) = 0; in ecryptfs_parse_tag_70_packet()
925 if (data[(*packet_size)++] != ECRYPTFS_TAG_70_PACKET_TYPE) { in ecryptfs_parse_tag_70_packet()
928 data[((*packet_size) - 1)], ECRYPTFS_TAG_70_PACKET_TYPE); in ecryptfs_parse_tag_70_packet()
932 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], in ecryptfs_parse_tag_70_packet()
951 (*packet_size) += s->packet_size_len; in ecryptfs_parse_tag_70_packet()
952 ecryptfs_to_hex(s->fnek_sig_hex, &data[(*packet_size)], in ecryptfs_parse_tag_70_packet()
955 (*packet_size) += ECRYPTFS_SIG_SIZE; in ecryptfs_parse_tag_70_packet()
956 s->cipher_code = data[(*packet_size)++]; in ecryptfs_parse_tag_70_packet()
982 rc = virt_to_scatterlist(&data[(*packet_size)], in ecryptfs_parse_tag_70_packet()
991 (*packet_size) += s->block_aligned_filename_size; in ecryptfs_parse_tag_70_packet()
1086 (*packet_size) = 0; in ecryptfs_parse_tag_70_packet()
1229 size_t *packet_size, size_t max_packet_size) in parse_tag_1_packet() argument
1236 (*packet_size) = 0; in parse_tag_1_packet()
1256 if (data[(*packet_size)++] != ECRYPTFS_TAG_1_PACKET_TYPE) { in parse_tag_1_packet()
1273 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], &body_size, in parse_tag_1_packet()
1285 (*packet_size) += length_size; in parse_tag_1_packet()
1286 if (unlikely((*packet_size) + body_size > max_packet_size)) { in parse_tag_1_packet()
1291 if (unlikely(data[(*packet_size)++] != 0x03)) { in parse_tag_1_packet()
1293 data[(*packet_size) - 1]); in parse_tag_1_packet()
1298 &data[(*packet_size)], ECRYPTFS_SIG_SIZE); in parse_tag_1_packet()
1299 *packet_size += ECRYPTFS_SIG_SIZE; in parse_tag_1_packet()
1302 (*packet_size)++; in parse_tag_1_packet()
1313 &data[(*packet_size)], (body_size - (ECRYPTFS_SIG_SIZE + 2))); in parse_tag_1_packet()
1314 (*packet_size) += (*new_auth_tok)->session_key.encrypted_key_size; in parse_tag_1_packet()
1335 (*packet_size) = 0; in parse_tag_1_packet()
1361 size_t *packet_size, size_t max_packet_size) in parse_tag_3_packet() argument
1368 (*packet_size) = 0; in parse_tag_3_packet()
1391 if (data[(*packet_size)++] != ECRYPTFS_TAG_3_PACKET_TYPE) { in parse_tag_3_packet()
1407 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], &body_size, in parse_tag_3_packet()
1419 (*packet_size) += length_size; in parse_tag_3_packet()
1420 if (unlikely((*packet_size) + body_size > max_packet_size)) { in parse_tag_3_packet()
1434 if (unlikely(data[(*packet_size)++] != 0x04)) { in parse_tag_3_packet()
1436 data[(*packet_size) - 1]); in parse_tag_3_packet()
1441 (u16)data[(*packet_size)]); in parse_tag_3_packet()
1446 switch(data[(*packet_size)++]) { in parse_tag_3_packet()
1457 if (unlikely(data[(*packet_size)++] != 0x03)) { in parse_tag_3_packet()
1463 switch (data[(*packet_size)++]) { in parse_tag_3_packet()
1467 &data[(*packet_size)], ECRYPTFS_SALT_SIZE); in parse_tag_3_packet()
1468 (*packet_size) += ECRYPTFS_SALT_SIZE; in parse_tag_3_packet()
1471 ((u32) 16 + (data[(*packet_size)] & 15)) in parse_tag_3_packet()
1472 << ((data[(*packet_size)] >> 4) + 6); in parse_tag_3_packet()
1473 (*packet_size)++; in parse_tag_3_packet()
1478 &data[(*packet_size)], in parse_tag_3_packet()
1480 (*packet_size) += in parse_tag_3_packet()
1490 "[%d]\n", data[(*packet_size) - 1]); in parse_tag_3_packet()
1511 (*packet_size) = 0; in parse_tag_3_packet()
1534 size_t *packet_size, size_t max_packet_size) in parse_tag_11_packet() argument
1540 (*packet_size) = 0; in parse_tag_11_packet()
1561 if (data[(*packet_size)++] != ECRYPTFS_TAG_11_PACKET_TYPE) { in parse_tag_11_packet()
1566 rc = ecryptfs_parse_packet_length(&data[(*packet_size)], &body_size, in parse_tag_11_packet()
1577 (*packet_size) += length_size; in parse_tag_11_packet()
1579 if (unlikely((*packet_size) + body_size + 1 > max_packet_size)) { in parse_tag_11_packet()
1590 if (data[(*packet_size)++] != 0x62) { in parse_tag_11_packet()
1595 if (data[(*packet_size)++] != 0x08) { in parse_tag_11_packet()
1600 (*packet_size) += 12; /* Ignore filename and modification date */ in parse_tag_11_packet()
1601 memcpy(contents, &data[(*packet_size)], (*tag_11_contents_size)); in parse_tag_11_packet()
1602 (*packet_size) += (*tag_11_contents_size); in parse_tag_11_packet()
1605 (*packet_size) = 0; in parse_tag_11_packet()
1766 size_t packet_size; in ecryptfs_parse_packet_set() local
1787 &packet_size, max_packet_size); in ecryptfs_parse_packet_set()
1794 i += packet_size; in ecryptfs_parse_packet_set()
1831 &packet_size, max_packet_size); in ecryptfs_parse_packet_set()
1838 i += packet_size; in ecryptfs_parse_packet_set()
2024 struct ecryptfs_key_record *key_rec, size_t *packet_size) in write_tag_1_packet() argument
2032 (*packet_size) = 0; in write_tag_1_packet()
2077 dest[(*packet_size)++] = ECRYPTFS_TAG_1_PACKET_TYPE; in write_tag_1_packet()
2078 rc = ecryptfs_write_packet_length(&dest[(*packet_size)], in write_tag_1_packet()
2086 (*packet_size) += packet_size_length; in write_tag_1_packet()
2087 dest[(*packet_size)++] = 0x03; /* version 3 */ in write_tag_1_packet()
2088 memcpy(&dest[(*packet_size)], key_rec->sig, ECRYPTFS_SIG_SIZE); in write_tag_1_packet()
2089 (*packet_size) += ECRYPTFS_SIG_SIZE; in write_tag_1_packet()
2090 dest[(*packet_size)++] = RFC2440_CIPHER_RSA; in write_tag_1_packet()
2091 memcpy(&dest[(*packet_size)], key_rec->enc_key, in write_tag_1_packet()
2093 (*packet_size) += key_rec->enc_key_size; in write_tag_1_packet()
2096 (*packet_size) = 0; in write_tag_1_packet()
2098 (*remaining_bytes) -= (*packet_size); in write_tag_1_packet()
2179 struct ecryptfs_key_record *key_rec, size_t *packet_size) in write_tag_3_packet() argument
2196 (*packet_size) = 0; in write_tag_3_packet()
2342 dest[(*packet_size)++] = ECRYPTFS_TAG_3_PACKET_TYPE; in write_tag_3_packet()
2345 rc = ecryptfs_write_packet_length(&dest[(*packet_size)], in write_tag_3_packet()
2353 (*packet_size) += packet_size_length; in write_tag_3_packet()
2354 dest[(*packet_size)++] = 0x04; /* version 4 */ in write_tag_3_packet()
2365 dest[(*packet_size)++] = cipher_code; in write_tag_3_packet()
2366 dest[(*packet_size)++] = 0x03; /* S2K */ in write_tag_3_packet()
2367 dest[(*packet_size)++] = 0x01; /* MD5 (TODO: parameterize) */ in write_tag_3_packet()
2368 memcpy(&dest[(*packet_size)], auth_tok->token.password.salt, in write_tag_3_packet()
2370 (*packet_size) += ECRYPTFS_SALT_SIZE; /* salt */ in write_tag_3_packet()
2371 dest[(*packet_size)++] = 0x60; /* hash iterations (65536) */ in write_tag_3_packet()
2372 memcpy(&dest[(*packet_size)], key_rec->enc_key, in write_tag_3_packet()
2374 (*packet_size) += key_rec->enc_key_size; in write_tag_3_packet()
2377 (*packet_size) = 0; in write_tag_3_packet()
2379 (*remaining_bytes) -= (*packet_size); in write_tag_3_packet()