Skip to content

Commit

Permalink
fix JCA provider setup for device tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Jan 28, 2025
1 parent 07cc00d commit 0f0af07
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions testing/src/main/java/com/yubico/yubikit/testing/TestState.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,15 @@ protected TestState(Builder<?> builder) {
this.currentDevice = builder.device;
this.usbPid = builder.usbPid;
this.scpKid = builder.scpKid;

if (this.scpKid != null) {
Security.removeProvider("BC");
Security.insertProviderAt(new BouncyCastleProvider(), 1);
}

this.scpParameters = new ScpParameters(builder.device, this.scpKid);
this.reconnectDeviceCallback = builder.reconnectDeviceCallback;
this.isUsbTransport = builder.device.getTransport() == Transport.USB;

setupJca();
}

private void setupJca() {
Security.removeProvider("BC");
Security.insertProviderAt(new BouncyCastleProvider(), 1);
}

public boolean isUsbTransport() {
Expand Down

0 comments on commit 0f0af07

Please sign in to comment.