-.\" $OpenBSD: X509_REQ_new.3,v 1.6 2019/06/06 01:06:59 schwarze Exp $
+.\" $OpenBSD: X509_REQ_new.3,v 1.7 2021/10/26 10:50:08 schwarze Exp $
.\"
-.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 6 2019 $
+.Dd $Mdocdate: October 26 2021 $
.Dt X509_REQ_NEW 3
.Os
.Sh NAME
.Nm X509_REQ_new ,
+.Nm X509_REQ_dup ,
.Nm X509_REQ_free ,
.Nm X509_REQ_INFO_new ,
.Nm X509_REQ_INFO_free
.In openssl/x509.h
.Ft X509_REQ *
.Fn X509_REQ_new void
+.Ft X509_REQ *
+.Fn X509_REQ_dup "X509_REQ *req"
.Ft void
.Fn X509_REQ_free "X509_REQ *req"
.Ft X509_REQ_INFO *
.Vt X509_REQ_INFO
object discussed below together with a cryptographic signature and
information about the signature algorithm used.
+.Pp
+.Fn X509_REQ_dup
+creates a deep copy of
+.Fa req
+using
+.Xr ASN1_item_dup 3 ,
+setting the reference count of the copy to 1.
+.Pp
.Fn X509_REQ_free
frees
.Fa req .
.Dv NULL
pointer, no action occurs.
.Sh RETURN VALUES
-.Fn X509_REQ_new
+.Fn X509_REQ_new ,
+.Fn X509_REQ_dup ,
and
.Fn X509_REQ_INFO_new
return the new
.Fn X509_REQ_INFO_new ,
and
.Fn X509_REQ_INFO_free
-first appeared in SSLeay 0.4.4 and have been available since
+first appeared in SSLeay 0.4.4 and
+.Fn X509_REQ_dup
+in SSLeay 0.5.1.
+These functions have been available since
.Ox 2.4 .