diff options
author | Jakob Unterwurzacher | 2017-03-05 22:25:41 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-03-05 22:25:41 +0100 |
commit | 5b54577d2ec553055c06e05841f626c10368c6b6 (patch) | |
tree | 9b1739d5b9ccc597186662f4b235c7c71af6c0a9 /internal/nametransform/longnames.go | |
parent | d0bc7970f721cee607d993406d97d32e2c660abe (diff) |
nametransform: fix Raw64 not affecting longnames
HashLongName() incorrectly hardcoded the call to base64.URLEncoding.
Diffstat (limited to 'internal/nametransform/longnames.go')
-rw-r--r-- | internal/nametransform/longnames.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/nametransform/longnames.go b/internal/nametransform/longnames.go index 71a4c16..f9ba848 100644 --- a/internal/nametransform/longnames.go +++ b/internal/nametransform/longnames.go @@ -2,7 +2,6 @@ package nametransform import ( "crypto/sha256" - "encoding/base64" "io/ioutil" "os" "path/filepath" @@ -24,9 +23,9 @@ const ( // HashLongName - take the hash of a long string "name" and return // "gocryptfs.longname.[sha256]" -func HashLongName(name string) string { +func (n *NameTransform) HashLongName(name string) string { hashBin := sha256.Sum256([]byte(name)) - hashBase64 := base64.URLEncoding.EncodeToString(hashBin[:]) + hashBase64 := n.b64.EncodeToString(hashBin[:]) return longNamePrefix + hashBase64 } |