Actions
Bug #53107
openEncryption.py explodes if osd_dmcrypt_key_size is specified
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
If osd_dmcrypt_key_size is specified then this code in encryption.py:
dmcrypt_key_size = conf.ceph.get_safe( 'osd', 'osd_dmcrypt_key_size', default=1024, )
returns the key size as a str. The next bit of code tries to do some math with it:
random_string = os.urandom(int(dmcrypt_key_size / 8))
and explodes with an unsupported types for / error. There are 2 things wrong with this code:
- The default is type int, but the conf.ceph.get_safe() returns a str
- the random_string calc should cast dmcrypt_key_size before the divide
A patch for both of these (against master) is attached.
Files
Actions