diff --git a/armsrc/epa.c b/armsrc/epa.c index 95de11550..521bb3f69 100644 --- a/armsrc/epa.c +++ b/armsrc/epa.c @@ -305,6 +305,11 @@ void EPA_PACE_Collect_Nonce(UsbCommand *c) { // initiate the PACE protocol // use the CAN for the password since that doesn't change func_return = EPA_PACE_MSE_Set_AT(pace_version_info, 2); + // check if the command succeeded + if (func_return != 0) { + EPA_PACE_Collect_Nonce_Abort(4, func_return); + return; + } // now get the nonce uint8_t nonce[256] = {0}; @@ -312,7 +317,7 @@ void EPA_PACE_Collect_Nonce(UsbCommand *c) { func_return = EPA_PACE_Get_Nonce(requested_size, nonce); // check if the command succeeded if (func_return < 0) { - EPA_PACE_Collect_Nonce_Abort(4, func_return); + EPA_PACE_Collect_Nonce_Abort(5, func_return); return; }