Skip to content

Commit

Permalink
rely on default jackson mapper settings
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Sep 14, 2023
1 parent ffa6858 commit b4827ff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 50 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@


import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

record KeychainEntry(@JsonProperty("ciphertext") //
@JsonSerialize(using = ByteArrayJsonAdapter.Serializer.class) //
@JsonDeserialize(using = ByteArrayJsonAdapter.Deserializer.class) //
byte[] ciphertext,
@JsonProperty("salt") //
@JsonSerialize(using = ByteArrayJsonAdapter.Serializer.class) //
@JsonDeserialize(using = ByteArrayJsonAdapter.Deserializer.class) //
byte[] salt) {
record KeychainEntry(@JsonProperty("ciphertext") byte[] ciphertext, @JsonProperty("salt") byte[] salt) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.junit.jupiter.api.io.TempDir;

import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;

Expand Down Expand Up @@ -58,6 +59,15 @@ public void testEmptyFileReturnsEmpty() throws KeychainAccessException, IOExcept

Assertions.assertTrue(result.isEmpty());
}

@Test
public void testLegacyKeychainFiles() throws URISyntaxException, KeychainAccessException {
var keychainPath = Path.of(this.getClass().getResource("keychain.v1.2.2.json").toURI());
var result = keychainAccess.loadKeychainEntries(keychainPath);

Assertions.assertTrue(result.isPresent());
Assertions.assertEquals(3, result.get().size());
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"cryptomator-device-p12": {
"ciphertext": "AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAMKzd7acJg0ScvBUOCjUb3wAAAAACAAAAAAAQZgAAAAEAACAAAABS6cSKuWqEOp+1HHcsSF0bSzQRRbotDIZPQIuMvbSdowAAAAAOgAAAAAIAACAAAABatZ2hp39vFTysmXRSO1rkk9vLx2S6rnRq6RIGkXlCnzAAAAAgTeOMtOKhnMzIjSwJEFE22UaB3sPGH6UxQ+EWMuZ9WPGHmOp8/WzTzFLCwbiIh9ZAAAAAf7DQSu40eCLUDKQzwFNJrBJsEWX2pK2GS2wOYFTlcMhSij7WkSHh9nAeZtRf14PyBpuLxCiBIayLJMpeK4HIXg==",
"salt": "Rwzfb0IHSqOXJw5MGRmCTw=="
},
"-JgknuFBfItX": {
"ciphertext": "AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAMKzd7acJg0ScvBUOCjUb3wAAAAACAAAAAAAQZgAAAAEAACAAAABnYHm42qCU6kq50NV16IqJbrwrRwagpiYgopjK8xpyVAAAAAAOgAAAAAIAACAAAAC6XB/vmPRR7tK5sTOyY6DFgTXv4/ptTzGsKwJEsn1I8xAAAADUlPA6Qet/WSCbdK4WShMsQAAAAOVsW/9E/YNwHLl/qyzffkp2YR7UKeTcM3EkLoyI9Q2RJjmdidJc4wAet9zlp4qUPST+ukTxXAvMW/+RNxEAeZM=",
"salt": "CqEUWMVSQtqsDNhKeNCZHg=="
},
"vkEAWUv_NmbN": {
"ciphertext": "AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAcLFOdGbRSEiT1nQ2ILvP/gAAAAACAAAAAAAQZgAAAAEAACAAAABYjK3wVUE/is3SHpdzLRaijVbLw6UYMSBizyiDDWNrqAAAAAAOgAAAAAIAACAAAAALkAoBV3/RwpSXwkTyDgOKiR7+wMnXq099WW4tt873NRAAAACH2Ki+R4fSi+569Y0RpoS0QAAAAEXbbfM0mUuIgajCfO7yfH1ysWdRUWfZYnfqDjeR5Up/FKqLbPkgZr+0fgb/sZEw+HyQ781A7+fXHFqB3hQoDV0=",
"salt": "evllr3H5SHyJN/1SciqlVQ=="
}
}

0 comments on commit b4827ff

Please sign in to comment.