Skip to content

Commit 426223d

Browse files
committed
Took substring of public key and created buffer in XOR
Signed-off-by: S V <vats02581@gmail.com>
1 parent 304865b commit 426223d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/authentication/AuthUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static byte[] rotatingXor(byte[] password, byte[] seedBytes) {
119119
byte[] buffer = new byte[passwordLength];
120120

121121
for (int i = 0; i < passwordLength; i++) {
122-
buffer[i] = (byte)(password[i] ^ seedBytes[i % seedLength]);
122+
buffer[i] = (byte) (password[i] ^ seedBytes[i % seedLength]);
123123
}
124124

125125
return buffer;

r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/authentication/MySqlAuthProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static byte[] rsaEncryption(byte[] bytesToEncrypt, String serverRsaPublicKeyFile
160160

161161
int startIndex = key.indexOf("-----BEGIN PUBLIC KEY-----");
162162
int endIndex = key.indexOf("-----END PUBLIC KEY-----") + 23;
163-
key = key.substring(startIndex, endIndex+1);
163+
key = key.substring(startIndex, endIndex + 1);
164164
String publicKeyPEM = key
165165
.replace("-----BEGIN PUBLIC KEY-----", "")
166166
.replaceAll(System.lineSeparator(), "")

0 commit comments

Comments
 (0)