From 4d483b0a282828f1ff77c9dbc82c2948f8db2297 Mon Sep 17 00:00:00 2001 From: Kareem Date: Mon, 29 Nov 2021 15:10:50 -0700 Subject: [PATCH] iotsafe: allow init to continue with empty response --- wolfcrypt/src/port/iotsafe/iotsafe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/port/iotsafe/iotsafe.c b/wolfcrypt/src/port/iotsafe/iotsafe.c index 06cef8a3e..57463f2aa 100644 --- a/wolfcrypt/src/port/iotsafe/iotsafe.c +++ b/wolfcrypt/src/port/iotsafe/iotsafe.c @@ -387,8 +387,9 @@ static int expect_csim_response(const char *cmd, word32 size, char **reply) ret -= 2; if (ret >= 4) { endstr = XSTRSTR(payload, "9000\""); - if (endstr == NULL) + if (endstr == NULL) { endstr = XSTRSTR(payload, "\""); + } if (endstr) { *endstr = 0; ret = (int)XSTRLEN(payload); @@ -420,7 +421,7 @@ static int iotsafe_init(void) WOLFSSL_MSG("ATE0 OK!"); if (expect_csim_response(atcmd_load_applet_str, - (word32)XSTRLEN(atcmd_load_applet_str), &reply) < 1) { + (word32)XSTRLEN(atcmd_load_applet_str), &reply) < 0) { WOLFSSL_MSG("FAIL: no Applet code response from iot-safe init"); } else { WOLFSSL_MSG("IoT Safe Applet INIT OK");