Mark ASN1_STRFLAGS_* and XN_FLAG_* with the right type

This is not sufficient to get the correct type on these constants,
because bindgen is broken and does not correctly bind constants. But in
preparation for that bug being fixed, we should at least mark the
headers correctly.

Bug: 636
Change-Id: Ib42a2d4f42a84b385dd7bd286564ccfe457923eb
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66227
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
chromium-stable
David Benjamin 9 months ago committed by Boringssl LUCI CQ
parent 8049f26d96
commit 38d17d345c
  1. 20
      include/openssl/asn1.h
  2. 22
      include/openssl/x509.h

@ -1636,18 +1636,18 @@ OPENSSL_EXPORT int ASN1_STRING_print(BIO *out, const ASN1_STRING *str);
// ASN1_STRFLGS_ESC_2253 causes characters to be escaped as in RFC 2253, section
// 2.4.
#define ASN1_STRFLGS_ESC_2253 1
#define ASN1_STRFLGS_ESC_2253 1ul
// ASN1_STRFLGS_ESC_CTRL causes all control characters to be escaped.
#define ASN1_STRFLGS_ESC_CTRL 2
#define ASN1_STRFLGS_ESC_CTRL 2ul
// ASN1_STRFLGS_ESC_MSB causes all characters above 127 to be escaped.
#define ASN1_STRFLGS_ESC_MSB 4
#define ASN1_STRFLGS_ESC_MSB 4ul
// ASN1_STRFLGS_ESC_QUOTE causes the string to be surrounded by quotes, rather
// than using backslashes, when characters are escaped. Fewer characters will
// require escapes in this case.
#define ASN1_STRFLGS_ESC_QUOTE 8
#define ASN1_STRFLGS_ESC_QUOTE 8ul
// ASN1_STRFLGS_UTF8_CONVERT causes the string to be encoded as UTF-8, with each
// byte in the UTF-8 encoding treated as an individual character for purposes of
@ -1655,29 +1655,29 @@ OPENSSL_EXPORT int ASN1_STRING_print(BIO *out, const ASN1_STRING *str);
// as a character, with wide characters escaped as "\Uxxxx" or "\Wxxxxxxxx".
// Note this can be ambiguous if |ASN1_STRFLGS_ESC_*| are all unset. In that
// case, backslashes are not escaped, but wide characters are.
#define ASN1_STRFLGS_UTF8_CONVERT 0x10
#define ASN1_STRFLGS_UTF8_CONVERT 0x10ul
// ASN1_STRFLGS_IGNORE_TYPE causes the string type to be ignored. The
// |ASN1_STRING| in-memory representation will be printed directly.
#define ASN1_STRFLGS_IGNORE_TYPE 0x20
#define ASN1_STRFLGS_IGNORE_TYPE 0x20ul
// ASN1_STRFLGS_SHOW_TYPE causes the string type to be included in the output.
#define ASN1_STRFLGS_SHOW_TYPE 0x40
#define ASN1_STRFLGS_SHOW_TYPE 0x40ul
// ASN1_STRFLGS_DUMP_ALL causes all strings to be printed as a hexdump, using
// RFC 2253 hexstring notation, such as "#0123456789ABCDEF".
#define ASN1_STRFLGS_DUMP_ALL 0x80
#define ASN1_STRFLGS_DUMP_ALL 0x80ul
// ASN1_STRFLGS_DUMP_UNKNOWN behaves like |ASN1_STRFLGS_DUMP_ALL| but only
// applies to values of unknown type. If unset, unknown values will print
// their contents as single-byte characters with escape sequences.
#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100ul
// ASN1_STRFLGS_DUMP_DER causes hexdumped strings (as determined by
// |ASN1_STRFLGS_DUMP_ALL| or |ASN1_STRFLGS_DUMP_UNKNOWN|) to print the entire
// DER element as in RFC 2253, rather than only the contents of the
// |ASN1_STRING|.
#define ASN1_STRFLGS_DUMP_DER 0x200
#define ASN1_STRFLGS_DUMP_DER 0x200ul
// ASN1_STRFLGS_RFC2253 causes the string to be escaped as in RFC 2253,
// additionally escaping control characters.

@ -3187,42 +3187,42 @@ OPENSSL_EXPORT int X509_REQ_print_fp(FILE *fp, X509_REQ *req);
// XN_FLAG_COMPAT prints with |X509_NAME_print|'s format and return value
// convention.
#define XN_FLAG_COMPAT 0
#define XN_FLAG_COMPAT 0ul
// XN_FLAG_SEP_MASK determines the separators to use between attributes.
#define XN_FLAG_SEP_MASK (0xf << 16)
#define XN_FLAG_SEP_MASK (0xful << 16)
// XN_FLAG_SEP_COMMA_PLUS separates RDNs with "," and attributes within an RDN
// with "+", as in RFC 2253.
#define XN_FLAG_SEP_COMMA_PLUS (1 << 16)
#define XN_FLAG_SEP_COMMA_PLUS (1ul << 16)
// XN_FLAG_SEP_CPLUS_SPC behaves like |XN_FLAG_SEP_COMMA_PLUS| but adds spaces
// between the separators.
#define XN_FLAG_SEP_CPLUS_SPC (2 << 16)
#define XN_FLAG_SEP_CPLUS_SPC (2ul << 16)
// XN_FLAG_SEP_SPLUS_SPC separates RDNs with "; " and attributes within an RDN
// with " + ".
#define XN_FLAG_SEP_SPLUS_SPC (3 << 16)
#define XN_FLAG_SEP_SPLUS_SPC (3ul << 16)
// XN_FLAG_SEP_MULTILINE prints each attribute on one line.
#define XN_FLAG_SEP_MULTILINE (4 << 16)
#define XN_FLAG_SEP_MULTILINE (4ul << 16)
// XN_FLAG_DN_REV prints RDNs in reverse, from least significant to most
// significant, as RFC 2253.
#define XN_FLAG_DN_REV (1 << 20)
#define XN_FLAG_DN_REV (1ul << 20)
// XN_FLAG_FN_MASK determines how attribute types are displayed.
#define XN_FLAG_FN_MASK (0x3 << 21)
#define XN_FLAG_FN_MASK (0x3ul << 21)
// XN_FLAG_FN_SN uses the attribute type's short name, when available.
#define XN_FLAG_FN_SN 0
#define XN_FLAG_FN_SN 0ul
// XN_FLAG_SPC_EQ wraps the "=" operator with spaces when printing attributes.
#define XN_FLAG_SPC_EQ (1 << 23)
#define XN_FLAG_SPC_EQ (1ul << 23)
// XN_FLAG_DUMP_UNKNOWN_FIELDS causes unknown attribute types to be printed in
// hex, as in RFC 2253.
#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1ul << 24)
// XN_FLAG_RFC2253 prints like RFC 2253.
#define XN_FLAG_RFC2253 \

Loading…
Cancel
Save