NTCP: Log tweaks to help on ticket #996

This commit is contained in:
zzz
2014-04-17 18:54:58 +00:00
parent 6de81d41d2
commit f77a3c7f56
2 changed files with 9 additions and 3 deletions

View File

@ -81,8 +81,14 @@ public class CryptixAESEngine extends AESEngine {
*/
@Override
public void encrypt(byte payload[], int payloadIndex, byte out[], int outIndex, SessionKey sessionKey, byte iv[], int ivOffset, int length) {
if ( (payload == null) || (out == null) || (sessionKey == null) || (iv == null) )
throw new NullPointerException("invalid args to aes");
if (payload == null)
throw new NullPointerException("invalid args to aes - payload");
if (out == null)
throw new NullPointerException("invalid args to aes - out");
if (sessionKey == null)
throw new NullPointerException("invalid args to aes - sessionKey");
if (iv == null)
throw new NullPointerException("invalid args to aes - iv");
if (payload.length < payloadIndex + length)
throw new IllegalArgumentException("Payload is too short");
if (out.length < outIndex + length)

View File

@ -128,7 +128,7 @@ class Writer {
_prepBuffer.init();
con.prepareNextWrite(_prepBuffer);
} catch (RuntimeException re) {
_log.log(Log.CRIT, "Error in the ntcp writer", re);
_log.log(Log.CRIT, "Error in the ntcp writer on " + con, re);
}
}
}