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
This commit is contained in:
parent
d76e7aadb4
commit
01c18dbcab
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user