Skip to content

Commit

Permalink
Remove known deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Nov 17, 2024
1 parent e64fbae commit fb41908
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ public class COSEPublicKey {
factory.setCodec(CTAP2ProtocolHelpers.cborMapper);
}

@SuppressWarnings("deprecation")
static COSEPublicKey fromBytes(byte[] cbor) throws IOException {
CBORParser parser = factory.createParser(cbor);
ObjectNode parsed = parser.readValueAsTree();
// FIXME: getCurrentLocation() is deprecated
byte[] encoded = Arrays.copyOf(cbor, (int) parser.getCurrentLocation().getByteOffset() - 1);
byte[] encoded = Arrays.copyOf(cbor, (int) parser.currentLocation().getByteOffset() - 1);

final PublicKey pubkey;
switch (parsed.get("3").asInt()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static void setProtocolDebug(OutputStream debug) {
}

static {
// FIXME: QUOTE_FIELD_NAMES in com.fasterxml.jackson.core.JsonGenerator.Feature has been deprecated
mapper.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, false); // We have numerics in visual
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public static byte[] toAuthenticateCommand(GetAssertionCommand command) throws I
return u2fcmd;
}

@SuppressWarnings("deprecation")
public static byte[] toCBOR(GetAssertionCommand command, byte[] response) throws IOException {

byte[] appId = PINProtocols.sha256(command.origin.getBytes(StandardCharsets.UTF_8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void verifyU2FRegistration(MakeCredentialCommand command) throws IllegalArgument
throw new IllegalArgumentException("U2F supports only P256");
}

@SuppressWarnings("deprecation")
public static byte[] toCBOR(MakeCredentialCommand command, byte[] response) throws IOException {

int offset = 0;
Expand Down Expand Up @@ -95,7 +94,7 @@ public static byte[] toCBOR(MakeCredentialCommand command, byte[] response) thro
generator.writeFieldName("sig");
generator.writeBinary(signature);
generator.writeFieldName("x5c");
generator.writeStartArray(1);
generator.writeStartArray(null, 1);
generator.writeBinary(cert);
generator.writeEndArray();
generator.writeEndObject(); // sig+x509 dict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ public static USBTransport getInstance(HidDevice dev, CallbackHandler cb) {
return new USBTransport(dev, cb);
}

@SuppressWarnings("deprecation")
private USBTransport(HidDevice dev, CallbackHandler cb) {
device = dev;
callbackHandler = cb;
if (!device.isOpen()) device.open(); //FIXME: isOpen is deprecated
if (device.isClosed()) {
device.open();
}
try {
channelID = openChannel(device);
} catch (IOException e) {
Expand Down

0 comments on commit fb41908

Please sign in to comment.