]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
unit-tests: Use longer input for ECDSA tests
authorTobias Brunner <tobias@strongswan.org>
Thu, 9 Apr 2026 07:45:27 +0000 (09:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 9 Apr 2026 07:53:36 +0000 (09:53 +0200)
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.

src/libstrongswan/tests/suites/test_ecdsa.c

index 058508f188a8d7b05826a5e22c17d036d99eb64a..3d2ed01163855a733e3d933f1aa5e4351c1083fa 100644 (file)
@@ -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++)