Skip to content

Commit 2d82e07

Browse files
Logging improved
1 parent 2171878 commit 2d82e07

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/config/BleichenbacherCommandConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import de.rub.nds.tlsattacker.core.constants.CipherSuite;
2121
import java.util.LinkedList;
2222
import java.util.List;
23+
import org.apache.logging.log4j.Level;
24+
import org.apache.logging.log4j.core.config.Configurator;
2325

2426
/**
2527
*
@@ -67,6 +69,10 @@ public BleichenbacherCommandConfig(GeneralDelegate delegate) {
6769
addDelegate(ciphersuiteDelegate);
6870
addDelegate(protocolVersionDelegate);
6971
addDelegate(attackDelegate);
72+
73+
if (delegate.getLogLevel() != Level.ALL && delegate.getLogLevel() != Level.TRACE) {
74+
Configurator.setAllLevels("de.rub.nds.tlsattacker.core", Level.ERROR);
75+
}
7076
}
7177

7278
public Type getType() {

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/pkcs1/Bleichenbacher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private boolean stepFour(final int i) {
250250
solution = s0.modInverse(publicKey.getModulus());
251251
solution = solution.multiply(m[0].upper).mod(publicKey.getModulus());
252252

253-
LOGGER.debug("====> Solution found!\n {}", ArrayConverter.bytesToHexString(solution.toByteArray()));
253+
LOGGER.info("====> Solution found!\n {}", ArrayConverter.bytesToHexString(solution.toByteArray()));
254254

255255
result = true;
256256
}

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/pkcs1/oracles/RealDirectMessagePkcs1Oracle.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ public RealDirectMessagePkcs1Oracle(PublicKey pubKey, Config config, String vali
4444
this.config = config;
4545
this.validResponseContent = validResponseContent;
4646
this.invalidResponseContent = invalidResponseContent;
47-
48-
// LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
49-
// Configuration ctxConfig = ctx.getConfiguration();
50-
// LoggerConfig loggerConfig =
51-
// ctxConfig.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
52-
// loggerConfig.setLevel(Level.INFO);
53-
// ctx.updateLoggers();
5447
}
5548

5649
@Override

0 commit comments

Comments
 (0)