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"
|
"crypto/aes"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/rfjakob/eme"
|
"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
|
// unPad16 returns detailed errors including the position of the
|
||||||
// incorrect bytes. Kill the padding oracle by lumping everything into
|
// incorrect bytes. Kill the padding oracle by lumping everything into
|
||||||
// a generic error.
|
// a generic error.
|
||||||
return "", fmt.Errorf("Invalid padding")
|
return "", syscall.EINVAL
|
||||||
}
|
}
|
||||||
plain := string(bin)
|
plain := string(bin)
|
||||||
return plain, err
|
return plain, err
|
||||||
|
|
Loading…
Reference in New Issue