Skip to content

Commit

Permalink
zkey: Fix display of clear key size for XTS keys
Browse files Browse the repository at this point in the history
Fixes: 298fab6 ("zkey: Preparations for introducing a new key type")
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
  • Loading branch information
ifranzki authored and hoeppnerj committed Jan 22, 2020
1 parent 1a87d3a commit e7f4464
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zkey/pkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,8 @@ int get_key_bit_size(const u8 *key, size_t key_size, size_t *bitsize)
if (is_cca_aes_data_key(key, key_size)) {
*bitsize = datakey->bitsize;
if (key_size == 2 * AESDATA_KEY_SIZE) {
datakey = (struct aesdatakeytoken *)key +
AESDATA_KEY_SIZE;
datakey = (struct aesdatakeytoken *)(key +
AESDATA_KEY_SIZE);
*bitsize += datakey->bitsize;
}
} else if (is_cca_aes_cipher_key(key, key_size)) {
Expand All @@ -1601,8 +1601,8 @@ int get_key_bit_size(const u8 *key, size_t key_size, size_t *bitsize)
else
*bitsize = 0; /* Unknown */
if (key_size > cipherkey->length) {
cipherkey = (struct aescipherkeytoken *)key +
cipherkey->length;
cipherkey = (struct aescipherkeytoken *)(key +
cipherkey->length);
if (cipherkey->pfv == 0x00) /* V0 payload */
*bitsize += cipherkey->pl - 384;
}
Expand Down

0 comments on commit e7f4464

Please sign in to comment.