From f832710420bd5a3042675b77a9f8d17a02cb5499 Mon Sep 17 00:00:00 2001
From: librelois <c@elo.tf>
Date: Sat, 10 Oct 2020 14:37:57 +0200
Subject: [PATCH] [fix] accept short base58 public keys

---
 app/lib/common-libs/constants.ts | 2 +-
 app/modules/bma/lib/constants.ts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/lib/common-libs/constants.ts b/app/lib/common-libs/constants.ts
index 3c501ab4c..081b25041 100755
--- a/app/lib/common-libs/constants.ts
+++ b/app/lib/common-libs/constants.ts
@@ -18,7 +18,7 @@ const GT = "g1-test";
 const CURRENCY = "[a-zA-Z0-9-_ ]{2,50}";
 const BASE58 = "[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+";
 const PUBKEY =
-  "[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}";
+  "[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{40,44}";
 const SIGNATURE = "[A-Za-z0-9+\\/=]{87,88}";
 const USER_ID = "[A-Za-z0-9_-]{2,100}";
 const INTEGER = "(0|[1-9]\\d{0,18})";
diff --git a/app/modules/bma/lib/constants.ts b/app/modules/bma/lib/constants.ts
index adb86d061..6e47402a8 100644
--- a/app/modules/bma/lib/constants.ts
+++ b/app/modules/bma/lib/constants.ts
@@ -23,7 +23,7 @@ export const BMAConstants = {
   PORT_START: 15000,
   UPNP_INTERVAL: 300,
   UPNP_TTL: 600,
-  PUBLIC_KEY: /^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$/,
+  PUBLIC_KEY: /^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{40,44}$/,
   SHA256_HASH: /^[A-F0-9]{64}$/,
 
   ERRORS: {
-- 
GitLab