import libssl (LibreSSL 2.5.4)
[unleashed.git] / lib / libssl / man / SSL_dup.3
blob47ec2e3976e42f51bd3b099256fc5e16c47e97c2
1 .\"     $OpenBSD: SSL_dup.3,v 1.1 2016/12/07 17:09:07 schwarze Exp $
2 .\"
3 .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate: December 7 2016 $
18 .Dt SSL_DUP 3
19 .Os
20 .Sh NAME
21 .Nm SSL_dup
22 .Nd deep copy of an SSL object
23 .Sh SYNOPSIS
24 .In openssl/ssl.h
25 .Ft SSL *
26 .Fo SSL_dup
27 .Fa "SSL *ssl"
28 .Fc
29 .Sh DESCRIPTION
30 .Fn SSL_dup
31 constructs a new
32 .Vt SSL
33 object in the same context as
34 .Fa ssl
35 and copies much of the contained data from
36 .Fa ssl
37 to the new
38 .Vt SSL
39 object, but many fields, for example tlsext data, are not copied.
40 .Pp
41 As an exception from deep copying, if a session is already established,
42 the new object shares
43 .Fa ssl->cert
44 with the original object.
45 .Sh RETURN VALUES
46 .Fn SSL_dup
47 returns the new
48 .Vt SSL
49 object or
50 .Dv NULL
51 on failure.
52 .Sh SEE ALSO
53 .Xr SSL_clear 3 ,
54 .Xr SSL_copy_session_id 3 ,
55 .Xr SSL_free 3 ,
56 .Xr SSL_new 3
57 .Sh HISTORY
58 .Fn SSL_dup
59 is available in all versions of OpenSSL.