sandynz commented on code in PR #22740:
URL: https://github.com/apache/shardingsphere/pull/22740#discussion_r1043019922
##########
kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/PasswordEncryption.java:
##########
@@ -107,7 +107,7 @@ private static RSAPublicKey parseRSAPublicKey(final String
key) throws GeneralSe
private static byte[] formatKey(final String key) {
int start = key.indexOf("\n") + 1;
- int end = key.lastIndexOf("\n");
+ int end = key.endsWith("\n") ? key.substring(0, key.length() -
2).lastIndexOf("\n") : key.lastIndexOf("\n");
return key.substring(start, end).replace("\n", "").getBytes();
Review Comment:
1, OK. Could we add unit test for `parseRSAPublicKey`? Since it doesn't
occur every time in E2E test
--
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]