]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/httpauth.c
Make write_header() and write_headers() return an error code in case of
[ffmpeg] / libavformat / httpauth.c
index d6ff6fdfd411ea0c8a74ffb6c3188efa71b35370..abdee81decea2dd211c0c6c996b879fb9fd7bd5e 100644 (file)
@@ -143,9 +143,6 @@ static void choose_qop(char *qop, int size)
 void ff_http_auth_handle_header(HTTPAuthState *state, const char *key,
                                 const char *value)
 {
-    if (!state)
-        return;
-
     if (!strcmp(key, "WWW-Authenticate")) {
         const char *p;
         if (av_stristart(value, "Basic ", &p) &&
@@ -190,7 +187,7 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
     DigestParams *digest = &state->digest_params;
     int len;
     uint32_t cnonce_buf[2];
-    char cnonce[9];
+    char cnonce[17];
     char nc[9];
     int i;
     char A1hash[33], A2hash[33], response[33];
@@ -203,7 +200,7 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
 
     /* Generate a client nonce. */
     for (i = 0; i < 2; i++)
-        cnonce_buf[i] = ff_random_get_seed();
+        cnonce_buf[i] = av_get_random_seed();
     ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1);
     cnonce[2*sizeof(cnonce_buf)] = 0;