diff options
Diffstat (limited to 'src/lib/libssl/doc/d2i_SSL_SESSION.3')
-rw-r--r-- | src/lib/libssl/doc/d2i_SSL_SESSION.3 | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/src/lib/libssl/doc/d2i_SSL_SESSION.3 b/src/lib/libssl/doc/d2i_SSL_SESSION.3 deleted file mode 100644 index ef8a36de79..0000000000 --- a/src/lib/libssl/doc/d2i_SSL_SESSION.3 +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | .\" | ||
2 | .\" $OpenBSD: d2i_SSL_SESSION.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
3 | .\" | ||
4 | .Dd $Mdocdate: December 2 2014 $ | ||
5 | .Dt D2I_SSL_SESSION 3 | ||
6 | .Os | ||
7 | .Sh NAME | ||
8 | .Nm d2i_SSL_SESSION , | ||
9 | .Nm i2d_SSL_SESSION | ||
10 | .Nd convert SSL_SESSION object from/to ASN1 representation | ||
11 | .Sh SYNOPSIS | ||
12 | .In openssl/ssl.h | ||
13 | .Ft SSL_SESSION * | ||
14 | .Fn d2i_SSL_SESSION "SSL_SESSION **a" "const unsigned char **pp" "long length" | ||
15 | .Ft int | ||
16 | .Fn i2d_SSL_SESSION "SSL_SESSION *in" "unsigned char **pp" | ||
17 | .Sh DESCRIPTION | ||
18 | .Fn d2i_SSL_SESSION | ||
19 | transforms the external ASN1 representation of an SSL/TLS session, | ||
20 | stored as binary data at location | ||
21 | .Fa pp | ||
22 | with length | ||
23 | .Fa length , | ||
24 | into | ||
25 | an | ||
26 | .Vt SSL_SESSION | ||
27 | object. | ||
28 | .Pp | ||
29 | .Fn i2d_SSL_SESSION | ||
30 | transforms the | ||
31 | .Vt SSL_SESSION | ||
32 | object | ||
33 | .Fa in | ||
34 | into the ASN1 representation and stores it into the memory location pointed to | ||
35 | by | ||
36 | .Fa pp . | ||
37 | The length of the resulting ASN1 representation is returned. | ||
38 | If | ||
39 | .Fa pp | ||
40 | is the | ||
41 | .Dv NULL | ||
42 | pointer, only the length is calculated and returned. | ||
43 | .Sh NOTES | ||
44 | The | ||
45 | .Vt SSL_SESSION | ||
46 | object is built from several | ||
47 | .Xr malloc 3 Ns | ||
48 | -ed parts; it can therefore not be moved, copied or stored directly. | ||
49 | In order to store session data on disk or into a database, | ||
50 | it must be transformed into a binary ASN1 representation. | ||
51 | .Pp | ||
52 | When using | ||
53 | .Fn d2i_SSL_SESSION , | ||
54 | the | ||
55 | .Vt SSL_SESSION | ||
56 | object is automatically allocated. | ||
57 | The reference count is 1, so that the session must be explicitly removed using | ||
58 | .Xr SSL_SESSION_free 3 , | ||
59 | unless the | ||
60 | .Vt SSL_SESSION | ||
61 | object is completely taken over, when being called inside the | ||
62 | .Xr get_session_cb 3 | ||
63 | (see | ||
64 | .Xr SSL_CTX_sess_set_get_cb 3 ) . | ||
65 | .Pp | ||
66 | .Vt SSL_SESSION | ||
67 | objects keep internal link information about the session cache list when being | ||
68 | inserted into one | ||
69 | .Vt SSL_CTX | ||
70 | object's session cache. | ||
71 | One | ||
72 | .Vt SSL_SESSION | ||
73 | object, regardless of its reference count, must therefore only be used with one | ||
74 | .Vt SSL_CTX | ||
75 | object (and the | ||
76 | .Vt SSL | ||
77 | objects created from this | ||
78 | .Vt SSL_CTX | ||
79 | object). | ||
80 | .Pp | ||
81 | When using | ||
82 | .Fn i2d_SSL_SESSION , | ||
83 | the memory location pointed to by | ||
84 | .Fa pp | ||
85 | must be large enough to hold the binary representation of the session. | ||
86 | There is no known limit on the size of the created ASN1 representation, | ||
87 | so the necessary amount of space should be obtained by first calling | ||
88 | .Fn i2d_SSL_SESSION | ||
89 | with | ||
90 | .Fa pp Ns | ||
91 | = Ns | ||
92 | .Dv NULL , | ||
93 | and obtain the size needed, then allocate the memory and call | ||
94 | .Fn i2d_SSL_SESSION | ||
95 | again. | ||
96 | Note that this will advance the value contained in | ||
97 | .Fa *pp | ||
98 | so it is necessary to save a copy of the original allocation. | ||
99 | For example: | ||
100 | .Bd -literal | ||
101 | int i, j; | ||
102 | |||
103 | char *p, *temp; | ||
104 | |||
105 | i = i2d_SSL_SESSION(sess, NULL); | ||
106 | p = temp = malloc(i); | ||
107 | if (temp != NULL) { | ||
108 | j = i2d_SSL_SESSION(sess, &temp); | ||
109 | assert(i == j); | ||
110 | assert(p + i == temp); | ||
111 | } | ||
112 | .Ed | ||
113 | .Sh RETURN VALUES | ||
114 | .Fn d2i_SSL_SESSION | ||
115 | returns a pointer to the newly allocated | ||
116 | .Vt SSL_SESSION | ||
117 | object. | ||
118 | In case of failure a | ||
119 | .Dv NULL | ||
120 | pointer is returned and the error message can be retrieved from the error | ||
121 | stack. | ||
122 | .Pp | ||
123 | .Fn i2d_SSL_SESSION | ||
124 | returns the size of the ASN1 representation in bytes. | ||
125 | When the session is not valid, 0 is returned and no operation is performed. | ||
126 | .Sh SEE ALSO | ||
127 | .Xr ssl 3 , | ||
128 | .Xr SSL_CTX_sess_set_get_cb 3 , | ||
129 | .Xr SSL_SESSION_free 3 | ||