From: "정지우 | Eugene" <eugene@bitsensing.com> To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] fix typo(1),style(1),nit(4) issue Date: Wed, 3 Apr 2024 08:50:36 +0000 Message-ID: <SL2P216MB148161C1B4CFE14820436CBBB83D2@SL2P216MB1481.KORP216.PROD.OUTLOOK.COM> (raw) - 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".
next reply other threads:[~2024-04-03 8:50 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-03 8:50 정지우 | Eugene [this message] 2024-04-03 9:00 ` Hendrik Leppkes
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=SL2P216MB148161C1B4CFE14820436CBBB83D2@SL2P216MB1481.KORP216.PROD.OUTLOOK.COM \ --to=eugene@bitsensing.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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