summaryrefslogtreecommitdiffstats
path: root/doc/man3/BIO_f_md.pod
diff options
context:
space:
mode:
authorBeat Bolli <dev@drbeat.li>2016-11-19 00:10:05 +0100
committerMatt Caswell <matt@openssl.org>2017-06-08 11:54:15 +0100
commit2947af32a0ec6666efd5b287ac4609ba3a984f0d (patch)
tree7f024902fa2741965c415283a734267fcd083976 /doc/man3/BIO_f_md.pod
parent52df25cf2e656146cb3b206d8220124f0417d03f (diff)
doc/man3: use the documented coding style in the example code
Adjust brace placement, whitespace after keywords, indentation and empty lines after variable declarations according to https://www.openssl.org/policies/codingstyle.html. Indent literal sections by exactly one space. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1956)
Diffstat (limited to 'doc/man3/BIO_f_md.pod')
-rw-r--r--doc/man3/BIO_f_md.pod26
1 files changed, 14 insertions, 12 deletions
diff --git a/doc/man3/BIO_f_md.pod b/doc/man3/BIO_f_md.pod
index dede0cc84c..3c8d4311ae 100644
--- a/doc/man3/BIO_f_md.pod
+++ b/doc/man3/BIO_f_md.pod
@@ -82,7 +82,8 @@ checking has been omitted for clarity.
bio = BIO_new(BIO_s_null());
mdtmp = BIO_new(BIO_f_md());
BIO_set_md(mdtmp, EVP_sha1());
- /* For BIO_push() we want to append the sink BIO and keep a note of
+ /*
+ * For BIO_push() we want to append the sink BIO and keep a note of
* the start of the chain.
*/
bio = BIO_push(mdtmp, bio);
@@ -105,8 +106,8 @@ The next example digests data by reading through a chain instead:
BIO_set_md(mdtmp, EVP_md5());
bio = BIO_push(mdtmp, bio);
do {
- rdlen = BIO_read(bio, buf, sizeof(buf));
- /* Might want to do something with the data here */
+ rdlen = BIO_read(bio, buf, sizeof(buf));
+ /* Might want to do something with the data here */
} while (rdlen > 0);
This next example retrieves the message digests from a BIO chain and
@@ -118,15 +119,16 @@ outputs them. This could be used with the examples above.
int i;
mdtmp = bio; /* Assume bio has previously been set up */
do {
- EVP_MD *md;
- mdtmp = BIO_find_type(mdtmp, BIO_TYPE_MD);
- if (!mdtmp) break;
- BIO_get_md(mdtmp, &md);
- printf("%s digest", OBJ_nid2sn(EVP_MD_type(md)));
- mdlen = BIO_gets(mdtmp, mdbuf, EVP_MAX_MD_SIZE);
- for (i = 0; i < mdlen; i++) printf(":%02X", mdbuf[i]);
- printf("\n");
- mdtmp = BIO_next(mdtmp);
+ EVP_MD *md;
+ mdtmp = BIO_find_type(mdtmp, BIO_TYPE_MD);
+ if (!mdtmp)
+ break;
+ BIO_get_md(mdtmp, &md);
+ printf("%s digest", OBJ_nid2sn(EVP_MD_type(md)));
+ mdlen = BIO_gets(mdtmp, mdbuf, EVP_MAX_MD_SIZE);
+ for (i = 0; i < mdlen; i++) printf(":%02X", mdbuf[i]);
+ printf("\n");
+ mdtmp = BIO_next(mdtmp);
} while (mdtmp);
BIO_free_all(bio);