11/* certs_test.h
22 *
3- * Copyright (C) 2014-2024 wolfSSL Inc.
3+ * Copyright (C) 2014-2025 wolfSSL Inc.
44 *
55 * This file is part of wolfSSH.
66 *
2121#ifndef _WOLFSSH_CERTS_TEST_H_
2222#define _WOLFSSH_CERTS_TEST_H_
2323
24+ /* To distinguish these certs from those in wolfssl add suffix: _ssh
25+ * See: https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/certs_test.h
26+ * Generate: https://github.com/wolfSSL/wolfssl/blob/master/gencertbuf.pl
27+ *
28+ * In C89/C90 (which Watcom generally defaults to), sizeof must be a
29+ * compile-time constant expression when used in a static initializer.
30+ * So don't use `static const int sizeof_`
31+ */
32+
2433#if defined(NO_FILESYSTEM )
2534
2635/* ./keys/server-key-rsa.der, 2048-bit */
27- static const unsigned char rsa_key_der_2048 [] =
36+ static const unsigned char rsa_key_der_2048_ssh [] =
2837{
2938 0x30 , 0x82 , 0x04 , 0xA3 , 0x02 , 0x01 , 0x00 , 0x02 , 0x82 , 0x01 ,
3039 0x01 , 0x00 , 0xDA , 0x5D , 0xAD , 0x25 , 0x14 , 0x76 , 0x15 , 0x59 ,
@@ -147,10 +156,10 @@ static const unsigned char rsa_key_der_2048[] =
147156 0x56 , 0xC3 , 0xCE , 0x77 , 0x5F , 0x5B , 0xBA , 0x6C , 0x42 , 0xF1 ,
148157 0x21
149158};
150- static const int sizeof_rsa_key_der_2048 = sizeof (rsa_key_der_2048 );
159+ #define sizeof_rsa_key_der_2048_ssh ( sizeof(rsa_key_der_2048_ssh))
151160
152161/* ./keys/server-key-ecc.der, ECC */
153- static const unsigned char ecc_key_der_256 [] =
162+ static const unsigned char ecc_key_der_256_ssh [] =
154163{
155164 0x30 , 0x77 , 0x02 , 0x01 , 0x01 , 0x04 , 0x20 , 0x61 , 0x09 , 0x99 ,
156165 0x0B , 0x79 , 0xD2 , 0x5F , 0x28 , 0x5A , 0x0F , 0x5D , 0x15 , 0xCC ,
@@ -166,10 +175,10 @@ static const unsigned char ecc_key_der_256[] =
166175 0x05 , 0x58 , 0x6B , 0x5F , 0x63 , 0xC8 , 0xDA , 0x1B , 0xC4 , 0xF5 ,
167176 0x69
168177};
169- static const int sizeof_ecc_key_der_256 = sizeof (ecc_key_der_256 );
178+ #define sizeof_ecc_key_der_256_ssh ( sizeof(ecc_key_der_256_ssh))
170179
171180/* ./keys/server-key-ecc-384.der, ECC */
172- static const unsigned char ecc_key_der_384 [] =
181+ static const unsigned char ecc_key_der_384_ssh [] =
173182{
174183 0x30 , 0x81 , 0xA4 , 0x02 , 0x01 , 0x01 , 0x04 , 0x30 , 0x3E , 0xAD ,
175184 0xD2 , 0xBB , 0xBF , 0x05 , 0xA7 , 0xBE , 0x3A , 0x3F , 0x7C , 0x28 ,
@@ -189,10 +198,10 @@ static const unsigned char ecc_key_der_384[] =
189198 0x3D , 0x3E , 0xB8 , 0x8D , 0x46 , 0x7B , 0x5F , 0x27 , 0xEB , 0xAB ,
190199 0x21 , 0x61 , 0xC0 , 0x00 , 0x66 , 0xFE , 0xBD
191200};
192- static const int sizeof_ecc_key_der_384 = sizeof (ecc_key_der_384 );
201+ #define sizeof_ecc_key_der_384_ssh ( sizeof(ecc_key_der_384_ssh))
193202
194203/* ./keys/server-key-ecc-521.der, ECC */
195- static const unsigned char ecc_key_der_521 [] =
204+ static const unsigned char ecc_key_der_521_ssh [] =
196205{
197206 0x30 , 0x81 , 0xDC , 0x02 , 0x01 , 0x01 , 0x04 , 0x42 , 0x00 , 0x4C ,
198207 0xA4 , 0xD8 , 0x64 , 0x28 , 0xD9 , 0x40 , 0x0E , 0x7B , 0x2D , 0xF3 ,
@@ -218,7 +227,7 @@ static const unsigned char ecc_key_der_521[] =
218227 0x23 , 0x7C , 0xA5 , 0xA3 , 0x45 , 0xB1 , 0x9E , 0x3F , 0x1A , 0x22 ,
219228 0x90 , 0xB1 , 0x54
220229};
221- static const int sizeof_ecc_key_der_521 = sizeof (ecc_key_der_521 );
230+ #define sizeof_ecc_key_der_521_ssh ( sizeof(ecc_key_der_521_ssh))
222231
223232#endif /* NO_FILESYSTEM */
224233
0 commit comments