Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ Specify optionally `-times <n>` to run the input sequence multiple times.
- `py/**` is based on work done in [apferscher/ble-learning](https://github.com/apferscher/ble-learning) and [Matheus-Garbelini/sweyntooth_bluetooth_low_energy_attacks](https://github.com/Matheus-Garbelini/sweyntooth_bluetooth_low_energy_attacks)
- `experiments/targets/nRF52840` is based on an example in [NordicDeveloperAcademy/bt-fund](https://github.com/NordicDeveloperAcademy/bt-fund/tree/main/l5/l5_e1)
- `experiments/targets/RPiPico2W` is based on an example in [raspberrypi/pico-examples](https://github.com/raspberrypi/pico-examples/tree/master/pico_w/bt/standalone)
- `scripts/diff_hyps.sh` is copied from [protocol-fuzzing/edhoc-fuzzer](https://github.com/protocol-fuzzing/edhoc-fuzzer/blob/main/scripts/diff_hyps.sh)
- `scripts/diff_hyps.sh` is copied from [protocol-fuzzing/edhoc-fuzzer](https://github.com/protocol-fuzzing/edhoc-fuzzer/blob/main/scripts/diff_hyps.sh)
48 changes: 48 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,54 @@
</pluginManagement>

<plugins>
<!-- Format the source code -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<formats>
<format>
<includes>
<include>**/*.md</include>
<!--<include>**/*.xml</include>-->
</includes>
<excludes>
<exclude>experiments/**</exclude>
<exclude>target/**</exclude>
</excludes>
<endWithNewline />
<trimTrailingWhitespace />
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<java>
<importOrder>
<!-- the empty string is for all imports not specified explicitly, '|' joins groups without blank line -->
<order>,javax|java</order>
</importOrder>
<removeUnusedImports />
<formatAnnotations />
<endWithNewline />
<trimTrailingWhitespace />
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public static void main(String[] args) {

commandLineParser.parse(args, true);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.protocolfuzzing.blefuzzer;

import com.github.protocolfuzzing.blefuzzer.symbols.InputBLE;
import com.github.protocolfuzzing.blefuzzer.symbols.OutputBLE;
import com.github.protocolfuzzing.blefuzzer.symbols.OutputBuilderBLE;
import com.github.protocolfuzzing.blefuzzer.symbols.OutputCheckerBLE;
import com.github.protocolfuzzing.blefuzzer.symbols.OutputBLE;
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.mapper.Mapper;
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.mapper.abstractsymbols.OutputBuilder;
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.mapper.abstractsymbols.OutputChecker;
Expand Down Expand Up @@ -32,5 +32,5 @@ public OutputBuilder<OutputBLE> getOutputBuilder() {
public OutputChecker<OutputBLE> getOutputChecker() {
return outputChecker;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ public TestRunner build(TestRunnerEnabler testRunnerEnabler) {
public TimingProbe build(TimingProbeEnabler timingProbeEnabler) {
return new TimingProbeStandard<InputBLE, OutputBLE, Object, ExecutionContextBLE>(timingProbeEnabler, alphabetBuilder, sulBuilder, sulWrapper).initialize();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.github.protocolfuzzing.blefuzzer;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.github.protocolfuzzing.blefuzzer.symbols.InputBLE;
import com.github.protocolfuzzing.blefuzzer.symbols.OutputBLE;
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.core.AbstractSul;
Expand All @@ -11,8 +8,9 @@
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.core.sulwrappers.DynamicPortProvider;
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.mapper.Mapper;
import com.github.protocolfuzzing.protocolstatefuzzer.utils.CleanupTasks;

import jep.SharedInterpreter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class SulBLE implements AbstractSul<InputBLE, OutputBLE, ExecutionContextBLE> {
private static final Logger LOGGER = LogManager.getLogger();
Expand All @@ -32,7 +30,7 @@ public SulBLE(SulConfig sulConfig, CleanupTasks cleanupTasks) {
if(config.getMapper() != null) {
mapper += "_" + config.getMapper();
}

// Set up the python interpreter for our mapper
interp = new SharedInterpreter();
interp.exec("import sys; sys.path.insert(0, 'py')");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.github.protocolfuzzing.blefuzzer;

import java.io.PrintWriter;

import com.beust.jcommander.Parameter;
import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.core.config.SulServerConfig;

import java.io.PrintWriter;

public class SulServerConfigBLE implements SulServerConfig {

@Parameter(names = "-adapter", required = true,
description = "The serial port of the test adapter")
protected String serialPort = null;
Expand All @@ -31,7 +31,7 @@ public String getMapper() {
public String getTargetMacAddr() {
return targetMacAddr;
}


@Override
public String getHost() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public static class InputPojoXmlBLE {
@XmlAttribute(name = "name", required = true)
private String name;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public void postReceiveUpdate(OutputBLE output, OutputChecker<OutputBLE> outputC
public Object generateProtocolMessage(ExecutionContextBLE context) {
throw new UnsupportedOperationException("Unimplemented method 'generateProtocolMessage'");
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.protocolfuzzing.blefuzzer.symbols;

import java.util.Collections;

import com.github.protocolfuzzing.protocolstatefuzzer.components.sul.mapper.abstractsymbols.AbstractOutput;

import java.util.Collections;

public class OutputBLE extends AbstractOutput<OutputBLE, Object> {
public OutputBLE(String name) {
super(name);
Expand Down
Loading