|
15 | 15 | import ch.cyberduck.core.ssl.DisabledX509TrustManager; |
16 | 16 |
|
17 | 17 | import org.cryptomator.cryptolib.api.UVFMasterkey; |
| 18 | +import org.junit.jupiter.api.Disabled; |
18 | 19 | import org.junit.jupiter.api.Test; |
19 | 20 |
|
20 | 21 | import java.nio.charset.StandardCharsets; |
|
30 | 31 | import cloud.katta.crypto.exceptions.NotECKeyException; |
31 | 32 | import cloud.katta.protocols.hub.HubProtocol; |
32 | 33 | import cloud.katta.protocols.hub.HubSession; |
| 34 | +import cloud.katta.workflows.exceptions.SecurityFailure; |
33 | 35 | import com.fasterxml.jackson.core.JsonProcessingException; |
34 | 36 | import com.nimbusds.jose.JOSEException; |
35 | 37 | import com.nimbusds.jose.JWEObjectJSON; |
@@ -76,7 +78,7 @@ void recoveryKeyToOwnerAccessTokenAndBack() throws JOSEException, ParseException |
76 | 78 | } |
77 | 79 |
|
78 | 80 | @Test |
79 | | - void encryptDecrypt() throws JOSEException, JsonProcessingException, ParseException { |
| 81 | + void encryptDecrypt() throws JOSEException, JsonProcessingException, ParseException, SecurityFailure { |
80 | 82 | final byte[] rawMasterKey = new byte[32]; |
81 | 83 | FastSecureRandomProvider.get().provide().nextBytes(rawMasterKey); |
82 | 84 | final HashMap<String, String> keys = new HashMap<String, String>() {{ |
@@ -130,7 +132,8 @@ void encryptDecrypt() throws JOSEException, JsonProcessingException, ParseExcept |
130 | 132 | } |
131 | 133 |
|
132 | 134 | @Test |
133 | | - void decryptWithRecoveryKey() throws ParseException, JOSEException, NoSuchAlgorithmException, InvalidKeySpecException, NotECKeyException, JsonProcessingException { |
| 135 | + @Disabled("TODO uvf.spec.version missing in protected.") |
| 136 | + void decryptWithRecoveryKey() throws ParseException, JOSEException, NoSuchAlgorithmException, InvalidKeySpecException, NotECKeyException, JsonProcessingException, SecurityFailure { |
134 | 137 | // https://datatracker.ietf.org/doc/html/rfc7516#section-7.2.1 |
135 | 138 | final String jwe = "{\"protected\":\"eyJvcmlnaW4iOiJodHRwczovL2V4YW1wbGUuY29tL2FwaS92YXVsdHMvVE9ETy91dmYvdmF1bHQudXZmIiwiamt1Ijoiandrcy5qc29uIiwiZW5jIjoiQTI1NkdDTSJ9\",\"recipients\":[{\"header\":{\"kid\":\"org.cryptomator.hub.memberkey\",\"alg\":\"A256KW\"},\"encrypted_key\":\"XLoNIWvDKQqaDurrGt7VK9s2aggSMir7fS4ZdBUxdTxceCOHndo4kA\"},{\"header\":{\"kid\":\"org.cryptomator.hub.recoverykey.v2nb-mGX4POKMWCQKOogMWTlAn7DDqEOjjEGCsPEeco\",\"alg\":\"ECDH-ES+A256KW\",\"epk\":{\"key_ops\":[],\"ext\":true,\"kty\":\"EC\",\"x\":\"j6Retxx-L-rURQ4WNc8LvoqjbdPtGS6n9pCJgcm1U-NAWuWEvwJ_qi2tlrv_4w4p\",\"y\":\"wS-Emo-Q9qdtkHMJiDfVDAaxhF2-nSkDRn2Eg9CbG0pVwGEpaDybx_YYJwIaYooO\",\"crv\":\"P-384\"},\"apu\":\"\",\"apv\":\"\"},\"encrypted_key\":\"iNGgybMqmiXn_lbKLMMTpg38i1f00O6Zj65d5nzsLw3hyzuylGWpvA\"}],\"iv\":\"Pfy90C9SSq2gJr6B\",\"ciphertext\":\"ogYR1pZN9k97zEgO9Fj3ePQramtaUdHWq95geXD7FH1oB6T7fEOvdU2AEGWOcbIbQihn-eOqG2_5oTol16O_nQ4HcDOJ9w4R9EdpByuWG-kVNh_fpWeQjIuH4kO-Rtbf05JRVG2jexWopbIA8uHuoiOXSNpSYPTzTKirp2hU7w3sE01zycsu06HiasUX-tKZH_hbyiUEdTlFFLcvKpRwnYOQf6QMw0uY1IbUTX1cJY9LO5SpD8bZFZOd6hg_Qnsdcq52I8KkZyxocgqdW7P5OSUrv5z8DCLMPdByEpaz9cCOzQQvtZwHxJy82O4vDAh89QA_AzfK8J7TI5zJRlTGQgrNhiaVBC85fN3tMSv8sLfJs7rC_5LiVW5ZeqbQ52sAZQw0lfwgGpMmxsdMzPoVOLD8OxvX\",\"tag\":\"3Jiv6kI4Qoso60T0dRv9vIlca-P4UFyHqh-TEZvargM\"}"; |
136 | 139 | final ECKey key = new ECKey.Builder( |
|
0 commit comments