[FFmpeg-devel] [PATCH] Add support for digest auth in the http and rtsp protocols

Ronald S. Bultje rsbultje
Wed Mar 24 18:55:44 CET 2010


Hi,

now for #2.

On Tue, Mar 23, 2010 at 12:36 PM, Martin Storsj? <martin at martin.st> wrote:
[..]

> +        char *username = av_strdup(auth);
> +        char *password = NULL;
> +        char *ptr;
> +
> +        if (!username)
> +            return NULL;
> +
> +        ptr = strchr(username, ':');
> +        if (ptr) {
> +            *ptr = '\0';
> +            password = ptr + 1;
> +        }

char *username = av_strdup(), *password;
if ((password = strchr(username, ':')))
    *password++ = 0;

> +typedef struct {
> +    char realm[200];
> +    char nonce[300];
> +    char algorithm[10];
> +    char qop[10];
> +    char opaque[300];
> +    int nc;
> +} DigestParams;

realm is not digest-specific, as said in #1-review. Rest should be documented.

> +static void format_hash(char *str, int len, const uint8_t *hash, int size)
> +{
> +    int i;
> +    for (i = 0; i < size && 2*i < len; i++)
> +        snprintf(&str[2*i], len - 2*i, "%02x", hash[i]);
> +}

Is this ff_data_to_hex()?

Ronald



More information about the ffmpeg-devel mailing list