mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
schema: Encode URL safe random vnc password string
/+= may break on some environments, url safe encoded passwords will have -_, characters which are more acceptable Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit 19cc5eb9e6f1b5127bf01e4c1ae061875e61cb4c) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
23c990f7c9
commit
6c1dde8f86
@ -210,7 +210,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
|
||||
byte[] randomBytes = new byte[16];
|
||||
random.nextBytes(randomBytes);
|
||||
vncPassword = Base64.encodeBase64String(randomBytes);
|
||||
vncPassword = Base64.encodeBase64URLSafeString(randomBytes);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
s_logger.error("Unexpected exception in SecureRandom Algorithm selection ", e);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user