From 373b07d5903060e4e309a9e863f4a9ae2007102d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Tue, 29 Mar 2022 10:19:38 +0200 Subject: [PATCH] Add large key test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- kms/kms/util/crypto_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kms/kms/util/crypto_test.go b/kms/kms/util/crypto_test.go index 59d21ca97..251abfa96 100644 --- a/kms/kms/util/crypto_test.go +++ b/kms/kms/util/crypto_test.go @@ -30,6 +30,11 @@ func TestWrapKeyAES(t *testing.T) { key192 := []byte{0x58, 0x40, 0xdf, 0x6e, 0x29, 0xb0, 0x2a, 0xf1, 0xab, 0x49, 0x3b, 0x70, 0x5b, 0xf1, 0x6e, 0xa1, 0xae, 0x83, 0x38, 0xf4, 0xdc, 0xc1, 0x76, 0xa8} _, err = WrapAES(testDEK, key192) assert.Error(err) + + // Make sure we can wrap large keys. For example AES-XTS uses 512 bit keys + largeKey := []byte("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + _, err = WrapAES(largeKey, testKEK) + assert.NoError(err) } func TestParsePEM(t *testing.T) {