1BIO_push(3) OpenSSL BIO_push(3)
2
3
4
6 BIO_push, BIO_pop - add and remove BIOs from a chain.
7
9 #include <openssl/bio.h>
10
11 BIO * BIO_push(BIO *b,BIO *append);
12 BIO * BIO_pop(BIO *b);
13
15 The BIO_push() function appends the BIO append to b, it returns b.
16
17 BIO_pop() removes the BIO b from a chain and returns the next BIO in
18 the chain, or NULL if there is no next BIO. The removed BIO then
19 becomes a single BIO with no association with the original chain, it
20 can thus be freed or attached to a different chain.
21
23 The names of these functions are perhaps a little misleading.
24 BIO_push() joins two BIO chains whereas BIO_pop() deletes a single BIO
25 from a chain, the deleted BIO does not need to be at the end of a
26 chain.
27
28 The process of calling BIO_push() and BIO_pop() on a BIO may have
29 additional consequences (a control call is made to the affected BIOs)
30 any effects will be noted in the descriptions of individual BIOs.
31
33 For these examples suppose md1 and md2 are digest BIOs, b64 is a base64
34 BIO and f is a file BIO.
35
36 If the call:
37
38 BIO_push(b64, f);
39
40 is made then the new chain will be b64-f. After making the calls
41
42 BIO_push(md2, b64);
43 BIO_push(md1, md2);
44
45 the new chain is md1-md2-b64-f. Data written to md1 will be digested by
46 md1 and md2, base64 encoded and written to f.
47
48 It should be noted that reading causes data to pass in the reverse
49 direction, that is data is read from f, base64 decoded and digested by
50 md1 and md2. If the call:
51
52 BIO_pop(md2);
53
54 The call will return b64 and the new chain will be md1-b64-f data can
55 be written to md1 as before.
56
58 BIO_push() returns the end of the chain, b.
59
60 BIO_pop() returns the next BIO in the chain, or NULL if there is no
61 next BIO.
62
64 TBA
65
66
67
681.0.2k 2017-01-26 BIO_push(3)