libeufin

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

commit 8c6e95ee3f5f3c8495ef8c932cd95a99b293c6d7
parent 4d78359cb8147722fbb33a2c1082ba6bb906715e
Author: Antoine A <>
Date:   Tue, 12 Nov 2024 17:28:32 +0100

bank: fix random bcrypt failure

Diffstat:
Mbank/src/main/kotlin/tech/libeufin/bank/helpers.kt | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/bank/src/main/kotlin/tech/libeufin/bank/helpers.kt b/bank/src/main/kotlin/tech/libeufin/bank/helpers.kt @@ -84,11 +84,7 @@ fun ApplicationRequest.withdrawConfirmUrl(id: UUID) = url { * It returns false in case of problems, true otherwise. */ suspend fun createAdminAccount(db: Database, cfg: BankConfig, pw: String? = null): AccountCreationResult { - var pwStr = pw - if (pwStr == null) { - val pwBuf = ByteArray(32).secureRand() - pwStr = String(pwBuf, Charsets.UTF_8) - } + var pwStr = pw ?: Base32Crockford32B.secureRand().toString() val payto = when (cfg.wireMethod) { WireMethod.IBAN -> IbanPayto.rand()