This patch fixes the decoding of the encryption key passed to dmcrypt.
During the key management move from Nova to Castellan, in the Newton
release, conversion of the encryption key (from a string to list of
unsigned ints) was removed from the key retrieval method. This patch
updates dmcrypt to decode an encryption key string, rather than a list
of unsigned ints. See the linked bug for more information.
The method used to decode the encryption key has been updated to use
binascii, as done in os-brick [1], to maintain consistency. The key
generation and decoding portions of test_dmcrypt have been updated to
reflect this change and ensure compatibility with both, Python 2 and
Python 3.
Reviewed: https:/ /review. openstack. org/466480 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=bc8d0723e6e 43d9b95ff9a5c4c bf7b0bec503a2f
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit bc8d0723e6e43d9 b95ff9a5c4cbf7b 0bec503a2f
Author: Jackie Truong <email address hidden>
Date: Thu May 4 12:51:22 2017 -0400
Fix decoding of encryption key passed to dmcrypt
This patch fixes the decoding of the encryption key passed to dmcrypt.
During the key management move from Nova to Castellan, in the Newton
release, conversion of the encryption key (from a string to list of
unsigned ints) was removed from the key retrieval method. This patch
updates dmcrypt to decode an encryption key string, rather than a list
of unsigned ints. See the linked bug for more information.
The method used to decode the encryption key has been updated to use
binascii, as done in os-brick [1], to maintain consistency. The key
generation and decoding portions of test_dmcrypt have been updated to
reflect this change and ensure compatibility with both, Python 2 and
Python 3.
[1] https:/ /github. com/openstack/ os-brick/ blob/6cf9b1cd68 9f70a2c50c0fa83 a9a9f7c502712a1 /os_brick/ encryptors/ cryptsetup. py#L100- L102
Closes-Bug: #1688342 a972038cf72b065 0321ded2856 018c16d17403242 7a172378ed)
Change-Id: I050585ecb55742
(cherry picked from commit 53a71c1241aac70