Commit 99e9db478d for strongswan.org
commit 99e9db478d6d956451cbb7b0161a6490eecbe5ad
Author: Tobias Brunner <tobias@strongswan.org>
Date: Thu Apr 9 09:45:27 2026 +0200
unit-tests: Use longer input for ECDSA tests
wolfSSL 5.9.1 starts to enforce a minimum (and maximum) length for the
hash when signing. Since we'll always require SHA-1, use 20 bytes as
input in the tests to succeed with SIGN_ECDSA_WITH_NULL.
diff --git a/src/libstrongswan/tests/suites/test_ecdsa.c b/src/libstrongswan/tests/suites/test_ecdsa.c
index 058508f188..3d2ed01163 100644
--- a/src/libstrongswan/tests/suites/test_ecdsa.c
+++ b/src/libstrongswan/tests/suites/test_ecdsa.c
@@ -40,7 +40,9 @@ static struct {
*/
static void test_good_sig(private_key_t *privkey, public_key_t *pubkey)
{
- chunk_t sig, data = chunk_from_chars(0x01,0x02,0x03,0xFD,0xFE,0xFF);
+ chunk_t sig, data = chunk_from_chars(0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x00,
+ 0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,
+ 0xFC,0xFD,0xFE,0xFF);
int i;
for (i = 0; i < countof(schemes); i++)
@@ -103,7 +105,9 @@ static chunk_t invalid_sigs[] = {
*/
static void test_bad_sigs(public_key_t *pubkey)
{
- chunk_t data = chunk_from_chars(0x01,0x02,0x03,0xFD,0xFE,0xFF);
+ chunk_t data = chunk_from_chars(0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x00,
+ 0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,
+ 0xFC,0xFD,0xFE,0xFF);
int s, i;
for (s = 0; s < countof(schemes); s++)