Skip to content

Commit 170690d

Browse files
Irfan SharifIrfan Sharif
authored andcommitted
Clear gsstoken during connection close
Signed-off-by: Irfan Sharif <[email protected]>
1 parent 2974b5b commit 170690d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/main/java/com/ibm/as400/access/AS400.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ private byte[] getGSSToken() {
404404
return this.gssToken_;
405405
}
406406

407+
public void clearGSSToken() {
408+
if (this.gssToken_ != null)
409+
CredentialVault.clearArray(gssToken_);
410+
}
411+
407412
// Determines if the password contains a Kerberos token
408413
private boolean isGSSToken(char[] auth){
409414
char[] prefix = KERBEROS_PREFIX_CHARS;
@@ -4201,6 +4206,7 @@ public void removeVetoableChangeListener(VetoableChangeListener listener)
42014206
public synchronized void resetAllServices()
42024207
{
42034208
if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Resetting all services.");
4209+
clearGSSToken();
42044210
setStayAlive(0);
42054211

42064212
disconnectAllServices();

src/main/java/com/ibm/as400/access/AS400JDBCConnectionImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,11 @@ public void close ()
592592

593593

594594
as400_.disconnectServer (server_);
595+
// Clear the sensitive auth token via the public AS400 object
596+
if (as400PublicClassObj_ != null) {
597+
as400PublicClassObj_.clearGSSToken();
598+
}
599+
595600
server_ = null;
596601
}
597602

0 commit comments

Comments
 (0)