From 33e1989af2f01c3c1871e4f56b4d0da21fc39528 Mon Sep 17 00:00:00 2001 From: cach30verfl0w Date: Fri, 14 Jun 2024 20:03:03 +0200 Subject: [PATCH] Add message to InsecureCryptoApi annotation --- .../kotlin/io/karma/advcrypto/annotations/InsecureCryptoApi.kt | 2 +- .../io/karma/advcrypto/linux/tests/KeyReaderHelperTests.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/annotations/InsecureCryptoApi.kt b/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/annotations/InsecureCryptoApi.kt index 0f06029..450a857 100644 --- a/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/annotations/InsecureCryptoApi.kt +++ b/kmp-advcrypto/src/commonMain/kotlin/io/karma/advcrypto/annotations/InsecureCryptoApi.kt @@ -24,7 +24,7 @@ package io.karma.advcrypto.annotations * @author Cedric Hammes * @since 11/06/2024 */ -@RequiresOptIn(level = RequiresOptIn.Level.ERROR) +@RequiresOptIn("By using this function of the API, the confidentiality of sensitive data is in risk", RequiresOptIn.Level.ERROR) @MustBeDocumented @Retention(AnnotationRetention.BINARY) @Target(AnnotationTarget.CLASS, AnnotationTarget.FIELD, AnnotationTarget.PROPERTY) diff --git a/kmp-advcrypto/src/linuxX64Test/kotlin/io/karma/advcrypto/linux/tests/KeyReaderHelperTests.kt b/kmp-advcrypto/src/linuxX64Test/kotlin/io/karma/advcrypto/linux/tests/KeyReaderHelperTests.kt index c51c457..cdb8b15 100644 --- a/kmp-advcrypto/src/linuxX64Test/kotlin/io/karma/advcrypto/linux/tests/KeyReaderHelperTests.kt +++ b/kmp-advcrypto/src/linuxX64Test/kotlin/io/karma/advcrypto/linux/tests/KeyReaderHelperTests.kt @@ -10,10 +10,11 @@ import okio.Path.Companion.toPath import kotlin.experimental.ExperimentalNativeApi import kotlin.test.Test -@OptIn(ExperimentalNativeApi::class, InsecureCryptoApi::class) +@OptIn(ExperimentalNativeApi::class) class KeyReaderHelperTests { private val fileSystem = FileSystem.SYSTEM + @OptIn(InsecureCryptoApi::class) @Test fun testPEM() { fileSystem.read("./testkeys/rsa-private-key.pem".toPath()) {