* [FFmpeg-devel] [PATCH] fix typo(1),style(1),nit(4) issue
@ 2024-04-03 8:50 정지우 | Eugene
2024-04-03 9:00 ` Hendrik Leppkes
0 siblings, 1 reply; 2+ messages in thread
From: 정지우 | Eugene @ 2024-04-03 8:50 UTC (permalink / raw)
To: ffmpeg-devel
- typo(1) : Line 242 : RFIC7616 ->RFC7616
- style(1) : make_digest_auth() , make_digest_auth_sha() : A1hash-> a1_hash and A2hash -> a2_hash
- nit(3) : httpauth.c: Line 245,265,389:
- nit(1) : httpauth.h: Line 85
Signed-off-by: Eugene-bitsensing <eugene@bitsensing.com>
---
libavformat/httpauth.c | 34 +++++++++++++++++-----------------
libavformat/httpauth.h | 4 ++--
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index 8391b6f32f..6069523bca 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -144,7 +144,7 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
char cnonce[17];
char nc[9];
int i;
- char A1hash[33], A2hash[33], response[33];
+ char a1_hash[33], a2_hash[33], response[33];
struct AVMD5 *md5ctx;
uint8_t hash[16];
char *authstr;
@@ -164,14 +164,14 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
av_md5_init(md5ctx);
update_md5_strings(md5ctx, username, ":", state->realm, ":", password, NULL);
av_md5_final(md5ctx, hash);
- ff_data_to_hex(A1hash, hash, 16, 1);
+ ff_data_to_hex(a1_hash, hash, 16, 1);
if (!strcmp(digest->algorithm, "") || !strcmp(digest->algorithm, "MD5")) {
} else if (!strcmp(digest->algorithm, "MD5-sess")) {
av_md5_init(md5ctx);
- update_md5_strings(md5ctx, A1hash, ":", digest->nonce, ":", cnonce, NULL);
+ update_md5_strings(md5ctx, a1_hash, ":", digest->nonce, ":", cnonce, NULL);
av_md5_final(md5ctx, hash);
- ff_data_to_hex(A1hash, hash, 16, 1);
+ ff_data_to_hex(a1_hash, hash, 16, 1);
} else {
/* Unsupported algorithm */
av_free(md5ctx);
@@ -181,14 +181,14 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
av_md5_init(md5ctx);
update_md5_strings(md5ctx, method, ":", uri, NULL);
av_md5_final(md5ctx, hash);
- ff_data_to_hex(A2hash, hash, 16, 1);
+ ff_data_to_hex(a2_hash, hash, 16, 1);
av_md5_init(md5ctx);
- update_md5_strings(md5ctx, A1hash, ":", digest->nonce, NULL);
+ update_md5_strings(md5ctx, a1_hash, ":", digest->nonce, NULL);
if (!strcmp(digest->qop, "auth") || !strcmp(digest->qop, "auth-int")) {
update_md5_strings(md5ctx, ":", nc, ":", cnonce, ":", digest->qop, NULL);
}
- update_md5_strings(md5ctx, ":", A2hash, NULL);
+ update_md5_strings(md5ctx, ":", a2_hash, NULL);
av_md5_final(md5ctx, hash);
ff_data_to_hex(response, hash, 16, 1);
@@ -239,11 +239,11 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
/**
* Generate a digest reply SHA-256, according to RFC 7616.
- * TODO : support other RFIC 7616 Algorithm
+ * TODO : support other RFC 7616 Algorithm
*/
static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
- const char *password, const char *uri,
- const char *method, const char *algorithm)
+ const char *password, const char *uri,
+ const char *method, const char *algorithm)
{
DigestParams *digest = &state->digest_params;
int len;
@@ -251,7 +251,7 @@ static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
char cnonce[17];
char nc[9];
int i;
- char A1hash[65], A2hash[65], response[65];
+ char a1_hash[65], a2_hash[65], response[65];
struct AVHashContext *hashctx;
uint8_t hash[64];
char *authstr;
@@ -262,7 +262,7 @@ static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
/* Generate a client nonce. */
for (i = 0; i < 2; i++)
cnonce_buf[i] = av_get_random_seed();
- ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1);
+ ff_data_to_hex(cnonce, (const uint8_t *)cnonce_buf, sizeof(cnonce_buf), 1);
/* Allocate a hash context based on the provided algorithm */
int ret = av_hash_alloc(&hashctx, algorithm);
@@ -280,7 +280,7 @@ static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
av_hash_update(hashctx, (const uint8_t *)":", 1);
av_hash_update(hashctx, (const uint8_t *)password, strlen(password));
av_hash_final(hashctx, hash);
- ff_data_to_hex(A1hash, hash, av_hash_get_size(hashctx), 1);
+ ff_data_to_hex(a1_hash, hash, av_hash_get_size(hashctx), 1);
/* Initialize the hash context for A2 */
av_hash_init(hashctx);
@@ -288,11 +288,11 @@ static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
av_hash_update(hashctx, (const uint8_t *)":", 1);
av_hash_update(hashctx, (const uint8_t *)uri, strlen(uri));
av_hash_final(hashctx, hash);
- ff_data_to_hex(A2hash, hash, av_hash_get_size(hashctx), 1);
+ ff_data_to_hex(a2_hash, hash, av_hash_get_size(hashctx), 1);
/* Initialize the hash context for response */
av_hash_init(hashctx);
- av_hash_update(hashctx, (const uint8_t *)A1hash, strlen(A1hash));
+ av_hash_update(hashctx, (const uint8_t *)a1_hash, strlen(a1_hash));
av_hash_update(hashctx, (const uint8_t *)":", 1);
av_hash_update(hashctx, (const uint8_t *)digest->nonce, strlen(digest->nonce));
av_hash_update(hashctx, (const uint8_t *)":", 1);
@@ -302,7 +302,7 @@ static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
av_hash_update(hashctx, (const uint8_t *)":", 1);
av_hash_update(hashctx, (const uint8_t *)digest->qop, strlen(digest->qop));
av_hash_update(hashctx, (const uint8_t *)":", 1);
- av_hash_update(hashctx, (const uint8_t *)A2hash, strlen(A2hash));
+ av_hash_update(hashctx, (const uint8_t *)a2_hash, strlen(a2_hash));
av_hash_final(hashctx, hash);
ff_data_to_hex(response, hash, av_hash_get_size(hashctx), 1);
@@ -386,7 +386,7 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
if ((password = strchr(username, ':'))) {
*password++ = 0;
/* add digest algorithm SHA-256 */
- if (!strcmp(state->digest_params.algorithm, "SHA-256")) {
+ if (!strcmp(state->digest_params.algorithm, "SHA256")) {
authstr = make_digest_auth_sha(state, username, password, path, method,"SHA256");
} else {
authstr = make_digest_auth(state, username, password, path, method);
diff --git a/libavformat/httpauth.h b/libavformat/httpauth.h
index 4f45b4a0b9..a55986ea3e 100644
--- a/libavformat/httpauth.h
+++ b/libavformat/httpauth.h
@@ -82,6 +82,6 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
* SHA-256-sess, SHA-512-256 and SHA-512-256-sess not supported yet
*/
static char *make_digest_auth_sha(HTTPAuthState *state, const char *username,
- const char *password, const char *uri,
- const char *method, const char *algorithm);
+ const char *password, const char *uri,
+ const char *method, const char *algorithm);
#endif /* AVFORMAT_HTTPAUTH_H */
--
2.42.0.windows.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fix typo(1),style(1),nit(4) issue
2024-04-03 8:50 [FFmpeg-devel] [PATCH] fix typo(1),style(1),nit(4) issue 정지우 | Eugene
@ 2024-04-03 9:00 ` Hendrik Leppkes
0 siblings, 0 replies; 2+ messages in thread
From: Hendrik Leppkes @ 2024-04-03 9:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Apr 3, 2024 at 10:50 AM 정지우 | Eugene <eugene@bitsensing.com> wrote:
>
> - typo(1) : Line 242 : RFIC7616 ->RFC7616
> - style(1) : make_digest_auth() , make_digest_auth_sha() : A1hash-> a1_hash and A2hash -> a2_hash
> - nit(3) : httpauth.c: Line 245,265,389:
> - nit(1) : httpauth.h: Line 85
>
> Signed-off-by: Eugene-bitsensing <eugene@bitsensing.com>
>
> @@ -386,7 +386,7 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
> if ((password = strchr(username, ':'))) {
> *password++ = 0;
> /* add digest algorithm SHA-256 */
> - if (!strcmp(state->digest_params.algorithm, "SHA-256")) {
> + if (!strcmp(state->digest_params.algorithm, "SHA256")) {
This is not a "nit", "SHA-256" with a dash is how RFC 7616 specifies
the algorithm token to be spelled.
> authstr = make_digest_auth_sha(state, username, password, path, method,"SHA256");
> } else {
> authstr = make_digest_auth(state, username, password, path, method);
- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-03 9:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 8:50 [FFmpeg-devel] [PATCH] fix typo(1),style(1),nit(4) issue 정지우 | Eugene
2024-04-03 9:00 ` Hendrik Leppkes
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git