mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
* add key types and encryption for cbc * add decryption * start adding tests * add tests for policy functions * add convergent case * add enterprise check and key creation test cases * fix key generation and add import/export * add tests and fixes * add changelog * linter * refactor policy functions and fix IV * add ce change * fix function calls * fix factories in function call * fix IV test case * test fixes * add cbc keys to read * change iv * fix merge errors * make fmt * change error name and add iv error * fix tests Co-authored-by: Rachel Culpepper <84159930+rculpepper@users.noreply.github.com>
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
//go:build !enterprise
|
|
|
|
package keysutil
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/hashicorp/vault/sdk/helper/errutil"
|
|
)
|
|
|
|
type entKeyEntry struct{}
|
|
|
|
func (e entKeyEntry) IsEntPrivateKeyMissing() bool {
|
|
return true
|
|
}
|
|
|
|
func entSignWithOptions(p *Policy, input, context []byte, ver int, hashAlgorithm HashType, options *SigningOptions) ([]byte, error) {
|
|
return nil, fmt.Errorf("unsupported key type %v", p.Type)
|
|
}
|
|
|
|
func entVerifySignatureWithOptions(p *Policy, input, context []byte, sigBytes []byte, ver int, options *SigningOptions) (bool, error) {
|
|
return false, errutil.InternalError{Err: fmt.Sprintf("unsupported key type %v", p.Type)}
|
|
}
|
|
|
|
func entRotateInMemory(p *Policy, entry *KeyEntry, rand io.Reader) error {
|
|
return fmt.Errorf("unsupported key type %v", p.Type)
|
|
}
|
|
|
|
func entEncryptWithOptions(p *Policy, opts EncryptionOptions, value []byte) ([]byte, error) {
|
|
return nil, fmt.Errorf("unsupported key type %v", p.Type)
|
|
}
|
|
|
|
func entDecryptWithOptions(p *Policy, opts EncryptionOptions, value []byte) ([]byte, error) {
|
|
return nil, errutil.InternalError{Err: fmt.Sprintf("unsupported key type %v", p.Type)}
|
|
}
|