Commit 42839924 authored by idk's avatar idk

Improve the validator

parent ae5c4f83
......@@ -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))
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment