- if (serial_put(&srl, id, strlen(id)) != strlen(id)) return -1;
- if (serial_put(&srl, pass, strlen(pass)) != strlen(pass)) return -1;
- if (serial_put(&srl, nonce, strlen(nonce)) != strlen(nonce)) return -1;
- if (serial_put(&srl, NULL, 0) != 0) return -1;
- *challengesize = ((serial_size(&srl) -1) / CBLKSIZE + 1) * CBLKSIZE;
+ if (serial_put(&srl, id, strlen(id)) != strlen(id)) return -2;
+ if (serial_put(&srl, pass, strlen(pass)) != strlen(pass)) return -3;
+ if (serial_put(&srl, nonce, strlen(nonce)) != strlen(nonce)) return -4;
+ if (serial_put(&srl, NULL, 0) != 0) return -5;
+ *challengesize = serial_size(&srl);