Go to the documentation of this file.
67 #include "../internal.h"
68 #include "../x509v3/internal.h"
76 #define ASN1_GEN_FLAG 0x10000
77 #define ASN1_GEN_FLAG_IMP (ASN1_GEN_FLAG|1)
78 #define ASN1_GEN_FLAG_EXP (ASN1_GEN_FLAG|2)
79 #define ASN1_GEN_FLAG_TAG (ASN1_GEN_FLAG|3)
80 #define ASN1_GEN_FLAG_BITWRAP (ASN1_GEN_FLAG|4)
81 #define ASN1_GEN_FLAG_OCTWRAP (ASN1_GEN_FLAG|5)
82 #define ASN1_GEN_FLAG_SEQWRAP (ASN1_GEN_FLAG|6)
83 #define ASN1_GEN_FLAG_SETWRAP (ASN1_GEN_FLAG|7)
84 #define ASN1_GEN_FLAG_FORMAT (ASN1_GEN_FLAG|8)
86 #define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val}
88 #define ASN1_FLAG_EXP_MAX 20
90 #define ASN1_GEN_SEQ_MAX_DEPTH 50
95 #define ASN1_GEN_FORMAT_ASCII 1
97 #define ASN1_GEN_FORMAT_UTF8 2
99 #define ASN1_GEN_FORMAT_HEX 3
101 #define ASN1_GEN_FORMAT_BITLIST 4
132 int exp_constructed,
int exp_pad,
int imp_ok);
133 static int parse_tagging(
const char *vstart,
int vlen,
int *ptag,
136 int depth,
int *perr);
158 unsigned char *orig_der = NULL, *new_der = NULL;
159 const unsigned char *cpy_start;
161 const unsigned char *cp;
164 int hdr_constructed = 0, hdr_tag, hdr_class;
202 cpy_start = orig_der;
213 cpy_len -= cpy_start - orig_der;
293 const char *
p, *vstart = NULL;
295 int tmp_tag, tmp_class;
334 if (
arg->imp_tag != -1) {
375 if (!strncmp(vstart,
"ASCII", 5))
377 else if (!strncmp(vstart,
"UTF8", 4))
379 else if (!strncmp(vstart,
"HEX", 3))
381 else if (!strncmp(vstart,
"BITLIST", 7))
395 static int parse_tagging(
const char *vstart,
int vlen,
int *ptag,
int *pclass)
402 tag_num = strtoul(vstart, &eptr, 10);
404 if (eptr && *eptr && (eptr > vstart + vlen))
413 vlen -= eptr - vstart;
454 int depth,
int *perr)
459 unsigned char *der = NULL;
462 sk = sk_ASN1_TYPE_new_null();
471 for (
i = 0;
i < sk_CONF_VALUE_num(sect);
i++) {
477 if (!sk_ASN1_TYPE_push(sk, typ))
502 ret->value.asn1_string->data = der;
503 ret->value.asn1_string->length = derlen;
521 int exp_constructed,
int exp_pad,
int imp_ok)
525 if ((
arg->imp_tag != -1) && !imp_ok) {
535 exp_tmp = &
arg->exp_list[
arg->exp_count++];
541 if (
arg->imp_tag != -1) {
621 len = strlen(tagstr);
624 for (
i = 0;
i <
sizeof(tnst) /
sizeof(
struct tag_name_st);
i++, tntmp++) {
638 unsigned char *rdata;
814 bitnum = strtoul(
elem, &eptr, 10);
815 if (eptr && *eptr && (eptr !=
elem +
len))
ASN1_STRING * asn1_string
#define ASN1_GEN_FLAG_OCTWRAP
static ASN1_TYPE * generate_v3(const char *str, X509V3_CTX *cnf, int depth, int *perr)
OPENSSL_EXPORT int i2d_ASN1_TYPE(const ASN1_TYPE *in, uint8_t **outp)
#define ASN1_R_INVALID_MODIFIER
#define ASN1_GEN_FLAG_BITWRAP
#define V_ASN1_PRINTABLESTRING
#define ASN1_R_ILLEGAL_OBJECT
#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG
#define OPENSSL_PUT_ERROR(library, reason)
#define x509v3_hex_to_bytes
#define ASN1_STRING_type_new
#define ASN1_R_ILLEGAL_IMPLICIT_TAG
#define V_ASN1_UTF8STRING
#define X509V3_get_section
#define V_ASN1_OCTET_STRING
#define ASN1_R_INTEGER_NOT_ASCII_FORMAT
static int asn1_cb(const char *elem, int len, void *bitstr)
#define ASN1_R_INVALID_NUMBER
#define ASN1_GEN_FORMAT_UTF8
#define ASN1_BIT_STRING_set_bit
#define ASN1_GEN_FLAG_FORMAT
#define ASN1_R_ILLEGAL_BOOLEAN
#define ASN1_R_MISSING_VALUE
#define ASN1_R_UNKNOWN_TAG
#define V_ASN1_GENERALSTRING
#define ASN1_R_TIME_NOT_ASCII_FORMAT
#define V_ASN1_GENERALIZEDTIME
#define ASN1_R_UNKNOWN_FORMAT
#define ASN1_GEN_FORMAT_BITLIST
#define ASN1_GEN_STR(str, val)
ASN1_BIT_STRING * bit_string
#define ASN1_FLAG_EXP_MAX
#define V_ASN1_ENUMERATED
#define ASN1_R_UNSUPPORTED_TYPE
static int asn1_str2tag(const char *tagstr, int len)
static int bitstr_cb(const char *elem, int len, void *bitstr)
OPENSSL_EXPORT void ASN1_TYPE_free(ASN1_TYPE *a)
#define ASN1_GEN_FLAG_EXP
#define V_ASN1_VISIBLESTRING
#define X509V3_section_free
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
#define ASN1_R_ILLEGAL_TIME_VALUE
#define ASN1_R_ILLEGAL_NULL_VALUE
#define V_ASN1_NUMERICSTRING
OPENSSL_EXPORT ASN1_TYPE * d2i_ASN1_TYPE(ASN1_TYPE **out, const uint8_t **inp, long len)
ASN1_TYPE * ASN1_generate_v3(const char *str, X509V3_CTX *cnf)
#define ASN1_STRING_FLAG_BITS_LEFT
#define ASN1_mbstring_copy
#define V_ASN1_BIT_STRING
#define ASN1_R_ILLEGAL_INTEGER
#define V_ASN1_APPLICATION
#define ASN1_R_OBJECT_NOT_ASCII_FORMAT
#define V_ASN1_CONSTRUCTED
#define ASN1_GEN_FLAG_IMP
static ASN1_TYPE * asn1_str2type(const char *str, int format, int utype)
#define ASN1_GEN_FORMAT_ASCII
#define ASN1_R_ILLEGAL_FORMAT
#define ASN1_GEN_SEQ_MAX_DEPTH
#define ASN1_R_LIST_ERROR
UniquePtr< SSL_SESSION > ret
#define ERR_add_error_data
#define V_ASN1_CONTEXT_SPECIFIC
OPENSSL_EXPORT ASN1_TYPE * ASN1_TYPE_new(void)
#define X509V3_get_value_bool
#define ASN1_R_ILLEGAL_BITSTRING_FORMAT
union asn1_type_st::@361 value
OPENSSL_EXPORT int i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *in, uint8_t **outp)
static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class, int exp_constructed, int exp_pad, int imp_ok)
#define ASN1_GEN_FLAG_SEQWRAP
#define ASN1_R_ILLEGAL_NESTED_TAGGING
static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
#define ASN1_R_DEPTH_EXCEEDED
tag_exp_type exp_list[ASN1_FLAG_EXP_MAX]
#define ASN1_GEN_FLAG_SETWRAP
#define ASN1_R_ILLEGAL_HEX
#define V_ASN1_UNIVERSALSTRING
static ASN1_TYPE * asn1_multi(int utype, const char *section, X509V3_CTX *cnf, int depth, int *perr)
#define ASN1_R_NOT_ASCII_FORMAT
#define ERR_R_MALLOC_FAILURE
OPENSSL_EXPORT int i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *in, uint8_t **outp)
#define ASN1_GEN_FORMAT_HEX
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:44