libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 7b48ae407e842a0836ee3990bbfab65b8e1d089e
parent 3bfd71615f61f17708ab97757c8fde428519eeb6
Author: MS <ms@taler.net>
Date:   Mon,  2 Oct 2023 12:53:44 +0200

testing invalid Crockford32 input

Diffstat:
Mutil/src/test/kotlin/CryptoUtilTest.kt | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/util/src/test/kotlin/CryptoUtilTest.kt b/util/src/test/kotlin/CryptoUtilTest.kt @@ -18,6 +18,7 @@ */ import net.taler.wallet.crypto.Base32Crockford +import net.taler.wallet.crypto.EncodingException import org.bouncycastle.asn1.edec.EdECObjectIdentifiers import org.bouncycastle.asn1.x509.AlgorithmIdentifier import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo @@ -154,11 +155,12 @@ class CryptoUtilTest { assertFalse(CryptoUtil.checkValidEddsaPublicKey(non32bytes)) } - @Test + @Test(expected = EncodingException::class) // from Crockford32 encoding to binary. fun base32ToBytesTest() { val expectedEncoding = "C9P6YRG" assert(Base32Crockford.decode(expectedEncoding).toString(Charsets.UTF_8) == "blob") + Base32Crockford.decode("-".repeat(52)) // fulfills the "expected = .." above. } @Test