xref: /openbsd-src/lib/libssl/man/SSL_dup.3 (revision d039934c4e4d1ef7b8b4b168668fd7b1ccea5b89)
1*d039934cSschwarze.\" $OpenBSD: SSL_dup.3,v 1.5 2022/07/13 22:05:53 schwarze Exp $
27e1bdcedSschwarze.\"
37e1bdcedSschwarze.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
47e1bdcedSschwarze.\"
57e1bdcedSschwarze.\" Permission to use, copy, modify, and distribute this software for any
67e1bdcedSschwarze.\" purpose with or without fee is hereby granted, provided that the above
77e1bdcedSschwarze.\" copyright notice and this permission notice appear in all copies.
87e1bdcedSschwarze.\"
97e1bdcedSschwarze.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
107e1bdcedSschwarze.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
117e1bdcedSschwarze.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
127e1bdcedSschwarze.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
137e1bdcedSschwarze.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
147e1bdcedSschwarze.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
157e1bdcedSschwarze.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
167e1bdcedSschwarze.\"
17*d039934cSschwarze.Dd $Mdocdate: July 13 2022 $
187e1bdcedSschwarze.Dt SSL_DUP 3
197e1bdcedSschwarze.Os
207e1bdcedSschwarze.Sh NAME
217e1bdcedSschwarze.Nm SSL_dup
227e1bdcedSschwarze.Nd deep copy of an SSL object
237e1bdcedSschwarze.Sh SYNOPSIS
247e1bdcedSschwarze.In openssl/ssl.h
257e1bdcedSschwarze.Ft SSL *
267e1bdcedSschwarze.Fo SSL_dup
277e1bdcedSschwarze.Fa "SSL *ssl"
287e1bdcedSschwarze.Fc
297e1bdcedSschwarze.Sh DESCRIPTION
307e1bdcedSschwarze.Fn SSL_dup
317e1bdcedSschwarzeconstructs a new
327e1bdcedSschwarze.Vt SSL
337e1bdcedSschwarzeobject in the same context as
347e1bdcedSschwarze.Fa ssl
357e1bdcedSschwarzeand copies much of the contained data from
367e1bdcedSschwarze.Fa ssl
377e1bdcedSschwarzeto the new
387e1bdcedSschwarze.Vt SSL
397e1bdcedSschwarzeobject, but many fields, for example tlsext data, are not copied.
407e1bdcedSschwarze.Pp
417e1bdcedSschwarzeAs an exception from deep copying, if a session is already established,
427e1bdcedSschwarzethe new object shares
437e1bdcedSschwarze.Fa ssl->cert
447e1bdcedSschwarzewith the original object.
457e1bdcedSschwarze.Sh RETURN VALUES
467e1bdcedSschwarze.Fn SSL_dup
477e1bdcedSschwarzereturns the new
487e1bdcedSschwarze.Vt SSL
497e1bdcedSschwarzeobject or
507e1bdcedSschwarze.Dv NULL
517e1bdcedSschwarzeon failure.
527e1bdcedSschwarze.Sh SEE ALSO
537a73e666Sschwarze.Xr ssl 3 ,
547e1bdcedSschwarze.Xr SSL_clear 3 ,
557e1bdcedSschwarze.Xr SSL_copy_session_id 3 ,
567e1bdcedSschwarze.Xr SSL_free 3 ,
57*d039934cSschwarze.Xr SSL_new 3 ,
58*d039934cSschwarze.Xr SSL_set_security_level 3
597e1bdcedSschwarze.Sh HISTORY
607e1bdcedSschwarze.Fn SSL_dup
6110e00d17Sschwarzefirst appeared in SSLeay 0.8.0 and has been available since
628fba1ec8Sschwarze.Ox 2.4 .
63