summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2018-08-27 15:42:39 +0000
committerjsing <>2018-08-27 15:42:39 +0000
commitefb4b7d294563bb79e9a64739754b78928308802 (patch)
treea97408710115a9034fea0ec1c9b9df7996f094f9 /src
parentca38cb83a45306d2c43cf255009ccdddf2edf4b9 (diff)
downloadopenbsd-efb4b7d294563bb79e9a64739754b78928308802.tar.gz
openbsd-efb4b7d294563bb79e9a64739754b78928308802.tar.bz2
openbsd-efb4b7d294563bb79e9a64739754b78928308802.zip
Fix formatting and grammatical issues with the description of how to use
i2d_SSL_SESSION. Also rework the example code so that it is clearer and uses more appropriate names. Input from and ok schwarze@, tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/man/d2i_SSL_SESSION.336
1 files changed, 17 insertions, 19 deletions
diff --git a/src/lib/libssl/man/d2i_SSL_SESSION.3 b/src/lib/libssl/man/d2i_SSL_SESSION.3
index 64f84e6052..9c5c2285fa 100644
--- a/src/lib/libssl/man/d2i_SSL_SESSION.3
+++ b/src/lib/libssl/man/d2i_SSL_SESSION.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: d2i_SSL_SESSION.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $ 1.\" $OpenBSD: d2i_SSL_SESSION.3,v 1.6 2018/08/27 15:42:39 jsing Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" 3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: March 27 2018 $ 51.Dd $Mdocdate: August 27 2018 $
52.Dt D2I_SSL_SESSION 3 52.Dt D2I_SSL_SESSION 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -131,31 +131,29 @@ the memory location pointed to by
131.Fa pp 131.Fa pp
132must be large enough to hold the binary representation of the session. 132must be large enough to hold the binary representation of the session.
133There is no known limit on the size of the created ASN1 representation, 133There is no known limit on the size of the created ASN1 representation,
134so the necessary amount of space should be obtained by first calling 134so call
135.Fn i2d_SSL_SESSION 135.Fn i2d_SSL_SESSION
136with 136first with
137.Fa pp Ns 137.Fa pp Ns = Ns Dv NULL
138= Ns 138to obtain the encoded size, before allocating the required amount of memory and
139.Dv NULL , 139calling
140and obtain the size needed, then allocate the memory and call
141.Fn i2d_SSL_SESSION 140.Fn i2d_SSL_SESSION
142again. 141again.
143Note that this will advance the value contained in 142Note that this will advance the value contained in
144.Fa *pp 143.Fa *pp
145so it is necessary to save a copy of the original allocation. 144so it is necessary to save a copy of the original allocation.
146For example: 145For example:
147.Bd -literal 146.Bd -literal -offset indent
148int i, j; 147char *p, *pp;
148int elen, len;
149 149
150char *p, *temp; 150elen = i2d_SSL_SESSION(sess, NULL);
151 151p = pp = malloc(elen);
152 i = i2d_SSL_SESSION(sess, NULL); 152if (p != NULL) {
153 p = temp = malloc(i); 153 len = i2d_SSL_SESSION(sess, &pp);
154 if (temp != NULL) { 154 assert(elen == len);
155 j = i2d_SSL_SESSION(sess, &temp); 155 assert(p + len == pp);
156 assert(i == j); 156}
157 assert(p + i == temp);
158 }
159.Ed 157.Ed
160.Sh RETURN VALUES 158.Sh RETURN VALUES
161.Fn d2i_SSL_SESSION 159.Fn d2i_SSL_SESSION