-.\" $OpenBSD: ASN1_STRING_length.3,v 1.27 2021/11/20 11:49:08 schwarze Exp $
+.\" $OpenBSD: ASN1_STRING_length.3,v 1.28 2021/12/09 18:45:45 schwarze Exp $
.\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
.\"
.\" This file is a derived work.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: November 20 2021 $
+.Dd $Mdocdate: December 9 2021 $
.Dt ASN1_STRING_LENGTH 3
.Os
.Sh NAME
.Fn ASN1_STRING_type
returns the type of
.Fa x .
+If the bit
+.Dv V_ASN1_NEG
+is set in the return value,
+.Fa x
+is an ASN.1 INTEGER or ENUMERATED object with a negative value.
.Pp
Almost all ASN.1 types are represented as
.Vt ASN1_STRING
.Pp
.Fn ASN1_STRING_type
returns an integer constant, for example
-.Dv V_ASN1_OCTET_STRING .
+.Dv V_ASN1_OCTET_STRING
+or
+.Dv V_ASN1_NEG_INTEGER .
.Pp
In some cases of failure of
.Fn ASN1_STRING_dup ,