diff options
author | Filippo Valsorda <filippo@golang.org> | 2019-08-03 18:38:32 -0400 |
---|---|---|
committer | Filippo Valsorda <filippo@golang.org> | 2019-11-20 19:43:21 +0000 |
commit | fbcfa6a532d4e7c555693b549a97adfa3d38aca4 (patch) | |
tree | 25e3ce1873abcd06e2f411a1efc572cd6be50739 /src/encoding | |
parent | b89b4623eb70cbdc6b0aea43a5a826b7a26f20a7 (diff) | |
download | go-fbcfa6a532d4e7c555693b549a97adfa3d38aca4.tar.gz go-fbcfa6a532d4e7c555693b549a97adfa3d38aca4.zip |
encoding/base64: document that Strict mode still ignores newlines
An application that wants to reject non-canonical encodings is likely to
care about other sources of malleability.
Change-Id: I1d3a5b281d2631ca78df3f89b957a02687a534d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/188858
Reviewed-by: Katie Hockman <katie@golang.org>
Diffstat (limited to 'src/encoding')
-rw-r--r-- | src/encoding/base64/base64.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/encoding/base64/base64.go b/src/encoding/base64/base64.go index 082210198f..690d3ce042 100644 --- a/src/encoding/base64/base64.go +++ b/src/encoding/base64/base64.go @@ -86,6 +86,9 @@ func (enc Encoding) WithPadding(padding rune) *Encoding { // Strict creates a new encoding identical to enc except with // strict decoding enabled. In this mode, the decoder requires that // trailing padding bits are zero, as described in RFC 4648 section 3.5. +// +// Note that the input is still malleable, as new line characters +// (CR and LF) are still ignored. func (enc Encoding) Strict() *Encoding { enc.strict = true return &enc |