-.\" $OpenBSD: ASN1_STRING_length.3,v 1.7 2018/02/12 15:45:12 schwarze Exp $
-.\" full merge up to: OpenSSL 99d63d46 Tue Jun 21 07:03:34 2016 -0400
-.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
+.\" $OpenBSD: ASN1_STRING_length.3,v 1.8 2018/02/15 00:15:29 schwarze Exp $
+.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" This file is a derived work.
.\" The changes are covered by the following Copyright and license:
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 12 2018 $
+.Dd $Mdocdate: February 15 2018 $
.Dt ASN1_STRING_LENGTH 3
.Os
.Sh NAME
.Nm ASN1_STRING_cmp ,
.Nm ASN1_STRING_data ,
.Nm ASN1_STRING_dup ,
+.Nm ASN1_STRING_get0_data ,
.Nm ASN1_STRING_length ,
.Nm ASN1_STRING_length_set ,
.Nm ASN1_STRING_set ,
.Fo ASN1_STRING_dup
.Fa "ASN1_STRING *a"
.Fc
+.Ft const unsigned char *
+.Fo ASN1_STRING_get0_data
+.Fa "const ASN1_STRING *x"
+.Fc
.Ft int
.Fo ASN1_STRING_length
.Fa "ASN1_STRING *x"
.Fa b .
.Pp
.Fn ASN1_STRING_data
-returns an internal pointer to the data of
-.Fa x .
-It should not be freed or modified in any way.
+is similar to
+.Fn ASN1_STRING_get0_data
+except that the returned value is not constant.
+This function is deprecated.
+Applications should use
+.Fn ASN1_STRING_get0_data
+instead.
.Pp
.Fn ASN1_STRING_dup
copies
.Fa a .
.Pp
+.Fn ASN1_STRING_get0_data
+returns an internal pointer to the data of
+.Fa x .
+It should not be freed or modified in any way.
+.Pp
.Fn ASN1_STRING_length
returns the length attribute of
.Fa x ,
be used instead.
.Pp
In general it cannot be assumed that the data returned by
+.Fn ASN1_STRING_get0_data
+and
.Fn ASN1_STRING_data
is NUL terminated, and it may contain embedded NUL characters.
The format of the data depends on the string type:
the sign of the return value does not indicate lexicographical ordering.
.Pp
.Fn ASN1_STRING_data
-returns an internal pointer to the data of
+and
+.Fn ASN1_STRING_get0_data
+return an internal pointer to the data of
.Fa x .
.Pp
.Fn ASN1_STRING_dup