Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
22
plugins/secretstores/http/decryption_test.go
Normal file
22
plugins/secretstores/http/decryption_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package http
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCreateAESFail(t *testing.T) {
|
||||
cfg := DecryptionConfig{Cipher: "aes128/CBC/PKCS#5/garbage"}
|
||||
decrypt, err := cfg.CreateDecrypter()
|
||||
require.ErrorContains(t, err, "init of AES decrypter failed")
|
||||
require.Nil(t, decrypt)
|
||||
}
|
||||
|
||||
func TestTrimPKCSFail(t *testing.T) {
|
||||
_, err := PKCS5or7Trimming(nil)
|
||||
require.ErrorContains(t, err, "empty value to trim")
|
||||
|
||||
_, err = PKCS5or7Trimming([]byte{0x00, 0x05})
|
||||
require.ErrorContains(t, err, "length 2 shorter than trim value 5")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue