Lines Matching full:slot
426 /* Write out the partition header and key slot headers */ in qcrypto_block_luks_store_header()
692 * Given a key slot, user password, and the master key,
712 QCryptoBlockLUKSKeySlot *slot; in qcrypto_block_luks_store_key() local
723 slot = &luks->header.key_slots[slot_idx]; in qcrypto_block_luks_store_key()
724 splitkeylen = luks->header.master_key_len * slot->stripes; in qcrypto_block_luks_store_key()
726 if (qcrypto_random_bytes(slot->salt, in qcrypto_block_luks_store_key()
739 slot->salt, in qcrypto_block_luks_store_key()
765 slot->iterations = in qcrypto_block_luks_store_key()
776 slot->salt, in qcrypto_block_luks_store_key()
778 slot->iterations, in qcrypto_block_luks_store_key()
815 slot->stripes, in qcrypto_block_luks_store_key()
835 /* Write out the slot's master key material. */ in qcrypto_block_luks_store_key()
837 slot->key_offset_sector * in qcrypto_block_luks_store_key()
845 slot->active = QCRYPTO_BLOCK_LUKS_KEY_SLOT_ENABLED; in qcrypto_block_luks_store_key()
864 * Given a key slot, and user password, this will attempt to unlock
865 * the master encryption key from the key slot.
868 * 0 if the key slot is disabled, or key could not be decrypted
870 * 1 if the key slot is enabled, and key decrypted successfully
884 const QCryptoBlockLUKSKeySlot *slot; in qcrypto_block_luks_load_key() local
895 slot = &luks->header.key_slots[slot_idx]; in qcrypto_block_luks_load_key()
896 if (slot->active != QCRYPTO_BLOCK_LUKS_KEY_SLOT_ENABLED) { in qcrypto_block_luks_load_key()
900 splitkeylen = luks->header.master_key_len * slot->stripes; in qcrypto_block_luks_load_key()
913 slot->salt, QCRYPTO_BLOCK_LUKS_SALT_LEN, in qcrypto_block_luks_load_key()
914 slot->iterations, in qcrypto_block_luks_load_key()
928 slot->key_offset_sector * QCRYPTO_BLOCK_LUKS_SECTOR_SIZE, in qcrypto_block_luks_load_key()
986 slot->stripes, in qcrypto_block_luks_load_key()
999 * then comparing that to the hash stored in the key slot in qcrypto_block_luks_load_key()
1020 /* Fail, user's password was not valid for this key slot, in qcrypto_block_luks_load_key()
1021 * tell caller to try another slot */ in qcrypto_block_luks_load_key()
1028 * slots and try to unlock each active key slot using the
1066 * Returns true if a slot i is marked as active
1099 * Finds first key slot which is not active
1100 * Returns the key slot index, or -1 if it doesn't exist
1130 QCryptoBlockLUKSKeySlot *slot; in qcrypto_block_luks_erase_key() local
1138 slot = &luks->header.key_slots[slot_idx]; in qcrypto_block_luks_erase_key()
1140 splitkeylen = luks->header.master_key_len * slot->stripes; in qcrypto_block_luks_erase_key()
1145 /* Reset the key slot header */ in qcrypto_block_luks_erase_key()
1146 memset(slot->salt, 0, QCRYPTO_BLOCK_LUKS_SALT_LEN); in qcrypto_block_luks_erase_key()
1147 slot->iterations = 0; in qcrypto_block_luks_erase_key()
1148 slot->active = QCRYPTO_BLOCK_LUKS_KEY_SLOT_DISABLED; in qcrypto_block_luks_erase_key()
1165 * at least zeros to the key slot at least once in qcrypto_block_luks_erase_key()
1174 slot->key_offset_sector * QCRYPTO_BLOCK_LUKS_SECTOR_SIZE, in qcrypto_block_luks_erase_key()
1229 /* Try to find which key slot our password is valid for in qcrypto_block_luks_open()
1230 * and unlock the master key from that slot. in qcrypto_block_luks_open()
1540 QCryptoBlockLUKSKeySlot *slot = &luks->header.key_slots[i]; in qcrypto_block_luks_create() local
1541 slot->active = QCRYPTO_BLOCK_LUKS_KEY_SLOT_DISABLED; in qcrypto_block_luks_create()
1543 slot->key_offset_sector = header_sectors + i * split_key_sectors; in qcrypto_block_luks_create()
1544 slot->stripes = QCRYPTO_BLOCK_LUKS_STRIPES; in qcrypto_block_luks_create()
1556 * slot headers, rounded up to the nearest sector, combined with in qcrypto_block_luks_create()
1579 /* populate the slot 0 with the password encrypted master key*/ in qcrypto_block_luks_create()
1733 * checking if slot matches the given old password in qcrypto_block_luks_amend_erase_keyslots()
1882 QCryptoBlockInfoLUKSSlot *slot; in qcrypto_block_luks_get_info() local
1901 slot = g_new0(QCryptoBlockInfoLUKSSlot, 1); in qcrypto_block_luks_get_info()
1902 slot->active = luks->header.key_slots[i].active == in qcrypto_block_luks_get_info()
1904 slot->key_offset = luks->header.key_slots[i].key_offset_sector in qcrypto_block_luks_get_info()
1906 if (slot->active) { in qcrypto_block_luks_get_info()
1907 slot->has_iters = true; in qcrypto_block_luks_get_info()
1908 slot->iters = luks->header.key_slots[i].iterations; in qcrypto_block_luks_get_info()
1909 slot->has_stripes = true; in qcrypto_block_luks_get_info()
1910 slot->stripes = luks->header.key_slots[i].stripes; in qcrypto_block_luks_get_info()
1913 QAPI_LIST_APPEND(tail, slot); in qcrypto_block_luks_get_info()