calvix commented on code in PR #13556:
URL: https://github.com/apache/cloudstack/pull/13556#discussion_r3788622869


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtResizeVolumeCommandWrapper.java:
##########
@@ -213,6 +225,16 @@ private void resizeEncryptedQcowFile(final KVMPhysicalDisk 
vol, final QemuObject
         }
     }
 
+    private void resizeRbdEncryptedVolume(final KVMStoragePool pool, final 
KVMPhysicalDisk vol, long newSize,
+                                          boolean shrinkOk, byte[] passphrase) 
throws CloudRuntimeException {
+        try {
+            new RbdEncryption().resize(pool.getSourceHost(), 
pool.getSourcePort(), pool.getAuthUserName(),
+                    pool.getAuthSecret(), pool.getSourceDir(), vol.getName(), 
newSize, shrinkOk, passphrase);
+        } finally {
+            Arrays.fill(passphrase, (byte) 0);

Review Comment:
   `Arrays.fill(passphrase, (byte) 0)`  is wiping the passphrase  after it's 
finished working with it
   
   The main reasoning is that I tried to follow the same process that is used 
for the function above  - `resizeEncryptedQcowFile`, which does the same.
   
github.com/apache/cloudstack/blob/main/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtResizeVolumeCommandWrapper.java#L212



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to