Merge branch 'master' of https://github.com/juhovh/shairplay into upstream
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 25 Nov 2014 23:43:23 +0000 (00:43 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 25 Nov 2014 23:43:23 +0000 (00:43 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Conflicts:
.gitignore
README.md
configure.ac
src/lib/digest.c
src/lib/dnssd.c
src/lib/httpd.c
src/lib/netutils.c
src/lib/raop.c
src/lib/raop_buffer.c
src/shairplay.c
src/test/example.c

1  2 
src/lib/raop.c

diff --cc src/lib/raop.c
index e5c6539c0b60bb20af6337b9ef492aab3cf1aad0,0c640b5bb67d85535607f078b148ce0dcb2f0358..e59254a81f87f1297deefde9762887316b516126
@@@ -123,6 -123,7 +123,10 @@@ conn_init(void *opaque, unsigned char *
  static void
  conn_request(void *ptr, http_request_t *request, http_response_t **response)
  {
++<<<<<<< HEAD
++=======
+       const char realm[] = "airplay";
++>>>>>>> 64d59e3087f829006d091fa0d114efb50972a2bf
        raop_conn_t *conn = ptr;
        raop_t *raop = conn->raop;
  
        }
  
        res = http_response_init("RTSP/1.0", 200, "OK");
++<<<<<<< HEAD
 +      if (strlen(raop->password)) {
++=======
+       /* We need authorization for everything else than OPTIONS request */
+       if (strcmp(method, "OPTIONS") != 0 && strlen(raop->password)) {
++>>>>>>> 64d59e3087f829006d091fa0d114efb50972a2bf
                const char *authorization;
  
                authorization = http_request_get_header(request, "Authorization");
                        logger_log(conn->raop->logger, LOGGER_DEBUG, "Our nonce: %s", conn->nonce);
                        logger_log(conn->raop->logger, LOGGER_DEBUG, "Authorization: %s", authorization);
                }
++<<<<<<< HEAD
 +              if (!digest_is_valid("AppleTV", raop->password, conn->nonce, method, http_request_get_url(request), authorization)) {
++=======
+               if (!digest_is_valid(realm, raop->password, conn->nonce, method, http_request_get_url(request), authorization)) {
++>>>>>>> 64d59e3087f829006d091fa0d114efb50972a2bf
                        char *authstr;
                        int authstrlen;
  
                        /* Allocate the authenticate string */
++<<<<<<< HEAD
 +                      authstrlen = sizeof("Digest realm=\"AppleTV\", nonce=\"\"") + sizeof(conn->nonce) + 1;
++=======
+                       authstrlen = sizeof("Digest realm=\"\", nonce=\"\"") + sizeof(realm) + sizeof(conn->nonce) + 1;
++>>>>>>> 64d59e3087f829006d091fa0d114efb50972a2bf
                        authstr = malloc(authstrlen);
  
                        /* Concatenate the authenticate string */
                        memset(authstr, 0, authstrlen);
++<<<<<<< HEAD
 +                      strcat(authstr, "Digest realm=\"AppleTV\", nonce=\"");
++=======
+                       strcat(authstr, "Digest realm=\"");
+                       strcat(authstr, realm);
+                       strcat(authstr, "\", nonce=\"");
++>>>>>>> 64d59e3087f829006d091fa0d114efb50972a2bf
                        strcat(authstr, conn->nonce);
                        strcat(authstr, "\"");