commit | d4780cd8b5fffdab1cc8ef7a4f9050dc37755847 | [log] [tgz] |
---|---|---|
author | David Symonds <dsymonds@golang.org> | Mon Nov 09 11:52:04 2015 +1100 |
committer | David Symonds <dsymonds@golang.org> | Mon Nov 09 05:46:33 2015 +0000 |
tree | aae7eaa3edfd293d4aa9d8015c00935cc5749918 | |
parent | e347d2238c75fcce9f32e1dff7708f86e4fe2228 [diff] |
jws: fix base64Decode for strings of length 1 (mod 4). Change-Id: I5369e4d5454de2cf041363af1328f69d526b17d4 Reviewed-on: https://go-review.googlesource.com/16750 Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/jws/jws.go b/jws/jws.go index e300001..8ca5978 100644 --- a/jws/jws.go +++ b/jws/jws.go
@@ -161,6 +161,8 @@ func base64Decode(s string) ([]byte, error) { // add back missing padding switch len(s) % 4 { + case 1: + s += "===" case 2: s += "==" case 3: