+int make_challenge(const char *id, const char *pass, const char *nonce,
+ unsigned char *challenge, int *challengesize)
+{
+ serializer_t srl;
+
+ if (serial_init(&srl, challenge, *challengesize)) return -1;
+ 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);
+ return 0;
+}
+