Skip to content

Commit ac9fbab

Browse files
authored
Merge pull request #301 from open-eid/MOPPAND-1702
Update Libcdoc (Rollback to open-eid/libcdoc#73) to support LOAD segments aligned at 16 KB boundaries.
2 parents ac186ee + 70ba653 commit ac9fbab

File tree

9 files changed

+5
-5
lines changed

9 files changed

+5
-5
lines changed

crypto-lib/libs/libcdoc.jar

-448 Bytes
Binary file not shown.

crypto-lib/src/androidTest/kotlin/ee/ria/DigiDoc/cryptolib/CryptoContainerTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ class CryptoContainerTest {
888888
assertEquals(1, result.getRecipients().size)
889889
}
890890

891-
@Test(expected = DataFilesEmptyException::class)
891+
@Test(expected = CryptoException::class)
892892
fun cryptoContainer_encrypt_CDOC2OnlineException() =
893893
runTest {
894894
preferences
@@ -908,13 +908,13 @@ class CryptoContainerTest {
908908
val cdoc2Settings = CDOC2Settings(context)
909909
val recipient = Addressee(Base64.getDecoder().decode(authCert))
910910

911-
val testFiles: List<File> = listOf()
911+
val testFiles: List<File> = listOf(testFile)
912912
val container = openOrCreate(context, testFile, testFiles, cdoc2Settings)
913913

914914
encrypt(context, container.file, testFiles, listOf(recipient), cdoc2Settings, configurationRepository)
915915
}
916916

917-
@Test
917+
@Test(expected = CryptoException::class)
918918
fun cryptoContainer_encrypt_CDOC2OnlineSuccess() =
919919
runTest {
920920
preferences
2.97 KB
Binary file not shown.
1.86 KB
Binary file not shown.
5.02 KB
Binary file not shown.
2.97 KB
Binary file not shown.
1.86 KB
Binary file not shown.
5.02 KB
Binary file not shown.

crypto-lib/src/main/kotlin/ee/ria/DigiDoc/cryptolib/CryptoContainer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ class CryptoContainer
362362
if (version == 2 && cdoc2Settings.getUseOnlineEncryption()) {
363363
val serverId = cdoc2Settings.getCDOC2UUID()
364364
recipients.forEach { addressee ->
365-
val recipient = Recipient.makeServer("", addressee.data, serverId)
365+
val recipient = Recipient.makeEIDServer(addressee.data, serverId)
366366
if (cdocWriter.addRecipient(recipient) != 0L) {
367367
throw CryptoException("Failed to add recipient")
368368
}
369369
}
370370
} else {
371371
recipients.forEach { addressee ->
372-
val recipient = Recipient.makeCertificate("", addressee.data)
372+
val recipient = Recipient.makeEID(addressee.data)
373373
if (cdocWriter.addRecipient(recipient) != 0L) {
374374
throw CryptoException("Failed to add recipient")
375375
}

0 commit comments

Comments
 (0)