]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/epa.c
fix WaitForResponse (without timeout)
[proxmark3-svn] / armsrc / epa.c
index ac907f6bbd87300b700d86fd7060610d2942e63e..fe32e4971b25eb5ad55526ce4e4a49860631391e 100644 (file)
@@ -453,20 +453,17 @@ int EPA_PACE_MSE_Set_AT(pace_version_info_t pace_version_info, uint8_t password)
 //-----------------------------------------------------------------------------
 // Perform the PACE protocol by replaying given APDUs
 //-----------------------------------------------------------------------------
-void EPA_PACE_Replay(UsbCommand *c)
-{
+void EPA_PACE_Replay(UsbCommand *c) {
        uint32_t timings[sizeof(apdu_lengths_replay) / sizeof(apdu_lengths_replay[0])] = {0};
 
-       // if an APDU has been passed, save it
+       // if an APDU has been passed, just save it
        if (c->arg[0] != 0) {
                // make sure it's not too big
-               if(c->arg[2] > apdus_replay[c->arg[0] - 1].len)
-               {
+               if(c->arg[2] > apdus_replay[c->arg[0] - 1].len) {
                        cmd_send(CMD_ACK, 1, 0, 0, NULL, 0);
+                       return;
                }
-               memcpy(apdus_replay[c->arg[0] - 1].data + c->arg[1],
-                  c->d.asBytes,
-                  c->arg[2]);
+               memcpy(apdus_replay[c->arg[0] - 1].data + c->arg[1], c->d.asBytes, c->arg[2]);
                // save/update APDU length
                if (c->arg[1] == 0) {
                        apdu_lengths_replay[c->arg[0] - 1] = c->arg[2];
Impressum, Datenschutz