#define MAX_PASSWORD_LEN 64
/* MD5 as hex fits here */
-#define MAX_NONCE_LEN 33
+#define MAX_NONCE_LEN 32
struct raop_s {
/* Callbacks for audio */
authorization = http_request_get_header(request, "Authorization");
if (authorization) {
+ logger_log(&conn->raop->logger, LOGGER_DEBUG, "Our nonce: %s\n", conn->nonce);
logger_log(&conn->raop->logger, LOGGER_DEBUG, "Authorization: %s\n", authorization);
}
- if (!digest_is_valid("AppleTV", raop->password, conn->nonce, method, authorization)) {
+ if (!digest_is_valid("AppleTV", raop->password, conn->nonce, method, http_request_get_url(request), authorization)) {
char *authstr;
int authstrlen;
http_response_add_header(res, "Apple-Jack-Status", "connected; type=analog");
challenge = http_request_get_header(request, "Apple-Challenge");
- if (challenge) {
+ if (!require_auth && challenge) {
char signature[MAX_SIGNATURE_LEN];
memset(signature, 0, sizeof(signature));
memcpy(datastr, data, datalen);
if (!strncmp(datastr, "volume: ", 8)) {
float vol = 0.0;
- sscanf(data+8, "%f", &vol);
+ sscanf(datastr+8, "%f", &vol);
raop_rtp_set_volume(conn->raop_rtp, vol);
}
}
+ free(datastr);
} else if (!strcmp(method, "FLUSH")) {
const char *rtpinfo;
int next_seq = -1;