internal/format: switch to 64 columns of standard Base64

Now that we don't use Base64 in keys, let's just go back to the standard
alphabet. Still in the spirit of reducing weirdness, use the PEM column
count, so we can also reuse the lineWriter for the PEM armor.

See https://groups.google.com/d/msg/age-dev/UAjkvLoCr9I/l4Q1h3OPAgAJ.
This commit is contained in:
Filippo Valsorda
2019-12-26 15:37:35 +01:00
committed by Filippo Valsorda
parent 9a84e437b1
commit b142e0fd01

View File

@@ -29,7 +29,7 @@ type Recipient struct {
Body []byte
}
var b64 = base64.RawURLEncoding.Strict()
var b64 = base64.RawStdEncoding.Strict()
func DecodeString(s string) ([]byte, error) {
// CR and LF are ignored by DecodeString, but we don't want any malleability.
@@ -41,7 +41,7 @@ func DecodeString(s string) ([]byte, error) {
var EncodeToString = b64.EncodeToString
const columnsPerLine = 56
const columnsPerLine = 64
const bytesPerLine = columnsPerLine / 4 * 3
const intro = "This is a file encrypted with age-tool.com, version 1\n"