From a1efa1a1caf81e78cda51b2a85ab377dcd5a812f Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 8 Nov 2024 22:44:10 +0100 Subject: [PATCH] Remove redundant empty string check in SCRAM normalization The existing check for an empty normalized string is unnecessary because the OpaqueString profile in precis already throws an error if an empty string is returned: https://cs.opensource.google/go/x/text/+/master:secure/precis/profiles.go;l=66 --- smtp/auth_scram.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/smtp/auth_scram.go b/smtp/auth_scram.go index e27831b..23915ae 100644 --- a/smtp/auth_scram.go +++ b/smtp/auth_scram.go @@ -310,8 +310,5 @@ func (a *scramAuth) normalizeString(s string) (string, error) { if err != nil { return "", fmt.Errorf("failed to normalize string: %w", err) } - if s == "" { - return "", errors.New("normalized string is empty") - } return s, nil }