From 01c18dbcab455f90ced6a3e35a6c9e645b1c5e2a Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 21 Sep 2016 21:43:56 +0200 Subject: 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 --- internal/nametransform/names.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal') 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 -- cgit v1.2.3