Go to the documentation of this file.
66 #include "../internal.h"
79 int skcontlen,
const ASN1_ITEM *item,
int do_sort);
90 unsigned char *
p, *
buf;
133 int i, seqcontlen, seqlen;
139 assert(
tag != -1 || aclass == 0);
184 if (i < 0 || i >=
it->tcount) {
227 for (
i = 0, tt =
it->templates; i < it->tcount; tt++,
i++) {
236 if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
238 seqcontlen += tmplen;
242 if (!
out || seqlen == -1)
246 for (
i = 0, tt =
it->templates; i < it->tcount; tt++,
i++) {
281 assert(
tag != -1 || iclass == 0);
297 }
else if (
tag != -1) {
316 int isset, sktag, skaclass;
317 int skcontlen, sklen;
354 for (j = 0; j < sk_ASN1_VALUE_num(sk); j++) {
356 skitem = sk_ASN1_VALUE_value(sk, j);
359 if (tmplen == -1 || (skcontlen > INT_MAX - tmplen))
411 ttag, tclass, optional);
439 int skcontlen,
const ASN1_ITEM *item,
int do_sort)
442 if (!do_sort || sk_ASN1_VALUE_num(sk) < 2) {
443 for (
size_t i = 0;
i < sk_ASN1_VALUE_num(sk);
i++) {
452 if (sk_ASN1_VALUE_num(sk) > ((
size_t)-1) /
sizeof(
DER_ENC)) {
460 if (encoded == NULL ||
buf == NULL) {
466 unsigned char *
p =
buf;
467 for (
size_t i = 0;
i < sk_ASN1_VALUE_num(sk);
i++) {
474 assert(
p -
buf <= skcontlen);
477 qsort(encoded, sk_ASN1_VALUE_num(sk),
sizeof(*encoded),
der_cmp);
481 for (
size_t i = 0;
i < sk_ASN1_VALUE_num(sk);
i++) {
503 int utype =
it->utype;
571 const unsigned char *cont;
577 assert(
it->funcs == NULL);
593 utype = strtmp->
type;
656 if ((*tbool && (
it->size > 0)) ||
657 (!*tbool && !
it->size)) {
662 c = *tbool ? 0xff : 0x00;
669 cout ? &cout : NULL);
671 return ret <= 0 ? -1 :
ret;
679 return ret <= 0 ? -1 :
ret;
#define ASN1_ITYPE_CHOICE
#define ASN1_TFLG_TAG_CLASS
#define ASN1_R_NO_MATCHING_CHOICE_TYPE
#define ASN1_TFLG_SK_MASK
int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass)
static int OPENSSL_memcmp(const void *s1, const void *s2, size_t n)
#define V_ASN1_NEG_ENUMERATED
#define V_ASN1_GRAPHICSTRING
static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *out_omit, int *putype, const ASN1_ITEM *it)
#define ASN1_R_WRONG_TYPE
#define V_ASN1_PRINTABLESTRING
#define ASN1_R_ILLEGAL_OBJECT
#define OPENSSL_PUT_ERROR(library, reason)
#define V_ASN1_UTF8STRING
#define V_ASN1_OCTET_STRING
#define V_ASN1_VIDEOTEXSTRING
#define ASN1_ITYPE_SEQUENCE
#define ASN1_ITEM_ptr(iptr)
#define ASN1_R_MISSING_VALUE
#define V_ASN1_GENERALSTRING
int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
#define V_ASN1_GENERALIZEDTIME
#define ASN1_TFLG_SEQUENCE_OF
ASN1_ex_i2d * asn1_ex_i2d
static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt, int tag, int aclass)
#define asn1_get_field_ptr
#define ASN1_TFLG_OPTIONAL
#define V_ASN1_ENUMERATED
static void * tag(intptr_t t)
static int asn1_item_ex_i2d_opt(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass, int optional)
#define V_ASN1_VISIBLESTRING
const unsigned char * data
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
#define ASN1_TFLG_TAG_MASK
#define ERR_R_INTERNAL_ERROR
#define V_ASN1_NUMERICSTRING
#define ASN1_ITYPE_EXTERN
#define V_ASN1_BIT_STRING
static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass, int optional)
void qsort(void *a, size_t n, size_t es, int(*cmp)(const void *, const void *))
static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, int skcontlen, const ASN1_ITEM *item, int do_sort)
#define ASN1_R_BAD_TEMPLATE
UniquePtr< SSL_SESSION > ret
static int der_cmp(const void *a, const void *b)
struct ASN1_VALUE_st ASN1_VALUE
#define ASN1_ITYPE_MSTRING
union asn1_type_st::@361 value
#define ASN1_ITYPE_PRIMITIVE
#define asn1_get_choice_selector
#define i2c_ASN1_BIT_STRING
#define V_ASN1_NEG_INTEGER
#define V_ASN1_UNIVERSALSTRING
#define ERR_R_MALLOC_FAILURE
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:25