diff options
Diffstat (limited to 'vendor/golang.org/x/text/secure')
-rw-r--r-- | vendor/golang.org/x/text/secure/precis/profile_test.go | 7 | ||||
-rw-r--r-- | vendor/golang.org/x/text/secure/precis/profiles.go | 17 |
2 files changed, 20 insertions, 4 deletions
diff --git a/vendor/golang.org/x/text/secure/precis/profile_test.go b/vendor/golang.org/x/text/secure/precis/profile_test.go index 253b2a08a..916fc8b6d 100644 --- a/vendor/golang.org/x/text/secure/precis/profile_test.go +++ b/vendor/golang.org/x/text/secure/precis/profile_test.go @@ -100,6 +100,13 @@ var compareTestCases = []struct { {"Å", "å", true}, {"ff", "ff", true}, // because of NFKC {"ß", "sS", false}, + + // After applying the Nickname profile, \u00a8 becomes \u0020\u0308, + // however because the nickname profile is not idempotent, applying it again + // to \u0020\u0308 results in \u0308. This behavior is "correct", even if it + // is unexpected. + {"\u00a8", "\u0020\u0308", false}, + {"\u0020\u0308", "\u0308", true}, }}, } diff --git a/vendor/golang.org/x/text/secure/precis/profiles.go b/vendor/golang.org/x/text/secure/precis/profiles.go index 8b46d504c..86010025c 100644 --- a/vendor/golang.org/x/text/secure/precis/profiles.go +++ b/vendor/golang.org/x/text/secure/precis/profiles.go @@ -13,10 +13,19 @@ import ( ) var ( - Nickname *Profile = nickname // Implements the Nickname profile specified in RFC 7700. - UsernameCaseMapped *Profile = usernameCaseMap // Implements the UsernameCaseMapped profile specified in RFC 7613. - UsernameCasePreserved *Profile = usernameNoCaseMap // Implements the UsernameCasePreserved profile specified in RFC 7613. - OpaqueString *Profile = opaquestring // Implements the OpaqueString profile defined in RFC 7613 for passwords and other secure labels. + // Implements the Nickname profile specified in RFC 7700. + // The nickname profile is not idempotent and may need to be applied multiple + // times before being used for comparisons. + Nickname *Profile = nickname + + // Implements the UsernameCaseMapped profile specified in RFC 7613. + UsernameCaseMapped *Profile = usernameCaseMap + + // Implements the UsernameCasePreserved profile specified in RFC 7613. + UsernameCasePreserved *Profile = usernameNoCaseMap + + // Implements the OpaqueString profile defined in RFC 7613 for passwords and other secure labels. + OpaqueString *Profile = opaquestring ) var ( |