Classes | Macros | Typedefs | Functions
v3_utl.c File Reference
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <openssl/bn.h>
#include <openssl/conf.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include <openssl/obj.h>
#include <openssl/x509v3.h>
#include "../conf/internal.h"
#include "../internal.h"
#include "internal.h"
Include dependency graph for v3_utl.c:

Go to the source code of this file.

Classes

struct  IPV6_STAT
 

Macros

#define HDR_NAME   1
 
#define HDR_VALUE   2
 
#define LABEL_END   (1 << 1)
 
#define LABEL_HYPHEN   (1 << 2)
 
#define LABEL_IDNA   (1 << 3)
 
#define LABEL_START   (1 << 0)
 

Typedefs

typedef int(* equal_fn) (const unsigned char *pattern, size_t pattern_len, const unsigned char *subject, size_t subject_len, unsigned int flags)
 

Functions

ASN1_OCTET_STRINGa2i_IPADDRESS (const char *ipasc)
 
ASN1_OCTET_STRINGa2i_IPADDRESS_NC (const char *ipasc)
 
static int append_ia5 (STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email)
 
static char * bignum_to_string (const BIGNUM *bn)
 
static int do_check_string (ASN1_STRING *a, int cmp_type, equal_fn equal, unsigned int flags, int check_type, const char *b, size_t blen, char **peername)
 
static int do_x509_check (X509 *x, const char *chk, size_t chklen, unsigned int flags, int check_type, char **peername)
 
static int equal_case (const unsigned char *pattern, size_t pattern_len, const unsigned char *subject, size_t subject_len, unsigned int flags)
 
static int equal_email (const unsigned char *a, size_t a_len, const unsigned char *b, size_t b_len, unsigned int unused_flags)
 
static int equal_nocase (const unsigned char *pattern, size_t pattern_len, const unsigned char *subject, size_t subject_len, unsigned int flags)
 
static int equal_wildcard (const unsigned char *pattern, size_t pattern_len, const unsigned char *subject, size_t subject_len, unsigned int flags)
 
char * i2s_ASN1_ENUMERATED (X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a)
 
char * i2s_ASN1_INTEGER (X509V3_EXT_METHOD *method, const ASN1_INTEGER *a)
 
static int ipv4_from_asc (unsigned char v4[4], const char *in)
 
static int ipv6_cb (const char *elem, int len, void *usr)
 
static int ipv6_from_asc (unsigned char v6[16], const char *in)
 
static int ipv6_hex (unsigned char *out, const char *in, int inlen)
 
ASN1_INTEGERs2i_ASN1_INTEGER (X509V3_EXT_METHOD *method, const char *value)
 
static int sk_strcmp (const OPENSSL_STRING *a, const OPENSSL_STRING *b)
 
static void skip_prefix (const unsigned char **p, size_t *plen, const unsigned char *subject, size_t subject_len, unsigned int flags)
 
 STACK_OF (CONF_VALUE)
 
static STACK_OF (OPENSSL_STRING)
 
static void str_free (OPENSSL_STRING str)
 
static char * strip_spaces (char *name)
 
static const unsigned char * valid_star (const unsigned char *p, size_t len, unsigned int flags)
 
static int wildcard_match (const unsigned char *prefix, size_t prefix_len, const unsigned char *suffix, size_t suffix_len, const unsigned char *subject, size_t subject_len, unsigned int flags)
 
int X509_check_email (X509 *x, const char *chk, size_t chklen, unsigned int flags)
 
int X509_check_host (X509 *x, const char *chk, size_t chklen, unsigned int flags, char **peername)
 
int X509_check_ip (X509 *x, const unsigned char *chk, size_t chklen, unsigned int flags)
 
int X509_check_ip_asc (X509 *x, const char *ipasc, unsigned int flags)
 
void X509_email_free (STACK_OF(OPENSSL_STRING) *sk)
 
int x509v3_a2i_ipadd (unsigned char ipout[16], const char *ipasc)
 
int X509V3_add_value (const char *name, const char *value, STACK_OF(CONF_VALUE) **extlist)
 
int x509V3_add_value_asn1_string (const char *name, const ASN1_STRING *value, STACK_OF(CONF_VALUE) **extlist)
 
int X509V3_add_value_bool (const char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist)
 
int X509V3_add_value_bool_nf (const char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist)
 
int X509V3_add_value_int (const char *name, const ASN1_INTEGER *aint, STACK_OF(CONF_VALUE) **extlist)
 
int X509V3_add_value_uchar (const char *name, const unsigned char *value, STACK_OF(CONF_VALUE) **extlist)
 
char * x509v3_bytes_to_hex (const unsigned char *buffer, long len)
 
void X509V3_conf_free (CONF_VALUE *conf)
 
int X509V3_get_value_bool (const CONF_VALUE *value, int *asn1_bool)
 
int X509V3_get_value_int (const CONF_VALUE *value, ASN1_INTEGER **aint)
 
unsigned char * x509v3_hex_to_bytes (const char *str, long *len)
 
int x509v3_looks_like_dns_name (const unsigned char *in, size_t len)
 
int x509v3_name_cmp (const char *name, const char *cmp)
 
int X509V3_NAME_from_section (X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk, unsigned long chtype)
 

Macro Definition Documentation

◆ HDR_NAME

#define HDR_NAME   1

Definition at line 345 of file v3_utl.c.

◆ HDR_VALUE

#define HDR_VALUE   2

Definition at line 346 of file v3_utl.c.

◆ LABEL_END

#define LABEL_END   (1 << 1)

Definition at line 869 of file v3_utl.c.

◆ LABEL_HYPHEN

#define LABEL_HYPHEN   (1 << 2)

Definition at line 870 of file v3_utl.c.

◆ LABEL_IDNA

#define LABEL_IDNA   (1 << 3)

Definition at line 871 of file v3_utl.c.

◆ LABEL_START

#define LABEL_START   (1 << 0)

Definition at line 868 of file v3_utl.c.

Typedef Documentation

◆ equal_fn

typedef int(* equal_fn) (const unsigned char *pattern, size_t pattern_len, const unsigned char *subject, size_t subject_len, unsigned int flags)

Definition at line 707 of file v3_utl.c.

Function Documentation

◆ a2i_IPADDRESS()

ASN1_OCTET_STRING* a2i_IPADDRESS ( const char *  ipasc)

Definition at line 1171 of file v3_utl.c.

◆ a2i_IPADDRESS_NC()

ASN1_OCTET_STRING* a2i_IPADDRESS_NC ( const char *  ipasc)

Definition at line 1191 of file v3_utl.c.

◆ append_ia5()

static int append_ia5 ( STACK_OF(OPENSSL_STRING) **  sk,
ASN1_IA5STRING email 
)
static

Definition at line 659 of file v3_utl.c.

◆ bignum_to_string()

static char* bignum_to_string ( const BIGNUM bn)
static

Definition at line 185 of file v3_utl.c.

◆ do_check_string()

static int do_check_string ( ASN1_STRING a,
int  cmp_type,
equal_fn  equal,
unsigned int  flags,
int  check_type,
const char *  b,
size_t  blen,
char **  peername 
)
static

Definition at line 1009 of file v3_utl.c.

◆ do_x509_check()

static int do_x509_check ( X509 x,
const char *  chk,
size_t  chklen,
unsigned int  flags,
int  check_type,
char **  peername 
)
static

Definition at line 1050 of file v3_utl.c.

◆ equal_case()

static int equal_case ( const unsigned char *  pattern,
size_t  pattern_len,
const unsigned char *  subject,
size_t  subject_len,
unsigned int  flags 
)
static

Definition at line 773 of file v3_utl.c.

◆ equal_email()

static int equal_email ( const unsigned char *  a,
size_t  a_len,
const unsigned char *  b,
size_t  b_len,
unsigned int  unused_flags 
)
static

Definition at line 787 of file v3_utl.c.

◆ equal_nocase()

static int equal_nocase ( const unsigned char *  pattern,
size_t  pattern_len,
const unsigned char *  subject,
size_t  subject_len,
unsigned int  flags 
)
static

Definition at line 744 of file v3_utl.c.

◆ equal_wildcard()

static int equal_wildcard ( const unsigned char *  pattern,
size_t  pattern_len,
const unsigned char *  subject,
size_t  subject_len,
unsigned int  flags 
)
static

Definition at line 936 of file v3_utl.c.

◆ i2s_ASN1_ENUMERATED()

char* i2s_ASN1_ENUMERATED ( X509V3_EXT_METHOD method,
const ASN1_ENUMERATED a 
)

Definition at line 224 of file v3_utl.c.

◆ i2s_ASN1_INTEGER()

char* i2s_ASN1_INTEGER ( X509V3_EXT_METHOD method,
const ASN1_INTEGER a 
)

Definition at line 237 of file v3_utl.c.

◆ ipv4_from_asc()

static int ipv4_from_asc ( unsigned char  v4[4],
const char *  in 
)
static

Definition at line 1250 of file v3_utl.c.

◆ ipv6_cb()

static int ipv6_cb ( const char *  elem,
int  len,
void *  usr 
)
static

Definition at line 1340 of file v3_utl.c.

◆ ipv6_from_asc()

static int ipv6_from_asc ( unsigned char  v6[16],
const char *  in 
)
static

Definition at line 1276 of file v3_utl.c.

◆ ipv6_hex()

static int ipv6_hex ( unsigned char *  out,
const char *  in,
int  inlen 
)
static

Definition at line 1379 of file v3_utl.c.

◆ s2i_ASN1_INTEGER()

ASN1_INTEGER* s2i_ASN1_INTEGER ( X509V3_EXT_METHOD method,
const char *  value 
)

Definition at line 250 of file v3_utl.c.

◆ sk_strcmp()

static int sk_strcmp ( const OPENSSL_STRING a,
const OPENSSL_STRING b 
)
static

Definition at line 572 of file v3_utl.c.

◆ skip_prefix()

static void skip_prefix ( const unsigned char **  p,
size_t *  plen,
const unsigned char *  subject,
size_t  subject_len,
unsigned int  flags 
)
static

Definition at line 712 of file v3_utl.c.

◆ STACK_OF() [1/2]

STACK_OF ( CONF_VALUE  )

Definition at line 352 of file v3_utl.c.

◆ STACK_OF() [2/2]

static STACK_OF ( OPENSSL_STRING  )
static

Definition at line 79 of file v3_utl.c.

◆ str_free()

static void str_free ( OPENSSL_STRING  str)
static

Definition at line 654 of file v3_utl.c.

◆ strip_spaces()

static char * strip_spaces ( char *  name)
static

Definition at line 449 of file v3_utl.c.

◆ valid_star()

static const unsigned char* valid_star ( const unsigned char *  p,
size_t  len,
unsigned int  flags 
)
static

Definition at line 873 of file v3_utl.c.

◆ wildcard_match()

static int wildcard_match ( const unsigned char *  prefix,
size_t  prefix_len,
const unsigned char *  suffix,
size_t  suffix_len,
const unsigned char *  subject,
size_t  subject_len,
unsigned int  flags 
)
static

Definition at line 816 of file v3_utl.c.

◆ X509_check_email()

int X509_check_email ( X509 x,
const char *  chk,
size_t  chklen,
unsigned int  flags 
)

Definition at line 1135 of file v3_utl.c.

◆ X509_check_host()

int X509_check_host ( X509 x,
const char *  chk,
size_t  chklen,
unsigned int  flags,
char **  peername 
)

Definition at line 1125 of file v3_utl.c.

◆ X509_check_ip()

int X509_check_ip ( X509 x,
const unsigned char *  chk,
size_t  chklen,
unsigned int  flags 
)

Definition at line 1145 of file v3_utl.c.

◆ X509_check_ip_asc()

int X509_check_ip_asc ( X509 x,
const char *  ipasc,
unsigned int  flags 
)

Definition at line 1153 of file v3_utl.c.

◆ X509_email_free()

void X509_email_free ( STACK_OF(OPENSSL_STRING) *  sk)

Definition at line 702 of file v3_utl.c.

◆ x509v3_a2i_ipadd()

int x509v3_a2i_ipadd ( unsigned char  ipout[16],
const char *  ipasc 
)

Definition at line 1235 of file v3_utl.c.

◆ X509V3_add_value()

int X509V3_add_value ( const char *  name,
const char *  value,
STACK_OF(CONF_VALUE) **  extlist 
)

Definition at line 134 of file v3_utl.c.

◆ x509V3_add_value_asn1_string()

int x509V3_add_value_asn1_string ( const char *  name,
const ASN1_STRING value,
STACK_OF(CONF_VALUE) **  extlist 
)

Definition at line 147 of file v3_utl.c.

◆ X509V3_add_value_bool()

int X509V3_add_value_bool ( const char *  name,
int  asn1_bool,
STACK_OF(CONF_VALUE) **  extlist 
)

Definition at line 169 of file v3_utl.c.

◆ X509V3_add_value_bool_nf()

int X509V3_add_value_bool_nf ( const char *  name,
int  asn1_bool,
STACK_OF(CONF_VALUE) **  extlist 
)

Definition at line 177 of file v3_utl.c.

◆ X509V3_add_value_int()

int X509V3_add_value_int ( const char *  name,
const ASN1_INTEGER aint,
STACK_OF(CONF_VALUE) **  extlist 
)

Definition at line 298 of file v3_utl.c.

◆ X509V3_add_value_uchar()

int X509V3_add_value_uchar ( const char *  name,
const unsigned char *  value,
STACK_OF(CONF_VALUE) **  extlist 
)

Definition at line 141 of file v3_utl.c.

◆ x509v3_bytes_to_hex()

char* x509v3_bytes_to_hex ( const unsigned char *  buffer,
long  len 
)

Definition at line 476 of file v3_utl.c.

◆ X509V3_conf_free()

void X509V3_conf_free ( CONF_VALUE conf)

Definition at line 156 of file v3_utl.c.

◆ X509V3_get_value_bool()

int X509V3_get_value_bool ( const CONF_VALUE value,
int asn1_bool 
)

Definition at line 312 of file v3_utl.c.

◆ X509V3_get_value_int()

int X509V3_get_value_int ( const CONF_VALUE value,
ASN1_INTEGER **  aint 
)

Definition at line 334 of file v3_utl.c.

◆ x509v3_hex_to_bytes()

unsigned char* x509v3_hex_to_bytes ( const char *  str,
long len 
)

Definition at line 499 of file v3_utl.c.

◆ x509v3_looks_like_dns_name()

int x509v3_looks_like_dns_name ( const unsigned char *  in,
size_t  len 
)

Definition at line 956 of file v3_utl.c.

◆ x509v3_name_cmp()

int x509v3_name_cmp ( const char *  name,
const char *  cmp 
)

Definition at line 559 of file v3_utl.c.

◆ X509V3_NAME_from_section()

int X509V3_NAME_from_section ( X509_NAME nm,
STACK_OF(CONF_VALUE) *  dn_sk,
unsigned long  chtype 
)

Definition at line 1402 of file v3_utl.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:37