diff --git a/CHANGELOG.md b/CHANGELOG.md index bfcfbabc9..119ae0b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## Key [1.16.1] + +08 Nov, 2021 + +### Changes +Handle the case where the signed key list has a null signature. +Modifies: +- `SignedKeyListEntity` (embedded in `PublicAddressEntity` and `AddressEntity`) +- `PublicSignedKeyList` +- `SignedKeyListResponse` + ## Test Android Instrumented [1.15.3] 05 Nov, 2021 diff --git a/key/build.gradle.kts b/key/build.gradle.kts index e05812523..2d9790023 100644 --- a/key/build.gradle.kts +++ b/key/build.gradle.kts @@ -23,7 +23,7 @@ plugins { kotlin("android") } -libVersion = Version(1, 16, 0) +libVersion = Version(1, 16, 1) android() diff --git a/key/data/src/main/kotlin/me/proton/core/key/data/api/response/SignedKeyListResponse.kt b/key/data/src/main/kotlin/me/proton/core/key/data/api/response/SignedKeyListResponse.kt index a015896eb..885a26bf9 100644 --- a/key/data/src/main/kotlin/me/proton/core/key/data/api/response/SignedKeyListResponse.kt +++ b/key/data/src/main/kotlin/me/proton/core/key/data/api/response/SignedKeyListResponse.kt @@ -24,7 +24,7 @@ import kotlinx.serialization.Serializable @Serializable data class SignedKeyListResponse( @SerialName("Data") - val data: String, + val data: String?, @SerialName("Signature") - val signature: String + val signature: String? ) diff --git a/key/data/src/main/kotlin/me/proton/core/key/data/entity/SignedKeyListEntity.kt b/key/data/src/main/kotlin/me/proton/core/key/data/entity/SignedKeyListEntity.kt index 49ea6a64e..e81c09ffd 100644 --- a/key/data/src/main/kotlin/me/proton/core/key/data/entity/SignedKeyListEntity.kt +++ b/key/data/src/main/kotlin/me/proton/core/key/data/entity/SignedKeyListEntity.kt @@ -22,6 +22,6 @@ import androidx.room.Entity @Entity data class SignedKeyListEntity( - val data: String, - val signature: String + val data: String?, + val signature: String? ) diff --git a/key/data/src/main/kotlin/me/proton/core/key/data/repository/PrivateKeyRepositoryImpl.kt b/key/data/src/main/kotlin/me/proton/core/key/data/repository/PrivateKeyRepositoryImpl.kt index 66db4561b..fdaf6b429 100644 --- a/key/data/src/main/kotlin/me/proton/core/key/data/repository/PrivateKeyRepositoryImpl.kt +++ b/key/data/src/main/kotlin/me/proton/core/key/data/repository/PrivateKeyRepositoryImpl.kt @@ -40,7 +40,7 @@ class PrivateKeyRepositoryImpl( ) : PrivateKeyRepository { private fun PrivateAddressKey.creationRequest(): CreateAddressKeyRequest { - val signedKeyList = checkNotNull(signedKeyList) { "Signed key list for key creation is null"} + val signedKeyList = checkNotNull(signedKeyList) { "Signed key list for key creation is null" } return CreateAddressKeyRequest( addressId = addressId, privateKey = privateKey.key, @@ -48,8 +48,8 @@ class PrivateKeyRepositoryImpl( token = token, signature = signature, signedKeyList = SignedKeyListRequest( - signedKeyList.data, - signedKeyList.signature + checkNotNull(signedKeyList.data) { "Signed key list's data of new key can't be null" }, + checkNotNull(signedKeyList.signature) { "Signed key list's signature of new key can't be null" }, ) ) } diff --git a/key/domain/src/main/kotlin/me/proton/core/key/domain/entity/key/PublicSignedKeyList.kt b/key/domain/src/main/kotlin/me/proton/core/key/domain/entity/key/PublicSignedKeyList.kt index 8d1336659..fafdddd01 100644 --- a/key/domain/src/main/kotlin/me/proton/core/key/domain/entity/key/PublicSignedKeyList.kt +++ b/key/domain/src/main/kotlin/me/proton/core/key/domain/entity/key/PublicSignedKeyList.kt @@ -21,6 +21,6 @@ package me.proton.core.key.domain.entity.key import me.proton.core.crypto.common.pgp.Signature data class PublicSignedKeyList( - val data: String, - val signature: Signature + val data: String?, + val signature: Signature? )