aboutsummaryrefslogtreecommitdiffstats
path: root/demos/digest/BIO_f_md.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/digest/BIO_f_md.c')
-rw-r--r--demos/digest/BIO_f_md.c16
1 files changed, 8 insertions, 8 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);