]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
http server: fix the new digest hashes (appearently firefox nor chrome do support...
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 Feb 2019 12:43:26 +0000 (13:43 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Feb 2019 12:44:17 +0000 (13:44 +0100)
src/config.c
src/http.c
src/utils.c

index 351a1aa47cf401f2cd587c5e4f802cafec23b447..2293d278be4b980f7f8f3db8dbb8139ce0224529 100644 (file)
@@ -1691,7 +1691,7 @@ config_boot
   config.idnode.in_class = &config_class;
   config.ui_quicktips = 1;
   config.http_auth = HTTP_AUTH_DIGEST;
-  config.http_auth_algo = HTTP_AUTH_ALGO_SHA512_256;
+  config.http_auth_algo = HTTP_AUTH_ALGO_MD5;
   config.proxy = 0;
   config.realm = strdup("tvheadend");
   config.info_area = strdup("login,storage,time");
index 8daa840177207864bdb66d874921b689fe299b58..0b3c68529d8a90e7fee89cf444a38f81a233b647 100644 (file)
@@ -390,12 +390,12 @@ http_send_header(http_connection_t *hc, int rc, const char *content,
       if (hc->hc_nonce == NULL)
         http_get_nonce(hc);
       char *opaque = http_get_opaque(hc, realm);
-      htsbuf_qprintf(&hdrs, "WWW-Authenticate: Digest realm=\"%s\"", realm);
+      htsbuf_qprintf(&hdrs, "WWW-Authenticate: Digest realm=\"%s\", qop=auth", realm);
       if (config.http_auth_algo != HTTP_AUTH_ALGO_MD5)
         htsbuf_qprintf(&hdrs, ", algorithm=%s",
                        config.http_auth_algo == HTTP_AUTH_ALGO_SHA256 ?
                          "SHA-256" : "SHA-512-256");
-      htsbuf_qprintf(&hdrs, ", qop=\"auth\", nonce=\"%s\"", hc->hc_nonce);
+      htsbuf_qprintf(&hdrs, ", nonce=\"%s\"", hc->hc_nonce);
       htsbuf_qprintf(&hdrs, ", opaque=\"%s\"\r\n", opaque);
       free(opaque);
     } else {
index 8fc5da8b73451c75534dfe1314626cf976c519a8..1cdc30f3c35d712b329c9e1439ae883bb7c635ef 100644 (file)
@@ -568,11 +568,11 @@ openssl_hash ( const char *str, int lowercase, const EVP_MD *md, int len )
 
   if ((mdctx = EVP_MD_CTX_create()) == NULL)
     return NULL;
-  if (EVP_DigestInit_ex(mdctx, md, NULL) != 0)
+  if (EVP_DigestInit_ex(mdctx, md, NULL) != 1)
     goto __error;
-  if (EVP_DigestUpdate(mdctx, str, strlen(str)) != 0)
+  if (EVP_DigestUpdate(mdctx, str, strlen(str)) != 1)
     goto __error;
-  if (EVP_DigestFinal_ex(mdctx, hash, NULL))
+  if (EVP_DigestFinal_ex(mdctx, hash, NULL) != 1)
     goto __error;
   for (i = 0; i < len; i++)
     sprintf(ret + i*2, fmt, hash[i]);