ElG/AES debug log tweaks

This commit is contained in:
zzz
2020-04-16 13:27:53 +00:00
parent 80f66113c4
commit cc5f13fc5e

View File

@ -120,7 +120,7 @@ public final class ElGamalAESEngine {
if (decrypted != null) { if (decrypted != null) {
_context.statManager().updateFrequency("crypto.elGamalAES.decryptExistingSession"); _context.statManager().updateFrequency("crypto.elGamalAES.decryptExistingSession");
if (!foundTags.isEmpty() && shouldDebug) if (!foundTags.isEmpty() && shouldDebug)
_log.debug("ElG/AES decrypt success with " + st + ": found tags: " + foundTags); _log.debug("ElG/AES decrypt success with " + st + ": found tags: " + foundTags.size());
wasExisting = true; wasExisting = true;
} else { } else {
_context.statManager().updateFrequency("crypto.elGamalAES.decryptFailed"); _context.statManager().updateFrequency("crypto.elGamalAES.decryptFailed");
@ -133,7 +133,7 @@ public final class ElGamalAESEngine {
if (decrypted != null) { if (decrypted != null) {
_context.statManager().updateFrequency("crypto.elGamalAES.decryptNewSession"); _context.statManager().updateFrequency("crypto.elGamalAES.decryptNewSession");
if (!foundTags.isEmpty() && shouldDebug) if (!foundTags.isEmpty() && shouldDebug)
_log.debug("ElG decrypt success: found tags: " + foundTags); _log.debug("ElG decrypt success: found tags: " + foundTags.size());
} else { } else {
_context.statManager().updateFrequency("crypto.elGamalAES.decryptFailed"); _context.statManager().updateFrequency("crypto.elGamalAES.decryptFailed");
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
@ -189,15 +189,15 @@ public final class ElGamalAESEngine {
if (decrypted != null) { if (decrypted != null) {
_context.statManager().updateFrequency("crypto.elGamalAES.decryptExistingSession"); _context.statManager().updateFrequency("crypto.elGamalAES.decryptExistingSession");
if (!foundTags.isEmpty() && shouldDebug) if (!foundTags.isEmpty() && shouldDebug)
_log.debug("ElG/AES decrypt success with " + st + ": found tags: " + foundTags); _log.debug("ElG/AES decrypt success with " + st + ": found tags: " + foundTags.size());
if (!foundTags.isEmpty()) { if (!foundTags.isEmpty()) {
if (foundKey.getData() != null) { if (foundKey.getData() != null) {
if (shouldDebug) if (shouldDebug)
_log.debug("Found key: " + foundKey.toBase64() + " tags: " + foundTags + " in existing session"); _log.debug("Found key: " + foundKey.toBase64() + " in existing session");
keyManager.tagsReceived(foundKey, foundTags); keyManager.tagsReceived(foundKey, foundTags);
} else if (usedKey.getData() != null) { } else if (usedKey.getData() != null) {
if (shouldDebug) if (shouldDebug)
_log.debug("Used key: " + usedKey.toBase64() + " tags: " + foundTags + " in existing session"); _log.debug("Used key: " + usedKey.toBase64() + " in existing session");
keyManager.tagsReceived(usedKey, foundTags); keyManager.tagsReceived(usedKey, foundTags);
} }
} }
@ -236,14 +236,14 @@ public final class ElGamalAESEngine {
} }
if (!foundTags.isEmpty()) { if (!foundTags.isEmpty()) {
if (shouldDebug) if (shouldDebug)
_log.debug("ElG decrypt success: found tags: " + foundTags); _log.debug("ElG decrypt success: found tags: " + foundTags.size());
if (foundKey.getData() != null) { if (foundKey.getData() != null) {
if (shouldDebug) if (shouldDebug)
_log.debug("Found key: " + foundKey.toBase64() + " tags: " + foundTags + " in new session"); _log.debug("Found key: " + foundKey.toBase64() + " in new session");
keyManager.tagsReceived(foundKey, foundTags); keyManager.tagsReceived(foundKey, foundTags);
} else if (usedKey.getData() != null) { } else if (usedKey.getData() != null) {
if (shouldDebug) if (shouldDebug)
_log.debug("Used key: " + usedKey.toBase64() + " tags: " + foundTags + " in new session"); _log.debug("Used key: " + usedKey.toBase64() + " in new session");
keyManager.tagsReceived(usedKey, foundTags); keyManager.tagsReceived(usedKey, foundTags);
} }
} }