From 42839924e7502b5c8dd1eb67c26241abad51a470 Mon Sep 17 00:00:00 2001 From: idk Date: Fri, 5 Apr 2019 21:09:48 -0400 Subject: [PATCH] Improve the validator --- transcoders.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transcoders.go b/transcoders.go index b9347c2..448d643 100644 --- a/transcoders.go +++ b/transcoders.go @@ -283,9 +283,9 @@ func garlic32BtS(b []byte) (string, error) { func garlic32Validate(b []byte) error { // an i2p base64 for an Encrypted Leaseset v2 will be at least 35 bytes // long - if len(b) > 35 { - // other than that, they will be at least 32 bytes - if len(b) < 32 { + if len(b) < 35 { + // other than that, they will be exactly 32 bytes + if len(b) != 32 { return fmt.Errorf("failed to validate garlic addr: %s not an i2p base32 address. len: %d\n", b, len(b)) } }