summaryrefslogtreecommitdiffstats
path: root/demos/digest
diff options
context:
space:
mode:
authorx2018 <xkernel.wang@foxmail.com>2021-10-26 15:16:18 +0800
committerPauli <pauli@openssl.org>2021-10-28 13:10:46 +1000
commit1287dabd0b23326be491125698dd982e4ae28887 (patch)
tree3d6a62803bdd3d8ca9378eda3e7316a9c995c001 /demos/digest
parent01451721afebabd0b7bdcd4cb3a183c9b590d266 (diff)
fix some code with obvious wrong coding style
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16918)
Diffstat (limited to 'demos/digest')
-rw-r--r--demos/digest/BIO_f_md.c16
-rw-r--r--demos/digest/EVP_MD_stdin.c2
2 files changed, 9 insertions, 9 deletions
diff --git a/demos/digest/BIO_f_md.c b/demos/digest/BIO_f_md.c
index 2ecc53e137..0a1f319f11 100644
--- a/demos/digest/BIO_f_md.c
+++ b/demos/digest/BIO_f_md.c
@@ -47,7 +47,7 @@ int main(int argc, char * argv[])
char *digest_value=NULL;
int j;
- input = BIO_new_fd( fileno(stdin), 1 );
+ input = BIO_new_fd(fileno(stdin), 1);
if (input == NULL) {
fprintf(stderr, "BIO_new_fd() for stdin returned NULL\n");
goto cleanup;
@@ -63,7 +63,7 @@ int main(int argc, char * argv[])
* The algorithm name is case insensitive.
* See providers(7) for details about algorithm fetching
*/
- md = EVP_MD_fetch( library_context, "SHA3-512", NULL );
+ md = EVP_MD_fetch(library_context, "SHA3-512", NULL);
if (md == NULL) {
fprintf(stderr, "EVP_MD_fetch did not find SHA3-512.\n");
goto cleanup;
@@ -81,7 +81,7 @@ int main(int argc, char * argv[])
goto cleanup;
}
/* set our bio_digest BIO to digest data */
- if (BIO_set_md(bio_digest,md) != 1) {
+ if (BIO_set_md(bio_digest, md) != 1) {
fprintf(stderr, "BIO_set_md failed.\n");
goto cleanup;
}
@@ -89,9 +89,9 @@ int main(int argc, char * argv[])
* We will use BIO chaining so that as we read, the digest gets updated
* See the man page for BIO_push
*/
- BIO *reading = BIO_push( bio_digest, input );
-
- while( BIO_read(reading, buffer, sizeof(buffer)) > 0 )
+ BIO *reading = BIO_push(bio_digest, input);
+
+ while (BIO_read(reading, buffer, sizeof(buffer)) > 0)
;
/*-
@@ -102,12 +102,12 @@ int main(int argc, char * argv[])
fprintf(stderr, "BIO_gets(bio_digest) failed\n");
goto cleanup;
}
- for (j=0; j<digest_size; j++) {
+ for (j = 0; j < digest_size; j++) {
fprintf(stdout, "%02x", (unsigned char)digest_value[j]);
}
fprintf(stdout, "\n");
result = 0;
-
+
cleanup:
if (result != 0)
ERR_print_errors_fp(stderr);
diff --git a/demos/digest/EVP_MD_stdin.c b/demos/digest/EVP_MD_stdin.c
index 71a3d325a3..43a820f945 100644
--- a/demos/digest/EVP_MD_stdin.c
+++ b/demos/digest/EVP_MD_stdin.c
@@ -124,7 +124,7 @@ cleanup:
int main(void)
{
int result = 1;
- BIO *input = BIO_new_fd( fileno(stdin), 1 );
+ BIO *input = BIO_new_fd(fileno(stdin), 1);
if (input != NULL) {
result = demonstrate_digest(input);