From 3026b80ec5c9809d99cfa923895dbf4812076af3 Mon Sep 17 00:00:00 2001 From: Ugljesa Jovanovic Date: Fri, 9 Oct 2020 17:21:45 +0200 Subject: [PATCH] Make signature test tampered message, more tampered --- .../com/ionspin/kotlin/crypto/signature/SignatureTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multiplatform-crypto-libsodium-bindings/src/commonTest/kotlin/com/ionspin/kotlin/crypto/signature/SignatureTest.kt b/multiplatform-crypto-libsodium-bindings/src/commonTest/kotlin/com/ionspin/kotlin/crypto/signature/SignatureTest.kt index 17f22e6..dca334d 100644 --- a/multiplatform-crypto-libsodium-bindings/src/commonTest/kotlin/com/ionspin/kotlin/crypto/signature/SignatureTest.kt +++ b/multiplatform-crypto-libsodium-bindings/src/commonTest/kotlin/com/ionspin/kotlin/crypto/signature/SignatureTest.kt @@ -40,6 +40,9 @@ class SignatureTest { assertFailsWith(InvalidSignatureException::class) { val tamperedSignature = signature.copyOf() tamperedSignature[crypto_sign_BYTES - 1] = 0U + tamperedSignature[1] = 0U + tamperedSignature[15] = 0U + tamperedSignature[33] = 0U Signature.verifyDetached(tamperedSignature, message, keys.publicKey) } } @@ -66,4 +69,4 @@ class SignatureTest { } } } -} \ No newline at end of file +}