Skip to content

Commit 6f976d8

Browse files
committed
More fixes to the broken atecc608 test
1 parent e820f81 commit 6f976d8

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/atecc608-sim.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ jobs:
6868
sed -i "/^RUN python3 - <<'PY'$/,/^PY$/d" Dockerfile.wolfcrypt
6969
! grep -q "RUN python3 - <<'PY'" Dockerfile.wolfcrypt
7070
71+
# The simulator Dockerfile predates the new configure contract where
72+
# --with-cryptoauthlib must be paired with --enable-microchip=<dev>.
73+
sed -i 's/--with-cryptoauthlib=\/usr \\/--enable-microchip=608 \\\n --with-cryptoauthlib=\/usr \\/' Dockerfile.wolfcrypt
74+
grep -q -- '--enable-microchip=608' Dockerfile.wolfcrypt
75+
7176
- uses: docker/setup-buildx-action@v3
7277

7378
- name: Build wolfCrypt-ATECC608 test image

wolfcrypt/src/port/atmel/atmel.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,20 @@ static int ateccx08a_cfg_initialized = 0;
157157
.rx_retries = 20,
158158
},
159159
#endif
160+
#if !defined(WOLFSSL_MANUALLY_SELECT_DEVICE_CONFIG) && \
161+
!(defined(WOLFSSL_ATECC608A) && defined(MICROCHIP_MPLAB_HARMONY_3)) && \
162+
!defined(ATCA_HAL_SPI) && !defined(ATCA_HAL_I2C)
163+
{
164+
/* Custom HAL users provide callbacks later through
165+
* wolfCrypt_ATECC_SetConfig(), but gCfg still needs a valid default
166+
* backing object so configure-time warning builds do not see an empty
167+
* config array. */
168+
.iface_type = ATCA_CUSTOM_IFACE,
169+
.devtype = MICROCHIP_DEV_TYPE,
170+
.wake_delay = 1500,
171+
.rx_retries = 20,
172+
},
173+
#endif
160174
};
161175
static ATCAIfaceCfg* gCfg = &config_atmel_device[WOLFSSL_ATCA_DEVICE_NO];
162176

wolfcrypt/test/test.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26131,13 +26131,15 @@ static wc_test_ret_t rsa_keygen_test(WC_RNG* rng)
2613126131
!defined(WOLFSSL_MICROCHIP)
2613226132
word32 idx = 0;
2613326133
#endif
26134-
int derSz = 0;
2613526134
#if !defined(WOLFSSL_SP_MATH) && !defined(HAVE_FIPS) && \
2613626135
(defined(RSA_MIN_SIZE) && (RSA_MIN_SIZE <= 1024))
2613726136
int keySz = 1024;
2613826137
#else
2613926138
int keySz = 2048;
2614026139
#endif
26140+
#if !defined(WC_TEST_SKIP_RSA_PRIVATE_EXPORT) && !defined(WOLFSSL_MICROCHIP)
26141+
int derSz = 0;
26142+
#endif
2614126143

2614226144
#ifdef WOLF_CRYPTO_CB_ONLY_RSA
2614326145
if (devId == INVALID_DEVID) {
@@ -26180,6 +26182,7 @@ static wc_test_ret_t rsa_keygen_test(WC_RNG* rng)
2618026182
if (ret != 0)
2618126183
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_rsa);
2618226184
#endif
26185+
#if !defined(WC_TEST_SKIP_RSA_PRIVATE_EXPORT) && !defined(WOLFSSL_MICROCHIP)
2618326186
#ifndef WOLFSSL_NO_MALLOC
2618426187
der = (byte*)XMALLOC(FOURK_BUF, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
2618526188
if (der == NULL) {
@@ -26189,7 +26192,6 @@ static wc_test_ret_t rsa_keygen_test(WC_RNG* rng)
2618926192
#else
2619026193
derSz = sizeof(der);
2619126194
#endif
26192-
#if !defined(WC_TEST_SKIP_RSA_PRIVATE_EXPORT) && !defined(WOLFSSL_MICROCHIP)
2619326195
derSz = wc_RsaKeyToDer(genKey, der, derSz);
2619426196
if (derSz < 0) {
2619526197
ERROR_OUT(WC_TEST_RET_ENC_EC(derSz), exit_rsa);

0 commit comments

Comments
 (0)