Skip to content

Commit 58eb321

Browse files
author
chengyitian
committed
AJ-845: add check for SCRAM when use ayncTask;
1 parent 96ae1d5 commit 58eb321

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/com/xxdb/DBConnection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ private void login(String userId, String password, boolean enableEncryption) thr
315315
}
316316

317317
private void scramLogin() throws IOException {
318+
if (asynTask_)
319+
throw new IOException("SCRAM login is not supported in async mode.");
320+
318321
List<Entity> args = new ArrayList<>();
319322
args.add(new BasicString(this.userId_));
320323
String clientNonce = CryptoUtils.generateNonce(16);
@@ -332,7 +335,7 @@ else if (e.getMessage().contains("sha256 authMode doesn't support scram authMode
332335
throw e;
333336
}
334337

335-
if (Objects.isNull(result) || !result.isVector() || result.rows() != 3)
338+
if (!result.isVector() || result.rows() != 3)
336339
throw new IOException("SCRAM login failed, server error: get server nonce failed.");
337340

338341
String saltString = ((Vector) result).get(0).getString();

0 commit comments

Comments
 (0)