diff --git a/pkg/vault/pkcs11/vault.go b/pkg/vault/pkcs11/vault.go index a3a6a81f..f9c0a132 100644 --- a/pkg/vault/pkcs11/vault.go +++ b/pkg/vault/pkcs11/vault.go @@ -288,13 +288,10 @@ func New(config *Config) (*PKCS11Vault, error) { if config.Slot != nil { slot = *config.Slot } else if s := os.Getenv(envSlot); s != "" { - v, err := strconv.ParseUint(s, 0, 64) + v, err := strconv.ParseUint(s, 0, strconv.IntSize) if err != nil { return nil, formatError(mod, err) } - if v > uint64(^uint(0)) { - return nil, fmt.Errorf("(PKCS#11/%s): slot value exceeds maximum uint size", path.Base(lib)) - } slot = uint(v) } else if slot, err = findSlot(mod); err != nil { return nil, err