diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-05-16 18:02:22 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-05-16 18:15:39 +0300 |
commit | 356187139c78ee5be253fe1c3cba932b210ec84e (patch) | |
tree | cf18e8c597dd4a5d8d2d328ea194e21455f5bc89 | |
parent | 1265e687ffab6f0afcaff887049199bcd28adaaa (diff) | |
download | libmicrohttpd-356187139c78ee5be253fe1c3cba932b210ec84e.tar.gz libmicrohttpd-356187139c78ee5be253fe1c3cba932b210ec84e.zip |
sha256: renamed one function for clarity and uniformity
-rw-r--r-- | src/microhttpd/digestauth.c | 2 | ||||
-rw-r--r-- | src/microhttpd/sha256.c | 4 | ||||
-rw-r--r-- | src/microhttpd/sha256.h | 4 | ||||
-rw-r--r-- | src/microhttpd/test_sha256.c | 8 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 649fef62..04c9f22a 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -1212,7 +1212,7 @@ MHD_digest_auth_check (struct MHD_Connection *connection, | |||
1212 | da.sessionkey = skey.sha256; \ | 1212 | da.sessionkey = skey.sha256; \ |
1213 | da.init = &MHD_SHA256_init; \ | 1213 | da.init = &MHD_SHA256_init; \ |
1214 | da.update = &MHD_SHA256_update; \ | 1214 | da.update = &MHD_SHA256_update; \ |
1215 | da.digest = &sha256_finish; \ | 1215 | da.digest = &MHD_SHA256_finish; \ |
1216 | break; \ | 1216 | break; \ |
1217 | default: \ | 1217 | default: \ |
1218 | mhd_assert (false); \ | 1218 | mhd_assert (false); \ |
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c index 908bbda2..d06b70b2 100644 --- a/src/microhttpd/sha256.c +++ b/src/microhttpd/sha256.c | |||
@@ -318,8 +318,8 @@ MHD_SHA256_update (void *ctx_, | |||
318 | * @param[out] digest set to the hash, must be #SHA256_DIGEST_SIZE bytes | 318 | * @param[out] digest set to the hash, must be #SHA256_DIGEST_SIZE bytes |
319 | */ | 319 | */ |
320 | void | 320 | void |
321 | sha256_finish (void *ctx_, | 321 | MHD_SHA256_finish (void *ctx_, |
322 | uint8_t digest[SHA256_DIGEST_SIZE]) | 322 | uint8_t digest[SHA256_DIGEST_SIZE]) |
323 | { | 323 | { |
324 | struct sha256_ctx *const ctx = ctx_; | 324 | struct sha256_ctx *const ctx = ctx_; |
325 | uint64_t num_bits; /**< Number of processed bits */ | 325 | uint64_t num_bits; /**< Number of processed bits */ |
diff --git a/src/microhttpd/sha256.h b/src/microhttpd/sha256.h index 4a90c233..55962d72 100644 --- a/src/microhttpd/sha256.h +++ b/src/microhttpd/sha256.h | |||
@@ -87,7 +87,7 @@ MHD_SHA256_update (void *ctx_, | |||
87 | * @param[out] digest set to the hash, must be #SHA256_DIGEST_SIZE bytes | 87 | * @param[out] digest set to the hash, must be #SHA256_DIGEST_SIZE bytes |
88 | */ | 88 | */ |
89 | void | 89 | void |
90 | sha256_finish (void *ctx_, | 90 | MHD_SHA256_finish (void *ctx_, |
91 | uint8_t digest[SHA256_DIGEST_SIZE]); | 91 | uint8_t digest[SHA256_DIGEST_SIZE]); |
92 | 92 | ||
93 | #endif /* MHD_SHA256_H */ | 93 | #endif /* MHD_SHA256_H */ |
diff --git a/src/microhttpd/test_sha256.c b/src/microhttpd/test_sha256.c index 7ad5f399..b6904e49 100644 --- a/src/microhttpd/test_sha256.c +++ b/src/microhttpd/test_sha256.c | |||
@@ -337,7 +337,7 @@ test1_str (void) | |||
337 | MHD_SHA256_init (&ctx); | 337 | MHD_SHA256_init (&ctx); |
338 | MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, | 338 | MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, |
339 | data_units1[i].str_l.len); | 339 | data_units1[i].str_l.len); |
340 | sha256_finish (&ctx, digest); | 340 | MHD_SHA256_finish (&ctx, digest); |
341 | num_failed += check_result (__FUNCTION__, i, digest, | 341 | num_failed += check_result (__FUNCTION__, i, digest, |
342 | data_units1[i].digest); | 342 | data_units1[i].digest); |
343 | } | 343 | } |
@@ -359,7 +359,7 @@ test1_bin (void) | |||
359 | MHD_SHA256_init (&ctx); | 359 | MHD_SHA256_init (&ctx); |
360 | MHD_SHA256_update (&ctx, data_units2[i].bin_l.bin, | 360 | MHD_SHA256_update (&ctx, data_units2[i].bin_l.bin, |
361 | data_units2[i].bin_l.len); | 361 | data_units2[i].bin_l.len); |
362 | sha256_finish (&ctx, digest); | 362 | MHD_SHA256_finish (&ctx, digest); |
363 | num_failed += check_result (__FUNCTION__, i, digest, | 363 | num_failed += check_result (__FUNCTION__, i, digest, |
364 | data_units2[i].digest); | 364 | data_units2[i].digest); |
365 | } | 365 | } |
@@ -384,7 +384,7 @@ test2_str (void) | |||
384 | MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s); | 384 | MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s); |
385 | MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s, | 385 | MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s, |
386 | data_units1[i].str_l.len - part_s); | 386 | data_units1[i].str_l.len - part_s); |
387 | sha256_finish (&ctx, digest); | 387 | MHD_SHA256_finish (&ctx, digest); |
388 | num_failed += check_result (__FUNCTION__, i, digest, | 388 | num_failed += check_result (__FUNCTION__, i, digest, |
389 | data_units1[i].digest); | 389 | data_units1[i].digest); |
390 | } | 390 | } |
@@ -408,7 +408,7 @@ test2_bin (void) | |||
408 | MHD_SHA256_update (&ctx, data_units2[i].bin_l.bin, part_s); | 408 | MHD_SHA256_update (&ctx, data_units2[i].bin_l.bin, part_s); |
409 | MHD_SHA256_update (&ctx, data_units2[i].bin_l.bin + part_s, | 409 | MHD_SHA256_update (&ctx, data_units2[i].bin_l.bin + part_s, |
410 | data_units2[i].bin_l.len - part_s); | 410 | data_units2[i].bin_l.len - part_s); |
411 | sha256_finish (&ctx, digest); | 411 | MHD_SHA256_finish (&ctx, digest); |
412 | num_failed += check_result (__FUNCTION__, i, digest, | 412 | num_failed += check_result (__FUNCTION__, i, digest, |
413 | data_units2[i].digest); | 413 | data_units2[i].digest); |
414 | } | 414 | } |