Bug #53107 ยป encryption.py.patch
src/ceph-volume/ceph_volume/util/encryption.py | ||
---|---|---|
dmcrypt_key_size = conf.ceph.get_safe(
|
||
'osd',
|
||
'osd_dmcrypt_key_size',
|
||
default=1024,
|
||
default='1024',
|
||
)
|
||
# The size of the key is defined in bits, so we must transform that
|
||
# value to bytes (dividing by 8) because we read in bytes, not bits
|
||
random_string = os.urandom(int(dmcrypt_key_size / 8))
|
||
random_string = os.urandom(int(int(dmcrypt_key_size) / 8))
|
||
key = base64.b64encode(random_string).decode('utf-8')
|
||
return key
|
||