diff options
Diffstat (limited to 'src/lib/libcrypto/man/BIO_push.3')
-rw-r--r-- | src/lib/libcrypto/man/BIO_push.3 | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BIO_push.3 b/src/lib/libcrypto/man/BIO_push.3 new file mode 100644 index 0000000000..848a09ba53 --- /dev/null +++ b/src/lib/libcrypto/man/BIO_push.3 | |||
@@ -0,0 +1,117 @@ | |||
1 | .Dd $Mdocdate: February 16 2015 $ | ||
2 | .Dt BIO_PUSH 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BIO_push , | ||
6 | .Nm BIO_pop | ||
7 | .Nd add and remove BIOs from a chain | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/bio.h | ||
10 | .Ft BIO * | ||
11 | .Fo BIO_push | ||
12 | .Fa "BIO *b" | ||
13 | .Fa "BIO *append" | ||
14 | .Fc | ||
15 | .Ft BIO * | ||
16 | .Fo BIO_pop | ||
17 | .Fa "BIO *b" | ||
18 | .Fc | ||
19 | .Sh DESCRIPTION | ||
20 | The | ||
21 | .Fn BIO_push | ||
22 | function appends the BIO | ||
23 | .Fa append | ||
24 | to | ||
25 | .Fa b | ||
26 | and returns | ||
27 | .Fa b . | ||
28 | .Pp | ||
29 | .Fn BIO_pop | ||
30 | removes the BIO | ||
31 | .Fa b | ||
32 | from a chain and returns the next BIO in the chain, or | ||
33 | .Dv NULL | ||
34 | if there is no next BIO. | ||
35 | The removed BIO then becomes a single BIO with no association with the | ||
36 | original chain, it can thus be freed or attached to a different chain. | ||
37 | .Sh RETURN VALUES | ||
38 | .Fn BIO_push | ||
39 | returns the beginning of the chain, | ||
40 | .Fa b . | ||
41 | .Pp | ||
42 | .Fn BIO_pop | ||
43 | returns the next BIO in the chain, or | ||
44 | .Dv NULL | ||
45 | if there is no next BIO. | ||
46 | .Sh NOTES | ||
47 | The names of these functions are perhaps a little misleading. | ||
48 | .Fn BIO_push | ||
49 | joins two BIO chains whereas | ||
50 | .Fn BIO_pop | ||
51 | deletes a single BIO from a chain, | ||
52 | the deleted BIO does not need to be at the end of a chain. | ||
53 | .Pp | ||
54 | The process of calling | ||
55 | .Fn BIO_push | ||
56 | and | ||
57 | .Fn BIO_pop | ||
58 | on a BIO may have additional consequences: | ||
59 | a control call is made to the affected BIOs. | ||
60 | Any effects will be noted in the descriptions of individual BIOs. | ||
61 | .Sh EXAMPLES | ||
62 | For these examples suppose | ||
63 | .Sy md1 | ||
64 | and | ||
65 | .Sy md2 | ||
66 | are digest BIOs, | ||
67 | .Sy b64 | ||
68 | is a base64 BIO and | ||
69 | .Sy f | ||
70 | is a file BIO. | ||
71 | .Pp | ||
72 | If the call | ||
73 | .Pp | ||
74 | .Dl BIO_push(b64, f); | ||
75 | .Pp | ||
76 | is made then the new chain will be | ||
77 | .Sy b64-f . | ||
78 | After making the calls | ||
79 | .Bd -literal -offset indent | ||
80 | BIO_push(md2, b64); | ||
81 | BIO_push(md1, md2); | ||
82 | .Ed | ||
83 | .Pp | ||
84 | the new chain is | ||
85 | .Sy md1-md2-b64-f . | ||
86 | Data written to | ||
87 | .Sy md1 | ||
88 | will be digested | ||
89 | by | ||
90 | .Sy md1 | ||
91 | and | ||
92 | .Sy md2 , | ||
93 | .Sy base64 | ||
94 | encoded and written to | ||
95 | .Sy f . | ||
96 | .Pp | ||
97 | It should be noted that reading causes data to pass | ||
98 | in the reverse direction, that is data is read from | ||
99 | .Sy f , | ||
100 | base64 | ||
101 | .Sy decoded | ||
102 | and digested | ||
103 | by | ||
104 | .Sy md1 | ||
105 | and | ||
106 | .Sy md2 . | ||
107 | If this call is made: | ||
108 | .Pp | ||
109 | .Dl BIO_pop(md2); | ||
110 | .Pp | ||
111 | The call will return | ||
112 | .Sy b64 | ||
113 | and the new chain will be | ||
114 | .Sy md1-b64-f Ns ; | ||
115 | data can be written to | ||
116 | .Sy md1 | ||
117 | as before. | ||