commit 15a26b4d9ef9a3ecf24d276b85f3f20197d142a9
parent 0c4ea7b8afc1e3ff4d2f2e3348049a98b80f71cc
Author: MS <ms@taler.net>
Date: Wed, 15 Nov 2023 13:49:46 +0100
nexus fetch: workaround #7980
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsFetch.kt
@@ -296,6 +296,10 @@ fun findIncomingTxInNotification(
* @return [ByteArray] or null if not valid.
*/
fun isReservePub(maybeReservePub: String): ByteArray? {
+ if (maybeReservePub.length != 52) {
+ logger.error("Not a reserve pub, length (${maybeReservePub.length}) is not 52")
+ return null
+ }
val dec = try {
Base32Crockford.decode(maybeReservePub)
} catch (e: EncodingException) {
@@ -303,6 +307,7 @@ fun isReservePub(maybeReservePub: String): ByteArray? {
return null
}
logger.debug("Reserve how many bytes: ${dec.size}")
+ // this check would only be effective after #7980
if (dec.size != 32) {
logger.error("Not a reserve pub, wrong length: ${dec.size}")
return null