diff options
author | Jakob Unterwurzacher | 2016-09-21 21:43:56 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-09-25 16:43:17 +0200 |
commit | 01c18dbcab455f90ced6a3e35a6c9e645b1c5e2a (patch) | |
tree | b880bb2279e259ee684a5e7ec92d7862cf6d65b4 /internal/nametransform/names.go | |
parent | d76e7aadb48e5efd6af6ad42e9146f65f8e89fb8 (diff) |
nametransform: return EINVAL on invalid padding
With the generic fmt.Errorf we trigger a warning from go-fuse:
2016/09/21 21:42:31 can't convert error type: Invalid padding
Diffstat (limited to 'internal/nametransform/names.go')
-rw-r--r-- | internal/nametransform/names.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/nametransform/names.go b/internal/nametransform/names.go index 8bebc25..e9fe87d 100644 --- a/internal/nametransform/names.go +++ b/internal/nametransform/names.go @@ -5,6 +5,7 @@ import ( "crypto/aes" "encoding/base64" "fmt" + "syscall" "github.com/rfjakob/eme" @@ -46,7 +47,7 @@ func (n *NameTransform) DecryptName(cipherName string, iv []byte) (string, error // unPad16 returns detailed errors including the position of the // incorrect bytes. Kill the padding oracle by lumping everything into // a generic error. - return "", fmt.Errorf("Invalid padding") + return "", syscall.EINVAL } plain := string(bin) return plain, err |