if (otp == NULL) {
info = "otp";
+ status = "MISSING_PARAMETER";
signature = sign_request(shared_secret, shared_secret_len,
- info, "MISSING_PARAMETER", timestamp);
+ info, status, timestamp);
send_response(conn, signature, status, NULL, timestamp);
/* XXX free memory */
return MHD_YES;
}
if (! yubikey_modhex_p(otp)) {
+ status = "BAD OTP";
signature = sign_request(shared_secret, shared_secret_len,
- NULL, "BAD OTP", timestamp);
+ NULL, status, timestamp);
send_response(conn, signature, status, NULL, timestamp);
/* XXX free memory */
return MHD_YES;
yubikey_parse((uint8_t*)(otp_token), (const uint8_t *)stats.secret_key, &token);
if (!yubikey_crc_ok_p((void*)&token) ||
memcmp(token.uid, stats.secret_uid, YUBIKEY_UID_SIZE) != 0) {
+ status = "BAD OTP";
signature = sign_request(shared_secret, shared_secret_len,
- NULL, "BAD OTP", timestamp);
+ NULL, status, timestamp);
send_response(conn, signature, status, NULL, timestamp);
/* XXX FIXME free memory */