xref: /minix3/crypto/external/bsd/openssl/dist/doc/crypto/BIO_push.pod (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc=pod
2ebfedea0SLionel Sambuc
3ebfedea0SLionel Sambuc=head1 NAME
4ebfedea0SLionel Sambuc
5ebfedea0SLionel SambucBIO_push, BIO_pop - add and remove BIOs from a chain.
6ebfedea0SLionel Sambuc
7ebfedea0SLionel Sambuc=head1 SYNOPSIS
8ebfedea0SLionel Sambuc
9ebfedea0SLionel Sambuc #include <openssl/bio.h>
10ebfedea0SLionel Sambuc
11ebfedea0SLionel Sambuc BIO *	BIO_push(BIO *b,BIO *append);
12ebfedea0SLionel Sambuc BIO *	BIO_pop(BIO *b);
13ebfedea0SLionel Sambuc
14ebfedea0SLionel Sambuc=head1 DESCRIPTION
15ebfedea0SLionel Sambuc
16ebfedea0SLionel SambucThe BIO_push() function appends the BIO B<append> to B<b>, it returns
17ebfedea0SLionel SambucB<b>.
18ebfedea0SLionel Sambuc
19ebfedea0SLionel SambucBIO_pop() removes the BIO B<b> from a chain and returns the next BIO
20ebfedea0SLionel Sambucin the chain, or NULL if there is no next BIO. The removed BIO then
21ebfedea0SLionel Sambucbecomes a single BIO with no association with the original chain,
22ebfedea0SLionel Sambucit can thus be freed or attached to a different chain.
23ebfedea0SLionel Sambuc
24ebfedea0SLionel Sambuc=head1 NOTES
25ebfedea0SLionel Sambuc
26ebfedea0SLionel SambucThe names of these functions are perhaps a little misleading. BIO_push()
27ebfedea0SLionel Sambucjoins two BIO chains whereas BIO_pop() deletes a single BIO from a chain,
28ebfedea0SLionel Sambucthe deleted BIO does not need to be at the end of a chain.
29ebfedea0SLionel Sambuc
30ebfedea0SLionel SambucThe process of calling BIO_push() and BIO_pop() on a BIO may have additional
31ebfedea0SLionel Sambucconsequences (a control call is made to the affected BIOs) any effects will
32ebfedea0SLionel Sambucbe noted in the descriptions of individual BIOs.
33ebfedea0SLionel Sambuc
34ebfedea0SLionel Sambuc=head1 EXAMPLES
35ebfedea0SLionel Sambuc
36ebfedea0SLionel SambucFor these examples suppose B<md1> and B<md2> are digest BIOs, B<b64> is
37ebfedea0SLionel Sambuca base64 BIO and B<f> is a file BIO.
38ebfedea0SLionel Sambuc
39ebfedea0SLionel SambucIf the call:
40ebfedea0SLionel Sambuc
41ebfedea0SLionel Sambuc BIO_push(b64, f);
42ebfedea0SLionel Sambuc
43*0a6a1f1dSLionel Sambucis made then the new chain will be B<b64-f>. After making the calls
44ebfedea0SLionel Sambuc
45ebfedea0SLionel Sambuc BIO_push(md2, b64);
46ebfedea0SLionel Sambuc BIO_push(md1, md2);
47ebfedea0SLionel Sambuc
48ebfedea0SLionel Sambucthe new chain is B<md1-md2-b64-f>. Data written to B<md1> will be digested
49ebfedea0SLionel Sambucby B<md1> and B<md2>, B<base64> encoded and written to B<f>.
50ebfedea0SLionel Sambuc
51ebfedea0SLionel SambucIt should be noted that reading causes data to pass in the reverse
52ebfedea0SLionel Sambucdirection, that is data is read from B<f>, base64 B<decoded> and digested
53ebfedea0SLionel Sambucby B<md1> and B<md2>. If the call:
54ebfedea0SLionel Sambuc
55ebfedea0SLionel Sambuc BIO_pop(md2);
56ebfedea0SLionel Sambuc
57ebfedea0SLionel SambucThe call will return B<b64> and the new chain will be B<md1-b64-f> data can
58ebfedea0SLionel Sambucbe written to B<md1> as before.
59ebfedea0SLionel Sambuc
60ebfedea0SLionel Sambuc=head1 RETURN VALUES
61ebfedea0SLionel Sambuc
62ebfedea0SLionel SambucBIO_push() returns the end of the chain, B<b>.
63ebfedea0SLionel Sambuc
64ebfedea0SLionel SambucBIO_pop() returns the next BIO in the chain, or NULL if there is no next
65ebfedea0SLionel SambucBIO.
66ebfedea0SLionel Sambuc
67ebfedea0SLionel Sambuc=head1 SEE ALSO
68ebfedea0SLionel Sambuc
69ebfedea0SLionel SambucTBA
70