gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: testing invalid Crockford32 input


From: gnunet
Subject: [libeufin] branch master updated: testing invalid Crockford32 input
Date: Mon, 02 Oct 2023 12:53:49 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 7b48ae40 testing invalid Crockford32 input
7b48ae40 is described below

commit 7b48ae407e842a0836ee3990bbfab65b8e1d089e
Author: MS <ms@taler.net>
AuthorDate: Mon Oct 2 12:53:44 2023 +0200

    testing invalid Crockford32 input
---
 util/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
index 0bbabc9f..d469a9a4 100644
--- 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

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]