coding.c File Reference

#include <int.h>
#include "parser_aux.h"
#include <gstr.h>
#include "element.h"
#include <structure.h>

Include dependency graph for coding.c:

Go to the source code of this file.

Defines

#define MAX_TAG_LEN   16

Functions

static void MHD__asn1_error_description_value_not_found (node_asn *node, char *ErrorDescription)
void MHD__asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len)
static void MHD__asn1_tag_der (unsigned char class, unsigned int tag_value, unsigned char *ans, int *ans_len)
void MHD__asn1_octet_der (const unsigned char *str, int str_len, unsigned char *der, int *der_len)
static MHD__asn1_retCode MHD__asn1_time_der (unsigned char *str, unsigned char *der, int *der_len)
static MHD__asn1_retCode MHD__asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len)
void MHD__asn1_bit_der (const unsigned char *str, int bit_len, unsigned char *der, int *der_len)
static MHD__asn1_retCode MHD__asn1_complete_explicit_tag (node_asn *node, unsigned char *der, int *counter, int *max_len)
static MHD__asn1_retCode MHD__asn1_insert_tag_der (node_asn *node, unsigned char *der, int *counter, int *max_len)
static void MHD__asn1_ordering_set (unsigned char *der, int der_len, node_asn *node)
static void MHD__asn1_ordering_set_of (unsigned char *der, int der_len, node_asn *node)
: the name of the structure you want to encode (it must be
MHD__asn1_der_coding - Creates the DER encoding for the NAME structure : pointer to an ASN1 element

inside *POINTER). : vector that will contain the DER encoding. DER must be a pointer to memory cells already allocated. : number of bytes of *: [0]..[len-1], Initialy holds the sizeof of der vector. : return the error description or an empty string if success.

Creates the DER encoding for the NAME structure (inside *POINTER structure).

Returns:

ASN1_SUCCESS: DER encoding OK.

ASN1_ELEMENT_NOT_FOUND: NAME is not a valid element.

ASN1_VALUE_NOT_FOUND: There is an element without a value.

ASN1_MEM_ERROR: vector isn't big enough. Also in this case LEN will contain the length needed.

MHD__asn1_retCode MHD__asn1_der_coding (ASN1_TYPE element, const char *name, void *ider, int *len, char *ErrorDescription)

Variables

const char MHD_bit_mask []


Define Documentation

#define MAX_TAG_LEN   16

Definition at line 36 of file coding.c.

Referenced by MHD__asn1_insert_tag_der().


Function Documentation

void MHD__asn1_bit_der ( const unsigned char *  str,
int  bit_len,
unsigned char *  der,
int *  der_len 
)

MHD__asn1_bit_der: : BIT string. : number of meaningful bits in STR. : string returned. : number of meaningful bytes of DER (der[0]..der[ans_len-1]).

Creates the DER coding for a BIT STRING type (length and pad included).

Definition at line 303 of file coding.c.

References MHD__asn1_length_der(), and MHD_bit_mask.

Referenced by MHD__asn1_write_value().

Here is the call graph for this function:

Here is the caller graph for this function:

static MHD__asn1_retCode MHD__asn1_complete_explicit_tag ( node_asn node,
unsigned char *  der,
int *  counter,
int *  max_len 
) [static]

MHD__asn1_retCode MHD__asn1_der_coding ( ASN1_TYPE  element,
const char *  name,
void *  ider,
int *  len,
char *  ErrorDescription 
)

static void MHD__asn1_error_description_value_not_found ( node_asn node,
char *  ErrorDescription 
) [static]

Definition at line 48 of file coding.c.

References Estrcat, Estrcpy, MAX_ERROR_DESCRIPTION_SIZE, and MHD__asn1_hierarchical_name().

Referenced by MHD__asn1_der_coding().

Here is the call graph for this function:

Here is the caller graph for this function:

static MHD__asn1_retCode MHD__asn1_insert_tag_der ( node_asn node,
unsigned char *  der,
int *  counter,
int *  max_len 
) [static]

void MHD__asn1_length_der ( unsigned long int  len,
unsigned char *  ans,
int *  ans_len 
)

MHD__asn1_length_der: : value to convert. : string returned. : number of meaningful bytes of ANS (ans[0]..ans[ans_len-1]).

Creates the DER coding for the LEN parameter (only the length). The buffer is pre-allocated and must have room for the output.

Definition at line 73 of file coding.c.

References SIZEOF_UNSIGNED_LONG_INT.

Referenced by MHD__asn1_bit_der(), MHD__asn1_complete_explicit_tag(), MHD__asn1_der_coding(), MHD__asn1_der_decoding(), MHD__asn1_get_octet_string(), MHD__asn1_objectid_der(), MHD__asn1_octet_der(), MHD__asn1_time_der(), and MHD__asn1_write_value().

Here is the caller graph for this function:

static MHD__asn1_retCode MHD__asn1_objectid_der ( unsigned char *  str,
unsigned char *  der,
int *  der_len 
) [static]

Definition at line 218 of file coding.c.

References ASN1_MEM_ALLOC_ERROR, ASN1_MEM_ERROR, ASN1_SUCCESS, MHD__asn1_afree, MHD__asn1_alloca, and MHD__asn1_length_der().

Referenced by MHD__asn1_der_coding().

Here is the call graph for this function:

Here is the caller graph for this function:

void MHD__asn1_octet_der ( const unsigned char *  str,
int  str_len,
unsigned char *  der,
int *  der_len 
)

MHD__asn1_octet_der: : OCTET string. : STR length (str[0]..str[str_len-1]). : string returned. : number of meaningful bytes of DER (der[0]..der[ans_len-1]).

Creates the DER coding for an OCTET type (length included).

Definition at line 156 of file coding.c.

References MHD__asn1_length_der().

Referenced by MHD__asn1_change_integer_value(), MHD__asn1_der_decoding(), and MHD__asn1_write_value().

Here is the call graph for this function:

Here is the caller graph for this function:

static void MHD__asn1_ordering_set ( unsigned char *  der,
int  der_len,
node_asn node 
) [static]

Definition at line 578 of file coding.c.

References ASN1_SUCCESS, node_asn_struct::down, MHD__asn1_afree, MHD__asn1_alloca, MHD__asn1_get_length_der(), MHD__asn1_get_tag_der(), node_asn_struct::right, node_asn_struct::type, type_field, TYPE_SET, TYPE_SIZE, and TYPE_TAG.

Referenced by MHD__asn1_der_coding().

Here is the call graph for this function:

Here is the caller graph for this function:

static void MHD__asn1_ordering_set_of ( unsigned char *  der,
int  der_len,
node_asn node 
) [static]

Definition at line 695 of file coding.c.

References ASN1_SUCCESS, node_asn_struct::down, MHD__asn1_afree, MHD__asn1_alloca, MHD__asn1_get_length_der(), MHD__asn1_get_tag_der(), node_asn_struct::right, node_asn_struct::type, type_field, TYPE_SET_OF, TYPE_SIZE, and TYPE_TAG.

Referenced by MHD__asn1_der_coding().

Here is the call graph for this function:

Here is the caller graph for this function:

static void MHD__asn1_tag_der ( unsigned char  class,
unsigned int  tag_value,
unsigned char *  ans,
int *  ans_len 
) [static]

Definition at line 117 of file coding.c.

References SIZEOF_UNSIGNED_INT.

Referenced by MHD__asn1_insert_tag_der().

Here is the caller graph for this function:

static MHD__asn1_retCode MHD__asn1_time_der ( unsigned char *  str,
unsigned char *  der,
int *  der_len 
) [static]

Definition at line 183 of file coding.c.

References ASN1_MEM_ERROR, ASN1_SUCCESS, and MHD__asn1_length_der().

Referenced by MHD__asn1_der_coding().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char MHD_bit_mask[]

Initial value:

  { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80 }

Definition at line 288 of file coding.c.

Referenced by MHD__asn1_bit_der().


Generated on Fri Feb 27 18:31:31 2009 for GNU libmicrohttpd by  doxygen 1.5.7.1